[file-roller] Drop the use of smclient and eggdesktopfile



commit a235afe4a8f849b5e6ab1d4dd0b64a774fea8226
Author: Kalev Lember <kalevlember gmail com>
Date:   Mon Jul 21 17:08:58 2014 +0200

    Drop the use of smclient and eggdesktopfile
    
    https://bugzilla.gnome.org/show_bug.cgi?id=731331

 Makefile.am          |    1 -
 configure.ac         |   40 ---------------
 po/POTFILES.in       |    6 --
 src/Makefile.am      |    2 -
 src/fr-application.c |  137 +------------------------------------------------
 5 files changed, 3 insertions(+), 183 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 7195436..0a21675 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,6 @@ NAUTILUS =
 endif
 
 SUBDIRS =              \
-       copy-n-paste    \
        data            \
        src             \
        help            \
diff --git a/configure.ac b/configure.ac
index c8d7827..b53f5af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -243,45 +243,6 @@ AC_SUBST(LIBARCHIVE_LIBS)
 AC_SUBST(LIBARCHIVE_CFLAGS)
 AM_CONDITIONAL(ENABLE_LIBARCHIVE, test x"$enable_libarchive" = xyes)
 
-dnl ===========================================================================
-dnl
-dnl SM Client
-dnl
-GDK_TARGET="$($PKG_CONFIG --variable target gdk-2.0)"
-
-AC_MSG_CHECKING([which smclient backend to use])
-AC_ARG_WITH([smclient],
-  [AS_HELP_STRING([--with-smclient=no|auto|xsmp],
-                 [Setting smclient backend (default:no)])],,
-                 [with_smclient=no])
-
-if test "$with_smclient" == "auto"; then
-  case "$GDK_TARGET" in
-    x11) with_smclient=xsmp ;;
-    *) with_smclient=no ;;
-  esac
-fi
-
-AC_MSG_RESULT([$with_smclient])
-
-if test "$with_smclient" != "no"; then
-  AC_DEFINE([WITH_SMCLIENT],[1],[Define if smclient is enabled])
-
-  case "$with_smclient" in
-    xsmp) SMCLIENT_PKGS="sm >= 1.0.0 ice" ;;
-    *) SMCLIENT_PKGS="" ;;
-  esac
-
-  PKG_CHECK_MODULES([SMCLIENT],[$SMCLIENT_PKGS])
-  AC_SUBST([SMCLIENT_CFLAGS])
-  AC_SUBST([SMCLIENT_LIBS])
-  AC_DEFINE(USE_SMCLIENT, 1, [Use a session menager])
-fi
-
-AM_CONDITIONAL([WITH_SMCLIENT],[test "$with_smclient" != "no"])
-AM_CONDITIONAL([WITH_SMCLIENT_XSMP],[test "$with_smclient" = "xsmp"])
-AM_CONDITIONAL([WITH_SMCLIENT_WIN32],[test "$with_smclient" = "win32"])
-
 dnl ******************************
 
 IT_PROG_INTLTOOL([0.40.0])
