[gnome-pocket] Namespace "Pocket/POCKET" constants properly
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-pocket] Namespace "Pocket/POCKET" constants properly
- Date: Sat, 20 Sep 2014 18:01:27 +0000 (UTC)
commit cee2aa0265577b247b9ba074695aabff6b9c3d1b
Author: Bastien Nocera <hadess hadess net>
Date: Sat Sep 20 19:04:27 2014 +0200
Namespace "Pocket/POCKET" constants properly
gnome-pocket/gnome-pocket-item.c | 36 ++++++++++++++++++------------------
gnome-pocket/gnome-pocket-item.h | 24 ++++++++++++------------
gnome-pocket/gnome-pocket.c | 14 +++++++-------
3 files changed, 37 insertions(+), 37 deletions(-)
---
diff --git a/gnome-pocket/gnome-pocket-item.c b/gnome-pocket/gnome-pocket-item.c
index a96995a..efc8466 100644
--- a/gnome-pocket/gnome-pocket-item.c
+++ b/gnome-pocket/gnome-pocket-item.c
@@ -34,17 +34,17 @@
#include "gnome-pocket-item.h"
struct _GnomePocketItemPrivate {
- char *id;
- char *url;
- char *title;
- char *thumbnail_url;
- gboolean favorite;
- PocketItemStatus status;
- gboolean is_article;
- PocketMediaInclusion has_image;
- PocketMediaInclusion has_video;
- gint64 time_added;
- char **tags;
+ char *id;
+ char *url;
+ char *title;
+ char *thumbnail_url;
+ gboolean favorite;
+ GnomePocketItemStatus status;
+ gboolean is_article;
+ GnomePocketMediaInclusion has_image;
+ GnomePocketMediaInclusion has_video;
+ gint64 time_added;
+ char **tags;
};
G_DEFINE_TYPE(GnomePocketItem, gnome_pocket_item, GOM_TYPE_RESOURCE)
@@ -84,14 +84,14 @@ bool_to_str (gboolean b)
}
static const char *
-inclusion_to_str (PocketMediaInclusion inc)
+inclusion_to_str (GnomePocketMediaInclusion inc)
{
switch (inc) {
- case POCKET_HAS_MEDIA_FALSE:
+ case GNOME_POCKET_HAS_MEDIA_FALSE:
return "False";
- case POCKET_HAS_MEDIA_INCLUDED:
+ case GNOME_POCKET_HAS_MEDIA_INCLUDED:
return "Included";
- case POCKET_IS_MEDIA:
+ case GNOME_POCKET_IS_MEDIA:
return "Is media";
default:
g_assert_not_reached ();
@@ -257,7 +257,7 @@ gnome_pocket_item_class_init (GnomePocketItemClass *klass)
g_param_spec_uint ("status",
"Status",
NULL,
- POCKET_STATUS_NORMAL, POCKET_STATUS_DELETED,
POCKET_STATUS_NORMAL,
+ GNOME_POCKET_STATUS_NORMAL,
GNOME_POCKET_STATUS_DELETED, GNOME_POCKET_STATUS_NORMAL,
G_PARAM_READWRITE));
BOOL_PROP ("is-article", PROP_IS_ARTICLE);
@@ -268,7 +268,7 @@ gnome_pocket_item_class_init (GnomePocketItemClass *klass)
g_param_spec_uint ("has-image",
"Has image",
NULL,
- POCKET_HAS_MEDIA_FALSE, POCKET_IS_MEDIA,
POCKET_HAS_MEDIA_FALSE,
+ GNOME_POCKET_HAS_MEDIA_FALSE, GNOME_POCKET_IS_MEDIA,
GNOME_POCKET_HAS_MEDIA_FALSE,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
@@ -276,7 +276,7 @@ gnome_pocket_item_class_init (GnomePocketItemClass *klass)
g_param_spec_uint ("has-video",
"Has video",
NULL,
- POCKET_HAS_MEDIA_FALSE, POCKET_IS_MEDIA,
POCKET_HAS_MEDIA_FALSE,
+ GNOME_POCKET_HAS_MEDIA_FALSE, GNOME_POCKET_IS_MEDIA,
GNOME_POCKET_HAS_MEDIA_FALSE,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
diff --git a/gnome-pocket/gnome-pocket-item.h b/gnome-pocket/gnome-pocket-item.h
index e248c44..5996d11 100644
--- a/gnome-pocket/gnome-pocket-item.h
+++ b/gnome-pocket/gnome-pocket-item.h
@@ -25,23 +25,23 @@
G_BEGIN_DECLS
-#define POCKET_FAVORITE TRUE
-#define POCKET_NOT_FAVORITE FALSE
+#define GNOME_POCKET_FAVORITE TRUE
+#define GNOME_POCKET_NOT_FAVORITE FALSE
typedef enum {
- POCKET_STATUS_NORMAL = 0,
- POCKET_STATUS_ARCHIVED = 1,
- POCKET_STATUS_DELETED = 2
-} PocketItemStatus;
+ GNOME_POCKET_STATUS_NORMAL = 0,
+ GNOME_POCKET_STATUS_ARCHIVED = 1,
+ GNOME_POCKET_STATUS_DELETED = 2
+} GnomePocketItemStatus;
-#define POCKET_IS_ARTICLE TRUE
-#define POCKET_IS_NOT_ARTICLE FALSE
+#define GNOME_POCKET_IS_ARTICLE TRUE
+#define GNOME_POCKET_IS_NOT_ARTICLE FALSE
typedef enum {
- POCKET_HAS_MEDIA_FALSE = 0,
- POCKET_HAS_MEDIA_INCLUDED = 1,
- POCKET_IS_MEDIA = 2
-} PocketMediaInclusion;
+ GNOME_POCKET_HAS_MEDIA_FALSE = 0,
+ GNOME_POCKET_HAS_MEDIA_INCLUDED = 1,
+ GNOME_POCKET_IS_MEDIA = 2
+} GnomePocketMediaInclusion;
typedef struct _GnomePocketItemPrivate GnomePocketItemPrivate;
diff --git a/gnome-pocket/gnome-pocket.c b/gnome-pocket/gnome-pocket.c
index bbcd376..f27c30c 100644
--- a/gnome-pocket/gnome-pocket.c
+++ b/gnome-pocket/gnome-pocket.c
@@ -132,9 +132,9 @@ parse_item (JsonReader *reader,
{
GObject *item;
char *str;
- PocketItemStatus status;
+ GnomePocketItemStatus status;
gboolean favorite, is_article;
- PocketMediaInclusion has_image, has_video;
+ GnomePocketMediaInclusion has_image, has_video;
gint64 time_added;
char **tags;
@@ -152,7 +152,7 @@ parse_item (JsonReader *reader,
* anything more here */
status = get_int_for_element (reader, "status");
g_object_set (item, "status", status, NULL);
- if (status != POCKET_STATUS_NORMAL)
+ if (status != GNOME_POCKET_STATUS_NORMAL)
goto end;
str = get_string_for_element (reader, "resolved_url");
@@ -175,10 +175,10 @@ parse_item (JsonReader *reader,
is_article = FALSE;
has_image = get_int_for_element (reader, "has_image");
if (has_image == -1)
- has_image = POCKET_HAS_MEDIA_FALSE;
+ has_image = GNOME_POCKET_HAS_MEDIA_FALSE;
has_video = get_int_for_element (reader, "has_video");
if (has_video == -1)
- has_video = POCKET_HAS_MEDIA_FALSE;
+ has_video = GNOME_POCKET_HAS_MEDIA_FALSE;
g_object_set (item,
"favorite", favorite,
"is-article", is_article,
@@ -230,14 +230,14 @@ update_list (GnomePocket *self,
added = NULL;
for (l = updated_items; l != NULL; l = l->next) {
GnomePocketItem *item = l->data;
- PocketItemStatus status;
+ GnomePocketItemStatus status;
char *id;
g_object_get (G_OBJECT (item),
"status", &status,
"id", &id, NULL);
- if (status != POCKET_STATUS_NORMAL) {
+ if (status != GNOME_POCKET_STATUS_NORMAL) {
g_hash_table_insert (removed,
id,
GINT_TO_POINTER (1));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]