[gtk+] placessidebar: Simplify some code
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] placessidebar: Simplify some code
- Date: Sat, 30 May 2015 13:23:00 +0000 (UTC)
commit 4de444ca615529dcc7afdcccbd6c2fcbcb29d9c5
Author: Matthias Clasen <mclasen redhat com>
Date: Sat May 30 09:20:27 2015 -0400
placessidebar: Simplify some code
Use existing functions, instead of open-coding manipulation
of string arrays.
gtk/gtkplacessidebar.c | 17 +++--------------
1 files changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 41ec9ac..31f8eb3 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -565,11 +565,7 @@ recent_files_setting_is_enabled (GtkPlacesSidebar *sidebar)
GtkSettings *settings;
gboolean enabled;
- if (gtk_widget_has_screen (GTK_WIDGET (sidebar)))
- settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (sidebar)));
- else
- settings = gtk_settings_get_default ();
-
+ settings = gtk_widget_get_settings (GTK_WIDGET (sidebar));
g_object_get (settings, "gtk-recent-files-enabled", &enabled, NULL);
return enabled;
@@ -579,17 +575,10 @@ static gboolean
recent_scheme_is_supported (void)
{
const gchar * const *supported;
- gint i;
supported = g_vfs_get_supported_uri_schemes (g_vfs_get_default ());
- if (supported == NULL)
- return FALSE;
-
- for (i = 0; supported[i] != NULL; i++)
- {
- if (strcmp ("recent", supported[i]) == 0)
- return TRUE;
- }
+ if (supported != NULL)
+ return g_strv_contains (supported, "recent");
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]