]> Pileus Git - ~andy/gtk/commitdiff
Do nothing if we have no screen. Fixes #137260.
authorMorten Welinder <terra@gnome.org>
Wed, 17 Mar 2004 15:34:21 +0000 (15:34 +0000)
committerMorten Welinder <mortenw@src.gnome.org>
Wed, 17 Mar 2004 15:34:21 +0000 (15:34 +0000)
2004-03-17  Morten Welinder  <terra@gnome.org>

* gtk/gtkfilechooserdefault.c (check_icon_theme): Do nothing if we
have no screen.  Fixes #137260.
(shortcuts_add_bookmark_from_path): Simplify using check_is_folder
thereby fixing leak.  Fixes #137259.

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

index 7dcb74831c4cfb2d7b3692d85fa47c202ebb97e7..c65f4976e3fb669d486300f49ff198d30d4af1b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,14 @@
 2004-03-17  Morten Welinder  <terra@gnome.org>
 
+       * gtk/gtkfilechooserdefault.c (check_icon_theme): Do nothing if we
+       have no screen.  Fixes #137260.
+       (shortcuts_add_bookmark_from_path): Simplify using check_is_folder
+       thereby fixing leak.  Fixes #137259.
+
        * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the
        slider buttons have been destroyed.
        (gtk_path_bar_remove): Make this work for slider buttons too.
-       Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257
+       Fixes #137257
 
 2004-03-15  Morten Welinder  <terra@gnome.org>
 
index 7dcb74831c4cfb2d7b3692d85fa47c202ebb97e7..c65f4976e3fb669d486300f49ff198d30d4af1b7 100644 (file)
@@ -1,9 +1,14 @@
 2004-03-17  Morten Welinder  <terra@gnome.org>
 
+       * gtk/gtkfilechooserdefault.c (check_icon_theme): Do nothing if we
+       have no screen.  Fixes #137260.
+       (shortcuts_add_bookmark_from_path): Simplify using check_is_folder
+       thereby fixing leak.  Fixes #137259.
+
        * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the
        slider buttons have been destroyed.
        (gtk_path_bar_remove): Make this work for slider buttons too.
-       Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257
+       Fixes #137257
 
 2004-03-15  Morten Welinder  <terra@gnome.org>
 
index 7dcb74831c4cfb2d7b3692d85fa47c202ebb97e7..c65f4976e3fb669d486300f49ff198d30d4af1b7 100644 (file)
@@ -1,9 +1,14 @@
 2004-03-17  Morten Welinder  <terra@gnome.org>
 
+       * gtk/gtkfilechooserdefault.c (check_icon_theme): Do nothing if we
+       have no screen.  Fixes #137260.
+       (shortcuts_add_bookmark_from_path): Simplify using check_is_folder
+       thereby fixing leak.  Fixes #137259.
+
        * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the
        slider buttons have been destroyed.
        (gtk_path_bar_remove): Make this work for slider buttons too.
-       Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257
+       Fixes #137257
 
 2004-03-15  Morten Welinder  <terra@gnome.org>
 
index 7dcb74831c4cfb2d7b3692d85fa47c202ebb97e7..c65f4976e3fb669d486300f49ff198d30d4af1b7 100644 (file)
@@ -1,9 +1,14 @@
 2004-03-17  Morten Welinder  <terra@gnome.org>
 
+       * gtk/gtkfilechooserdefault.c (check_icon_theme): Do nothing if we
+       have no screen.  Fixes #137260.
+       (shortcuts_add_bookmark_from_path): Simplify using check_is_folder
+       thereby fixing leak.  Fixes #137259.
+
        * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the
        slider buttons have been destroyed.
        (gtk_path_bar_remove): Make this work for slider buttons too.
-       Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257
+       Fixes #137257
 
 2004-03-15  Morten Welinder  <terra@gnome.org>
 
index 7dcb74831c4cfb2d7b3692d85fa47c202ebb97e7..c65f4976e3fb669d486300f49ff198d30d4af1b7 100644 (file)
@@ -1,9 +1,14 @@
 2004-03-17  Morten Welinder  <terra@gnome.org>
 
+       * gtk/gtkfilechooserdefault.c (check_icon_theme): Do nothing if we
+       have no screen.  Fixes #137260.
+       (shortcuts_add_bookmark_from_path): Simplify using check_is_folder
+       thereby fixing leak.  Fixes #137259.
+
        * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the
        slider buttons have been destroyed.
        (gtk_path_bar_remove): Make this work for slider buttons too.
-       Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257
+       Fixes #137257
 
 2004-03-15  Morten Welinder  <terra@gnome.org>
 
index fb79fa8607e1889d88562febd0e0bc5616867a57..39cda5688c6fd3f4fb7cf5b1a2f76f184017510a 100644 (file)
@@ -1625,42 +1625,30 @@ shortcuts_add_bookmark_from_path (GtkFileChooserDefault *impl,
                                  const GtkFilePath     *path,
                                  int                    pos)
 {
-  GtkFileInfo *info;
   GError *error;
-  gboolean result;
 
   if (shortcut_find_position (impl, path) != -1)
     return FALSE;
 
-  result = FALSE;
-
+  /* FIXME: this check really belongs in gtk_file_system_insert_bookmark.  */
   error = NULL;
-  info = get_file_info (impl->file_system, path, FALSE, &error);
-
-  if (!info)
-    error_getting_info_dialog (impl, path, error);
-  else if (!gtk_file_info_get_is_folder (info))
+  if (!check_is_folder (impl->file_system, path, &error))
     {
-      char *msg;
-      char *uri;
-
-      uri = gtk_file_system_path_to_uri (impl->file_system, path);
-      msg = g_strdup_printf (_("Could not add bookmark for %s because it is not a folder."),
-                            uri);
-      error_message (impl, msg);
-      g_free (uri);
-      g_free (msg);
+      error_dialog (impl,
+                   _("Could not add bookmark for %s because it is not a folder."),
+                   path,
+                   error);
+      return FALSE;
     }
-  else
+
+  error = NULL;
+  if (!gtk_file_system_insert_bookmark (impl->file_system, path, pos, &error))
     {
-      error = NULL;
-      if (gtk_file_system_insert_bookmark (impl->file_system, path, pos, &error))
-       result = TRUE;
-      else
-       error_could_not_add_bookmark_dialog (impl, path, error);
+      error_could_not_add_bookmark_dialog (impl, path, error);
+      return FALSE;
     }
 
-  return result;
+  return TRUE;
 }
 
 static void
@@ -3427,11 +3415,14 @@ check_icon_theme (GtkFileChooserDefault *impl)
   if (impl->settings_signal_id)
     return;
 
-  settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (impl)));
-  impl->settings_signal_id = g_signal_connect (settings, "notify",
-                                              G_CALLBACK (settings_notify_cb), impl);
+  if (gtk_widget_has_screen (GTK_WIDGET (impl)))
+    {
+      settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (impl)));
+      impl->settings_signal_id = g_signal_connect (settings, "notify",
+                                                  G_CALLBACK (settings_notify_cb), impl);
 
-  change_icon_theme (impl);
+      change_icon_theme (impl);
+    }
 }
 
 static void