[gnome-photos] application: Use named constants instead of hard coded strings
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] application: Use named constants instead of hard coded strings
- Date: Wed, 14 Jan 2015 11:53:57 +0000 (UTC)
commit 2168fa70c654fa93f01379222a63d772a28be592
Author: Pranav Kant <pranavk src gnome org>
Date: Sat Jan 3 18:37:28 2015 +0530
application: Use named constants instead of hard coded strings
https://bugzilla.gnome.org/show_bug.cgi?id=741590
src/photos-application.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index 8f0860d..7d5b838 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -1,6 +1,6 @@
/*
* Photos - access, organize and share your photos on GNOME
- * Copyright © 2014 Pranav Kant
+ * Copyright © 2014, 2015 Pranav Kant
* Copyright © 2012, 2013, 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
@@ -102,6 +102,13 @@ enum
MINER_REFRESH_TIMEOUT = 60 /* s */
};
+static const gchar *DESKTOP_BACKGROUND_SCHEMA = "org.gnome.desktop.background";
+static const gchar *DESKTOP_KEY_PICTURE_URI = "picture-uri";
+static const gchar *DESKTOP_KEY_PICTURE_OPTIONS = "picture-options";
+static const gchar *DESKTOP_KEY_COLOR_SHADING_TYPE = "color-shading-type";
+static const gchar *DESKTOP_KEY_PRIMARY_COLOR = "primary-color";
+static const gchar *DESKTOP_KEY_SECONDARY_COLOR = "secondary-color";
+
typedef struct _PhotosApplicationRefreshData PhotosApplicationRefreshData;
struct _PhotosApplicationRefreshData
@@ -508,11 +515,11 @@ photos_application_set_bg_download (GObject *source_object, GAsyncResult *res, g
}
- g_settings_set_string (priv->settings, "picture-uri", filename);
- g_settings_set_enum (priv->settings, "picture-options", G_DESKTOP_BACKGROUND_STYLE_ZOOM);
- g_settings_set_enum (priv->settings, "color-shading-type", G_DESKTOP_BACKGROUND_SHADING_SOLID);
- g_settings_set_string (priv->settings, "primary-color", "#000000000000");
- g_settings_set_string (priv->settings, "secondary-color", "#000000000000");
+ g_settings_set_string (priv->settings, DESKTOP_KEY_PICTURE_URI, filename);
+ g_settings_set_enum (priv->settings, DESKTOP_KEY_PICTURE_OPTIONS, G_DESKTOP_BACKGROUND_STYLE_ZOOM);
+ g_settings_set_enum (priv->settings, DESKTOP_KEY_COLOR_SHADING_TYPE, G_DESKTOP_BACKGROUND_SHADING_SOLID);
+ g_settings_set_string (priv->settings, DESKTOP_KEY_PRIMARY_COLOR, "#000000000000");
+ g_settings_set_string (priv->settings, DESKTOP_KEY_SECONDARY_COLOR, "#000000000000");
out:
g_free (filename);
@@ -812,7 +819,7 @@ photos_application_startup (GApplication *application)
g_error_free (error);
}
- priv->settings = g_settings_new ("org.gnome.desktop.background");
+ priv->settings = g_settings_new (DESKTOP_BACKGROUND_SCHEMA);
priv->resource = photos_get_resource ();
g_resources_register (priv->resource);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]