diff src/dialogs.c @ 1977:7b3f1eb1ef7d

[gaim-migrate @ 1987] updated icqlib. fixed import dialog (watch debug window for errors). adam's (not mid's) patch for oscar. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 09 Jun 2001 14:46:51 +0000
parents 97b1667e1255
children e43c267b1a8a
line wrap: on
line diff
--- a/src/dialogs.c	Fri Jun 08 23:17:17 2001 +0000
+++ b/src/dialogs.c	Sat Jun 09 14:46:51 2001 +0000
@@ -2889,13 +2889,16 @@
 	gboolean from_dialog = FALSE;
 
 	if ( !gc ) {
+		debug_printf("want to import file ");
 		file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(importdialog));
-				strncpy( path, file, PATHSIZE - 1 );
-		if (file_is_dir(path, importdialog)) {
+		debug_printf("%s", file);
+		if (file_is_dir(file, importdialog)) {
+			debug_printf(" but it is a directory\n");
 			g_free (buf);
 			g_free (first);
 			return;
 		}
+		strncpy( path, file, PATHSIZE - 1 );
 		/* FIXME : import buddy list file. moderately important */
 		gc = connections->data;
 		from_dialog = TRUE;
@@ -2910,12 +2913,15 @@
 			g_free(g_screenname);
 		} else {
 			g_free(g_screenname);
+			g_free(buf);
+			g_free(first);
 			return;
 		}
 	}
 
 	if (!(f = fopen(path,"r"))) {
-		if ( !gc ) {
+		if (from_dialog) {
+			debug_printf(" but it can't be opened\n");
                 	g_snprintf(buf, BUF_LONG / 2, _("Error reading file %s"), path);
                 	do_error_dialog(buf, _("Error"));
                 	destroy_dialog(NULL, importdialog);
@@ -2960,7 +2966,8 @@
                 g_free(buf2);
 	/* Something else */
         } else {
-		if ( !gc ) {
+		if (from_dialog) {
+			debug_printf(" but I don't recognize the format\n");
                 	destroy_dialog(NULL, importdialog);
                 	importdialog = NULL;
 		}
@@ -2970,6 +2977,9 @@
                 return;
 	}
 
+	if (from_dialog)
+		debug_printf("\n");
+
         parse_toc_buddy_list(gc, buf, 1);
 
 	fclose( f );