[gnome-photos/wip/rishi/tracker-sparql-templates: 3/4] query: Turn the global string constants into preprocessor macros
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/tracker-sparql-templates: 3/4] query: Turn the global string constants into preprocessor macros
- Date: Tue, 23 Feb 2021 22:04:22 +0000 (UTC)
commit c067b2f31456dc246f5fbb008196951ecaf96e2f
Author: Sam Thursfield <sam afuera me uk>
Date: Mon Feb 22 19:09:15 2021 +0100
query: Turn the global string constants into preprocessor macros
While preprocessor macros can cause the symbols to be lost inside a
debugger, they will make it easier to build other string constants
using them in the subsequent commit. It's a trade-off.
https://gitlab.gnome.org/GNOME/gnome-photos/-/merge_requests/135
https://gitlab.gnome.org/GNOME/gnome-photos/-/merge_requests/163
src/photos-query.c | 4 ----
src/photos-query.h | 6 +++---
2 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/src/photos-query.c b/src/photos-query.c
index 2422f9c9..f58bc3ac 100644
--- a/src/photos-query.c
+++ b/src/photos-query.c
@@ -48,10 +48,6 @@ enum
G_DEFINE_TYPE (PhotosQuery, photos_query, G_TYPE_OBJECT);
-const gchar *PHOTOS_QUERY_COLLECTIONS_IDENTIFIER = "photos:collection:";
-const gchar *PHOTOS_QUERY_LOCAL_COLLECTIONS_IDENTIFIER = "photos:collection:local:";
-
-
static void
photos_query_constructed (GObject *object)
{
diff --git a/src/photos-query.h b/src/photos-query.h
index 6f12eb18..578661cb 100644
--- a/src/photos-query.h
+++ b/src/photos-query.h
@@ -30,6 +30,9 @@
G_BEGIN_DECLS
+#define PHOTOS_QUERY_COLLECTIONS_IDENTIFIER "photos:collection:"
+#define PHOTOS_QUERY_LOCAL_COLLECTIONS_IDENTIFIER "photos:collection:local:"
+
#define PHOTOS_TYPE_QUERY (photos_query_get_type ())
G_DECLARE_FINAL_TYPE (PhotosQuery, photos_query, PHOTOS, QUERY, GObject);
@@ -73,9 +76,6 @@ typedef enum
PHOTOS_QUERY_FLAGS_UNLIMITED = 1 << 7
} PhotosQueryFlags;
-extern const gchar *PHOTOS_QUERY_COLLECTIONS_IDENTIFIER;
-extern const gchar *PHOTOS_QUERY_LOCAL_COLLECTIONS_IDENTIFIER;
-
PhotosQuery *photos_query_new (PhotosSearchContextState *state, const gchar *sparql);
const gchar *photos_query_get_sparql (PhotosQuery *self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]