From 8f6c06625d98456b3adb41a269f1b71899062c4f Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Sun, 5 Jan 2020 12:27:06 -0500 Subject: [PATCH] test using upstream's gnome-desktop thumbnailer --- libnemo-private/nemo-thumbnails.c | 4 ++-- meson.build | 2 +- src/nemo-application.c | 18 ++++++++-------- src/nemo-bookmark-list.c | 36 +++++++++++++++---------------- src/nemo-main-application.c | 4 ++-- src/nemo-properties-window.c | 2 +- 6 files changed, 33 insertions(+), 33 deletions(-) diff --git a/libnemo-private/nemo-thumbnails.c b/libnemo-private/nemo-thumbnails.c index a5b2ef872..3d66cbddd 100644 --- a/libnemo-private/nemo-thumbnails.c +++ b/libnemo-private/nemo-thumbnails.c @@ -43,7 +43,7 @@ #include #include #include -#include +#include #define DEBUG_FLAG NEMO_DEBUG_THUMBNAILS #include @@ -710,5 +710,5 @@ nemo_create_thumbnail (NemoFile *file, gint throttle_count) gboolean nemo_thumbnail_factory_check_status (void) { - return gnome_desktop_thumbnail_cache_check_permissions (get_thumbnail_factory (), TRUE); + // return gnome_desktop_thumbnail_cache_check_permissions (get_thumbnail_factory (), TRUE); } diff --git a/meson.build b/meson.build index f692a61a6..14da9a6c0 100644 --- a/meson.build +++ b/meson.build @@ -78,7 +78,7 @@ gobject = dependency('gobject-2.0', version: '>=2.0') go_intr = dependency('gobject-introspection-1.0', version: '>=1.0') libnotif= dependency('libnotify', version: '>=0.7.0') -cinnamon= dependency('cinnamon-desktop', version: '>=2.6.1') +cinnamon= dependency('gnome-desktop-3.0', version: '>=3.28.0') gail = dependency('gail-3.0') libxml = dependency('libxml-2.0', version: '>=2.7.8') x11 = dependency('x11') diff --git a/src/nemo-application.c b/src/nemo-application.c index f3d4b6700..64859b740 100644 --- a/src/nemo-application.c +++ b/src/nemo-application.c @@ -78,7 +78,7 @@ #include #define GNOME_DESKTOP_USE_UNSTABLE_API -#include +#include #define NEMO_ACCEL_MAP_SAVE_DELAY 30 @@ -560,13 +560,13 @@ nemo_application_startup (GApplication *app) /* silently do a full check of the cache and fix if running as root. * If running as a normal user, do a quick check, and we'll notify the * user later if there's a problem via an infobar */ - if (geteuid () == 0) { - if (!gnome_desktop_thumbnail_cache_check_permissions (NULL, FALSE)) - gnome_desktop_thumbnail_cache_fix_permissions (); - } else { - if (!gnome_desktop_thumbnail_cache_check_permissions (NULL, TRUE)) - self->priv->cache_problem = TRUE; - } + // if (geteuid () == 0) { + // if (!gnome_desktop_thumbnail_cache_check_permissions (NULL, FALSE)) + // gnome_desktop_thumbnail_cache_fix_permissions (); + // } else { + // if (!gnome_desktop_thumbnail_cache_check_permissions (NULL, TRUE)) + // self->priv->cache_problem = TRUE; + // } } static void @@ -642,7 +642,7 @@ nemo_application_get_singleton (void) void nemo_application_check_thumbnail_cache (NemoApplication *application) { - application->priv->cache_problem = !nemo_thumbnail_factory_check_status (); + application->priv->cache_problem = FALSE; //!nemo_thumbnail_factory_check_status (); } gboolean diff --git a/src/nemo-bookmark-list.c b/src/nemo-bookmark-list.c index d541ba148..d2055abeb 100644 --- a/src/nemo-bookmark-list.c +++ b/src/nemo-bookmark-list.c @@ -31,8 +31,8 @@ #include #include #include -#define GNOME_DESKTOP_USE_UNSTABLE_API -#include +// #define GNOME_DESKTOP_USE_UNSTABLE_API +// #include #include #include @@ -61,24 +61,24 @@ static void nemo_bookmark_list_save_file (NemoBookmarkList *bookmarks G_DEFINE_TYPE(NemoBookmarkList, nemo_bookmark_list, G_TYPE_OBJECT); -static void -ensure_proper_file_permissions (GFile *file) -{ - if (geteuid () == 0) { - struct passwd *pwent; - pwent = gnome_desktop_get_session_user_pwent (); +// static void +// ensure_proper_file_permissions (GFile *file) +// { +// if (geteuid () == 0) { +// struct passwd *pwent; +// pwent = gnome_desktop_get_session_user_pwent (); - gchar *path = g_file_get_path (file); +// gchar *path = g_file_get_path (file); - if (g_strcmp0 (pwent->pw_dir, g_get_home_dir ()) == 0) { - G_GNUC_UNUSED int res; +// if (g_strcmp0 (pwent->pw_dir, g_get_home_dir ()) == 0) { +// G_GNUC_UNUSED int res; - res = chown (path, pwent->pw_uid, pwent->pw_gid); - } +// res = chown (path, pwent->pw_uid, pwent->pw_gid); +// } - g_free (path); - } -} +// g_free (path); +// } +// } static NemoBookmark * new_bookmark_from_uri (const char *uri, const char *label, NemoBookmarkMetadata *md) @@ -869,7 +869,7 @@ save_bookmark_metadata_file (NemoBookmarkList *list) if (g_key_file_save_to_file (kfile, filename, &error)) { - ensure_proper_file_permissions (file); + // ensure_proper_file_permissions (file); } else { g_warning ("Could not save bookmark metadata file: %s\n", error->message); g_error_free (error); @@ -962,7 +962,7 @@ save_files_thread (GTask *task, NULL, NULL, &error)) { - ensure_proper_file_permissions (file); + // ensure_proper_file_permissions (file); g_task_return_boolean (task, TRUE); } else { g_task_return_error (task, error); diff --git a/src/nemo-main-application.c b/src/nemo-main-application.c index 155faad75..848e82e1c 100644 --- a/src/nemo-main-application.c +++ b/src/nemo-main-application.c @@ -74,7 +74,7 @@ #define GNOME_DESKTOP_USE_UNSTABLE_API -#include +#include /* Keep window from shrinking down ridiculously small; numbers are somewhat arbitrary */ #define APPLICATION_WINDOW_MIN_WIDTH 300 @@ -654,7 +654,7 @@ nemo_main_application_local_command_line (GApplication *application, if (geteuid () != 0) { g_printerr ("The --fix-cache option must be run with sudo or as the root user.\n"); } else { - gnome_desktop_thumbnail_cache_fix_permissions (); + // gnome_desktop_thumbnail_cache_fix_permissions (); g_print ("User thumbnail cache successfully repaired.\n"); } diff --git a/src/nemo-properties-window.c b/src/nemo-properties-window.c index eeab2a232..3d088481b 100644 --- a/src/nemo-properties-window.c +++ b/src/nemo-properties-window.c @@ -39,7 +39,7 @@ #include #define GNOME_DESKTOP_USE_UNSTABLE_API -#include +#include #include #include