summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorManish Singh <yosh@gimp.org>2002-09-25 06:34:33 +0000
committerManish Singh <yosh@src.gnome.org>2002-09-25 06:34:33 +0000
commit9cde6b74d563a68026e439d1aa2a834162745a78 (patch)
treed0ac1d1f2ce6d31d7b8ee051dd7552fd1217e06e /gtk
parent273f99112e907480e9cd776505dd8c69f32773ec (diff)
downloadgdk-pixbuf-9cde6b74d563a68026e439d1aa2a834162745a78.tar.gz
preserve ordering from gtk_tree_selection_foreach when returning filenames
Tue Sep 24 23:33:48 2002 Manish Singh <yosh@gimp.org> * gtk/gtkfilesel.c: preserve ordering from gtk_tree_selection_foreach when returning filenames for gtk_file_selection_get_selections (#86567) * gtk/gtkclipboard.c: GtkClipboard struct should have a GObject in it, not a GObjectClass
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkclipboard.c2
-rw-r--r--gtk/gtkfilesel.c16
2 files changed, 12 insertions, 6 deletions
diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c
index 425805463..fb45ff249 100644
--- a/gtk/gtkclipboard.c
+++ b/gtk/gtkclipboard.c
@@ -41,7 +41,7 @@ typedef struct _RequestTextInfo RequestTextInfo;
struct _GtkClipboard
{
- GObjectClass parent_instance;
+ GObject parent_instance;
GdkAtom selection;
diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c
index f8be98bf6..a4e7a9191 100644
--- a/gtk/gtkfilesel.c
+++ b/gtk/gtkfilesel.c
@@ -2364,6 +2364,7 @@ gtk_file_selection_get_selections (GtkFileSelection *filesel)
gchar *filename, *dirname;
gchar *current, *buf;
gint i, count;
+ gboolean unselected_entry;
g_return_val_if_fail (GTK_IS_FILE_SELECTION (filesel), NULL);
@@ -2383,7 +2384,7 @@ gtk_file_selection_get_selections (GtkFileSelection *filesel)
selections = g_new (gchar *, 2);
count = 0;
- selections[count++] = filename;
+ unselected_entry = TRUE;
if (names != NULL)
{
@@ -2396,15 +2397,20 @@ gtk_file_selection_get_selections (GtkFileSelection *filesel)
current = g_build_filename (dirname, buf, NULL);
g_free (buf);
- if (compare_filenames (current, filename) != 0)
- selections[count++] = current;
- else
- g_free (current);
+ selections[count++] = current;
+
+ if (unselected_entry && compare_filenames (current, filename) == 0)
+ unselected_entry = FALSE;
}
g_free (dirname);
}
+ if (unselected_entry)
+ selections[count++] = filename;
+ else
+ g_free (filename);
+
selections[count] = NULL;
return selections;