From 6404fa33afc5b4961fea47f8eefd07f5b4ff913a Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Sun, 23 Oct 2016 20:24:17 -0400 Subject: libunique builds: enable eject notifications We no longer need to use any GtkApplication features for this so enable it in libunique builds too. Tested with and without libunique in GTK 3.22 --- src/caja-application.c | 7 +++++-- src/caja-places-sidebar.c | 22 ++++------------------ 2 files changed, 9 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/caja-application.c b/src/caja-application.c index dff984f3..9bd3ef74 100644 --- a/src/caja-application.c +++ b/src/caja-application.c @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include @@ -90,7 +91,6 @@ #include #include #include -#include #else enum { COMMAND_0, /* unused: 0 is an invalid command */ @@ -1459,6 +1459,9 @@ caja_application_startup (CajaApplication *application, /* Load session info if availible */ caja_application_load_session (application); + /* Initialize notifications for eject operations */ + notify_init (GETTEXT_PACKAGE); + /* load accelerator map, and register save callback */ accel_map_filename = caja_get_accel_map_file (); if (accel_map_filename) @@ -3207,7 +3210,7 @@ caja_application_startup (GApplication *app) /* attach menu-provider module callback */ menu_provider_init_callback (); - /* Initialize the UI handler singleton for file operations */ + /* Initialize notifications for eject operations */ notify_init (GETTEXT_PACKAGE); /* Watch for unmounts so we can close open windows */ diff --git a/src/caja-places-sidebar.c b/src/caja-places-sidebar.c index 9b67e64d..b406032e 100644 --- a/src/caja-places-sidebar.c +++ b/src/caja-places-sidebar.c @@ -38,9 +38,6 @@ #include #include #include -#if ENABLE_LIBUNIQUE == (FALSE) -#include -#endif #include #include #include @@ -56,13 +53,11 @@ #include #include #include +#include #include "caja-bookmark-list.h" #include "caja-places-sidebar.h" #include "caja-window.h" -#if ENABLE_LIBUNIQUE == (FALSE) -#include -#endif #define EJECT_BUTTON_XPAD 6 #define ICON_CELL_XPAD 6 @@ -2246,12 +2241,9 @@ drive_eject_cb (GObject *source_object, } g_error_free (error); } -#if ENABLE_LIBUNIQUE == (FALSE) else { - CajaApplication *app = CAJA_APPLICATION (g_application_get_default ()); caja_application_notify_unmount_show ("It is now safe to remove the drive"); } -#endif } static void @@ -2283,12 +2275,10 @@ volume_eject_cb (GObject *source_object, } g_error_free (error); } -#if ENABLE_LIBUNIQUE == (FALSE) + else { - CajaApplication *app = CAJA_APPLICATION (g_application_get_default ()); caja_application_notify_unmount_show ("It is now safe to remove the drive"); } -#endif } static void @@ -2320,12 +2310,10 @@ mount_eject_cb (GObject *source_object, } g_error_free (error); } -#if ENABLE_LIBUNIQUE == (FALSE) + else { - CajaApplication *app = CAJA_APPLICATION (g_application_get_default ()); caja_application_notify_unmount_show ("It is now safe to remove the drive"); } -#endif } static void @@ -2357,10 +2345,8 @@ do_eject (GMount *mount, g_drive_eject_with_operation (drive, 0, mount_op, NULL, drive_eject_cb, g_object_ref (sidebar->window)); } -#if ENABLE_LIBUNIQUE == (FALSE) - CajaApplication *app = CAJA_APPLICATION (g_application_get_default ()); + caja_application_notify_unmount_show ("writing data to the drive-do not unplug"); -#endif g_object_unref (mount_op); } -- cgit v1.2.1