Skip to content

Instantly share code, notes, and snippets.

@saboya
Created September 30, 2019 22:50
Show Gist options
  • Save saboya/e89ec8cb1f29f36053b04e924788f5c1 to your computer and use it in GitHub Desktop.
Save saboya/e89ec8cb1f29f36053b04e924788f5c1 to your computer and use it in GitHub Desktop.
temp user patch for gnome-control-center-3.-34
--- gnome-control-center-3.34.0.1/panels/background/bg-pictures-source.c 2019-09-09 12:38:05.000000000 -0300
+++ bg-pictures-source.c 2019-09-30 19:46:05.392382884 -0300
@@ -23,13 +23,17 @@
#include "bg-pictures-source.h"
+#ifdef BUILD_ONLINE_ACCOUNTS
#include "cc-background-grilo-miner.h"
+#endif
#include "cc-background-item.h"
#include <string.h>
#include <cairo-gobject.h>
#include <gio/gio.h>
+#ifdef BUILD_ONLINE_ACCOUNTS
#include <grilo.h>
+#endif
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#include <gdesktop-enums.h>
@@ -42,9 +46,9 @@
BgSource parent_instance;
GCancellable *cancellable;
-
+#ifdef BUILD_ONLINE_ACCOUNTS
CcBackgroundGriloMiner *grl_miner;
-
+#endif
GFileMonitor *picture_dir_monitor;
GFileMonitor *cache_dir_monitor;
@@ -82,9 +86,9 @@
g_cancellable_cancel (source->cancellable);
g_clear_object (&source->cancellable);
}
-
+#ifdef BUILD_ONLINE_ACCOUNTS
g_clear_object (&source->grl_miner);
-
+#endif
G_OBJECT_CLASS (bg_pictures_source_parent_class)->dispose (object);
}
@@ -392,8 +396,11 @@
const gchar *pictures_path;
g_autoptr(GFile) pictures_dir = NULL;
g_autoptr(GFile) cache_dir = NULL;
+#ifdef BUILD_ONLINE_ACCOUNTS
GrlMedia *media;
-
+#else
+ gpointer media = NULL;
+#endif
/* find png and jpeg files */
if (!content_type)
goto out;
@@ -431,8 +438,9 @@
"needs-download", needs_download,
"source-url", source_uri,
NULL);
-
+#ifdef BUILD_ONLINE_ACCOUNTS
media = g_object_get_data (G_OBJECT (file), "grl-media");
+#endif
if (media == NULL)
{
g_object_set_data_full (G_OBJECT (file), "item", g_object_ref (item), g_object_unref);
@@ -496,6 +504,7 @@
return add_single_file (bg_source, file, content_type, mtime);
}
+#ifdef BUILD_ONLINE_ACCOUNTS
static gboolean
add_single_file_from_media (BgPicturesSource *bg_source,
GFile *file,
@@ -520,6 +529,7 @@
return add_single_file (bg_source, file, content_type, (guint64) mtime_unix);
}
+#endif
gboolean
bg_pictures_source_add (BgPicturesSource *bg_source,
@@ -806,6 +816,7 @@
return monitor;
}
+#ifdef BUILD_ONLINE_ACCOUNTS
static void
media_found_cb (BgPicturesSource *self, GrlMedia *media)
{
@@ -817,7 +828,7 @@
g_object_set_data_full (G_OBJECT (file), "grl-media", g_object_ref (media), g_object_unref);
add_single_file_from_media (self, file, media);
}
-
+#endif
static void
bg_pictures_source_init (BgPicturesSource *self)
{
@@ -838,10 +849,11 @@
cache_path = bg_pictures_source_get_cache_path ();
self->cache_dir_monitor = monitor_path (self, cache_path);
-
+#ifdef BUILD_ONLINE_ACCOUNTS
self->grl_miner = cc_background_grilo_miner_new ();
g_signal_connect_swapped (self->grl_miner, "media-found", G_CALLBACK (media_found_cb), self);
cc_background_grilo_miner_start (self->grl_miner);
+#endif
}
BgPicturesSource *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment