diff src/dialogs.c @ 5966:5fb6bd688a5b

[gaim-migrate @ 6413] I renamed file_is_dir to gaim_gtk_check_if_dir and moved it to gtkutils.c/h Chipster (or whoever) - Lemme know if that's notsogood, remember: I pretend not to know anything about gtk. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 27 Jun 2003 23:11:21 +0000
parents 0a2a32b1917c
children 730015652f4d
line wrap: on
line diff
--- a/src/dialogs.c	Fri Jun 27 22:44:03 2003 +0000
+++ b/src/dialogs.c	Fri Jun 27 23:11:21 2003 +0000
@@ -2495,7 +2495,7 @@
 
 		strncpy(path, file, PATHSIZE - 1);
 
-		if (file_is_dir(path, GTK_FILE_SELECTION(gtkconv->dialogs.log)))
+		if (gaim_gtk_check_if_dir(path, GTK_FILE_SELECTION(gtkconv->dialogs.log)))
 			return;
 
 		l = (struct log_conversation *)g_new0(struct log_conversation, 1);
@@ -3806,7 +3806,7 @@
 
 	file = (const char*)gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel));
 	strncpy(path, file, PATHSIZE - 1);
-	if (file_is_dir(path, GTK_FILE_SELECTION(filesel)))
+	if (gaim_gtk_check_if_dir(path, GTK_FILE_SELECTION(filesel)))
 		return;
 
 	if ((fp_new = fopen(path, "w")) == NULL) {
@@ -4504,26 +4504,6 @@
 	return button;
 }
 
-int file_is_dir(const char *path, GtkFileSelection *w)
-{
-	struct stat st;
-	char *name;
-
-	if (stat(path, &st) == 0 && S_ISDIR(st.st_mode)) {
-		/* append a / if needed */
-		if (path[strlen(path) - 1] != '/') {
-			name = g_strconcat(path, "/", NULL);
-		} else {
-			name = g_strdup(path);
-		}
-		gtk_file_selection_set_filename(w, name);
-		g_free(name);
-		return 1;
-	}
-
-	return 0;
-}
-
 /*------------------------------------------------------------------------*/
 /*  The dialog for setting V-Card info                                    */
 /*------------------------------------------------------------------------*/