pidgin/gtkutils.c

branch
cpw.qulogic.gtk3
changeset 32376
dd86e84c21a5
parent 32375
9ccb07c70f2a
parent 32373
71a01df1ac09
child 32378
bdfcbacbeb2b
equal deleted inserted replaced
32375:9ccb07c70f2a 32376:dd86e84c21a5
890 890
891 return optmenu; 891 return optmenu;
892 } 892 }
893 893
894 gboolean 894 gboolean
895 #if GTK_CHECK_VERSION(2,4,0)
896 pidgin_check_if_dir(const char *path, gpointer filesel)
897 #else
898 pidgin_check_if_dir(const char *path, GtkFileSelection *filesel) 895 pidgin_check_if_dir(const char *path, GtkFileSelection *filesel)
899 #endif
900 { 896 {
901 char *dirname = NULL; 897 char *dirname = NULL;
902 898
903 if (g_file_test(path, G_FILE_TEST_IS_DIR)) { 899 if (g_file_test(path, G_FILE_TEST_IS_DIR)) {
904 /* append a / if needed */ 900 /* append a / if needed */
905 if (path[strlen(path) - 1] != G_DIR_SEPARATOR) { 901 if (path[strlen(path) - 1] != G_DIR_SEPARATOR) {
906 dirname = g_strconcat(path, G_DIR_SEPARATOR_S, NULL); 902 dirname = g_strconcat(path, G_DIR_SEPARATOR_S, NULL);
907 } 903 }
908 #if !GTK_CHECK_VERSION(2,4,0)
909 gtk_file_selection_set_filename(filesel, (dirname != NULL) ? dirname : path); 904 gtk_file_selection_set_filename(filesel, (dirname != NULL) ? dirname : path);
910 #endif
911 g_free(dirname); 905 g_free(dirname);
912 return TRUE; 906 return TRUE;
913 } 907 }
914 908
915 return FALSE; 909 return FALSE;

mercurial