@@ -337,7 +298,6 @@ AC_CONFIG_FILES([Makefile
                 data/icons/32x32/apps/Makefile
                 data/icons/48x48/Makefile
                 data/icons/48x48/apps/Makefile
-                copy-n-paste/Makefile
                 src/Makefile
                 src/commands/Makefile
                 src/sh/Makefile
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 08785fe..95f346b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,12 +1,6 @@
 # DO NOT EDIT.  This file is automatically generated.
 # List of source files which contain translatable strings.
 [encoding: UTF-8]
-copy-n-paste/eggdesktopfile.c
-copy-n-paste/eggdesktopfile.h
-copy-n-paste/eggsmclient.c
-copy-n-paste/eggsmclient.h
-copy-n-paste/eggsmclient-private.h
-copy-n-paste/eggsmclient-xsmp.c
 data/org.gnome.FileRoller.appdata.xml.in
 data/org.gnome.FileRoller.desktop.in.in
 data/org.gnome.FileRoller.gschema.xml.in
diff --git a/src/Makefile.am b/src/Makefile.am
index 4631967..57f5918 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,7 +24,6 @@ applications_dir = $(datadir)/applications
 endif
 
 AM_CPPFLAGS =                                          \
-       -I$(top_srcdir)/copy-n-paste/                   \
        -I$(top_srcdir)                                 \
        -I$(top_builddir)                               \
        -DFR_PREFIX=\"$(prefix)\"                       \
@@ -216,7 +215,6 @@ file_roller_SOURCES =                       \
        main.c
 
 file_roller_LDADD =                                    \
-       $(top_builddir)/copy-n-paste/libeggsmclient.la  \
        $(FR_LIBS)                                      \
        $(JSON_GLIB_LIBS)                               \
        $(LIBNOTIFY_LIBS)                               \
diff --git a/src/fr-application.c b/src/fr-application.c
index e2d4a9c..4dd53c9 100644
--- a/src/fr-application.c
+++ b/src/fr-application.c
@@ -30,10 +30,6 @@
 #ifdef ENABLE_NOTIFICATION
 #  include <libnotify/notify.h>
 #endif
-#ifdef USE_SMCLIENT
-#  include "eggsmclient.h"
-#endif
-#include "eggdesktopfile.h"
 #include "file-utils.h"
 #include "fr-application.h"
 #include "fr-application-menu.h"
@@ -106,105 +102,6 @@ static const GOptionEntry options[] = {
 };
 
 
-/* -- session management -- */
-
-
-#ifdef USE_SMCLIENT
-
-
-static void
-client_save_state (EggSMClient *client,
-                  GKeyFile    *state,
-                  gpointer     user_data)
-{
-       /* discard command is automatically set by EggSMClient */
-
-       GApplication *application;
-       const char   *argv[2] = { NULL };
-       guint         i;
-
-       /* restart command */
-       argv[0] = program_argv0;
-       argv[1] = NULL;
-
-       egg_sm_client_set_restart_command (client, 1, argv);
-
-       /* state */
-       application = g_application_get_default ();
-       if (application != NULL) {
-               GList *window;
-
-               for (window = gtk_application_get_windows (GTK_APPLICATION (application)), i = 0;
-                    window != NULL;
-                    window = window->next, i++)
-               {
-                       FrWindow *session = window->data;
-                       gchar    *key;
-
-                       key = g_strdup_printf ("archive%d", i);
-                       if ((session->archive == NULL) || (fr_archive_get_file (session->archive) == NULL)) {
-                               g_key_file_set_string (state, "Session", key, "");
-                       }
-                       else {
-                               gchar *uri;
-
-                               uri = g_file_get_uri (fr_archive_get_file (session->archive));
-                               g_key_file_set_string (state, "Session", key, uri);
-                               g_free (uri);
-                       }
-                       g_free (key);
-               }
-       }
-
-       g_key_file_set_integer (state, "Session", "archives", i);
-}
-
-
-static void
-client_quit_cb (EggSMClient *client,
-               gpointer     data)
-{
-       gtk_main_quit ();
-}
-
-
-static void
-fr_restore_session (EggSMClient *client)
-{
-       GKeyFile *state = NULL;
-       guint i;
-
-       state = egg_sm_client_get_state_file (client);
-
-       i = g_key_file_get_integer (state, "Session", "archives", NULL);
-
-       for (; i > 0; i--) {
-               GtkWidget *window;
-               char      *key;
-               char      *uri;
-
-               key = g_strdup_printf ("archive%d", i);
-               uri = g_key_file_get_string (state, "Session", key, NULL);
-
-               window = fr_window_new ();
-               if (strlen (uri) > 0) {
-                       GFile *file;
-
-                       file = g_file_new_for_uri (uri);
-                       fr_window_archive_open (FR_WINDOW (window), file, GTK_WINDOW (window));
-
-                       g_object_unref (file);
-               }
-
-               g_free (uri);
-               g_free (key);
-       }
-}
-
-
-#endif /* USE_SMCLIENT */
-
-
 /* -- service -- */
 
 
@@ -583,9 +480,6 @@ fr_application_create_option_context (void)
 
        if (g_once_init_enter (&initialized)) {
                g_option_context_add_group (context, gtk_get_option_group (TRUE));
-#ifdef USE_SMCLIENT
-               g_option_context_add_group (context, egg_sm_client_get_option_group ());
-#endif
                g_once_init_leave (&initialized, TRUE);
        }
 
@@ -641,28 +535,6 @@ fr_application_command_line (GApplication            *application,
        }
        g_option_context_free (context);
 
-       /* restore the session */
-
-#ifdef USE_SMCLIENT
-       {
-               EggSMClient *client;
-
-               client = egg_sm_client_get ();
-               g_signal_connect (client,
-                                 "save_state",
-                                 G_CALLBACK (client_save_state),
-                                 NULL);
-               g_signal_connect (client,
-                                 "quit",
-                                 G_CALLBACK (client_quit_cb),
-                                 NULL);
-               if (egg_sm_client_is_resumed (client)) {
-                       fr_restore_session (client);
-                       return fr_application_command_line_finished (application, EXIT_SUCCESS);
-               }
-       }
-#endif
-
        if (remaining_args == NULL) { /* No archive specified. */
                if (! arg_service)
                        gtk_widget_show (fr_window_new ());
@@ -840,13 +712,10 @@ fr_application_class_init (FrApplicationClass *klass)
 static void
 fr_application_init (FrApplication *self)
 {
-#ifdef GDK_WINDOWING_X11
-       egg_set_desktop_file (APPLICATIONS_DIR "/file-roller.desktop");
-#else
-       /* manually set name and icon */
-       g_set_application_name (_("File Roller"));
+       /* set the name and icon */
+
+       g_set_application_name (_("Archive Manager"));
        gtk_window_set_default_icon_name ("file-roller");
-#endif
 
 #ifdef ENABLE_NOTIFICATION
        if (! notify_init (g_get_application_name ()))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]