]> Pileus Git - ~andy/gtk/commitdiff
preserve ordering from gtk_tree_selection_foreach when returning filenames
authorManish Singh <yosh@gimp.org>
Wed, 25 Sep 2002 06:34:33 +0000 (06:34 +0000)
committerManish Singh <yosh@src.gnome.org>
Wed, 25 Sep 2002 06:34:33 +0000 (06:34 +0000)
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

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkclipboard.c
gtk/gtkfilesel.c

index cef950f09bfdc5c36453c92dff7b26202ab18dfd..f8276b0b4adef643b5dfa7f56b9a44a5a5fde2be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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
+
 Tue Sep 24 18:18:36 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclipboard.[ch]: Make a GObject (#75970, James
index cef950f09bfdc5c36453c92dff7b26202ab18dfd..f8276b0b4adef643b5dfa7f56b9a44a5a5fde2be 100644 (file)
@@ -1,3 +1,12 @@
+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
+
 Tue Sep 24 18:18:36 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclipboard.[ch]: Make a GObject (#75970, James
index cef950f09bfdc5c36453c92dff7b26202ab18dfd..f8276b0b4adef643b5dfa7f56b9a44a5a5fde2be 100644 (file)
@@ -1,3 +1,12 @@
+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
+
 Tue Sep 24 18:18:36 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclipboard.[ch]: Make a GObject (#75970, James
index cef950f09bfdc5c36453c92dff7b26202ab18dfd..f8276b0b4adef643b5dfa7f56b9a44a5a5fde2be 100644 (file)
@@ -1,3 +1,12 @@
+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
+
 Tue Sep 24 18:18:36 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclipboard.[ch]: Make a GObject (#75970, James
index cef950f09bfdc5c36453c92dff7b26202ab18dfd..f8276b0b4adef643b5dfa7f56b9a44a5a5fde2be 100644 (file)
@@ -1,3 +1,12 @@
+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
+
 Tue Sep 24 18:18:36 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclipboard.[ch]: Make a GObject (#75970, James
index cef950f09bfdc5c36453c92dff7b26202ab18dfd..f8276b0b4adef643b5dfa7f56b9a44a5a5fde2be 100644 (file)
@@ -1,3 +1,12 @@
+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
+
 Tue Sep 24 18:18:36 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclipboard.[ch]: Make a GObject (#75970, James
index 42580546307716c7c1b09a592e96f73756b655d9..fb45ff249b4967a1369a69529fe8308d2d074cce 100644 (file)
@@ -41,7 +41,7 @@ typedef struct _RequestTextInfo RequestTextInfo;
 
 struct _GtkClipboard 
 {
-  GObjectClass parent_instance;
+  GObject parent_instance;
 
   GdkAtom selection;
 
index f8be98bf6b9675f9db6c75ff92282779e2bb3a9d..a4e7a9191d6c105cbdcfb8a040fd59074e9f6bdb 100644 (file)
@@ -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;