[evince] Remove metadata migration code
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] Remove metadata migration code
- Date: Sun, 10 Oct 2010 08:55:46 +0000 (UTC)
commit 8713e9adcd884d32d4d49e675a001bb26c590dcc
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Sun Oct 10 10:51:51 2010 +0200
Remove metadata migration code
shell/Makefile.am | 9 +-
shell/ev-convert-metadata.c | 302 -------------------------------------------
shell/ev-daemon.c | 99 +--------------
3 files changed, 2 insertions(+), 408 deletions(-)
---
diff --git a/shell/Makefile.am b/shell/Makefile.am
index f729c36..7e3cf8c 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -24,9 +24,8 @@ INCLUDES= \
bin_PROGRAMS=evince
-libexec_PROGRAMS=evince-convert-metadata
if ENABLE_DBUS
-libexec_PROGRAMS += evinced
+libexec_PROGRAMS = evinced
endif
evince_SOURCES= \
@@ -120,12 +119,6 @@ endif
BUILT_SOURCES = ev-marshal.h ev-marshal.c
-evince_convert_metadata_SOURCES= \
- ev-convert-metadata.c
-
-evince_convert_metadata_LDADD= \
- $(SHELL_LIBS)
-
if ENABLE_DBUS
evinced_SOURCES= \
ev-daemon.c
diff --git a/shell/ev-daemon.c b/shell/ev-daemon.c
index cc60ab1..fa9d506 100644
--- a/shell/ev-daemon.c
+++ b/shell/ev-daemon.c
@@ -1,4 +1,4 @@
-/* ev-metadata.c
+/* ev-daemon.c
* this file is part of evince, a gnome document viewer
*
* Copyright (C) 2009 Carlos Garcia Campos <carlosgc gnome org>
@@ -115,101 +115,6 @@ ev_daemon_maybe_start_killtimer (gpointer data)
}
static gboolean
-convert_metadata (const gchar *metadata)
-{
- GFile *file;
- char *argv[3];
- gint exit_status;
- GFileAttributeInfoList *namespaces;
- gboolean supported = FALSE;
- GError *error = NULL;
- gboolean retval;
-
- /* If metadata is not supported for a local file
- * is likely because and old gvfs version is running.
- */
- file = g_file_new_for_path (metadata);
- namespaces = g_file_query_writable_namespaces (file, NULL, NULL);
- if (namespaces) {
- gint i;
-
- for (i = 0; i < namespaces->n_infos; i++) {
- if (strcmp (namespaces->infos[i].name, "metadata") == 0) {
- supported = TRUE;
- break;
- }
- }
- g_file_attribute_info_list_unref (namespaces);
- }
- if (!supported) {
- g_warning ("GVFS metadata not supported. "
- "Evince will run without metadata support.\n");
- g_object_unref (file);
- return FALSE;
- }
- g_object_unref (file);
-
- argv[0] = g_build_filename (LIBEXECDIR, "evince-convert-metadata", NULL);
- argv[1] = (char *) metadata;
- argv[2] = NULL;
-
- retval = g_spawn_sync (NULL /* wd */, argv, NULL /* env */,
- 0, NULL, NULL, NULL, NULL,
- &exit_status, &error);
- g_free (argv[0]);
-
- if (!retval) {
- g_printerr ("Error migrating metadata: %s\n", error->message);
- g_error_free (error);
- }
-
- return retval && WIFEXITED (exit_status) && WEXITSTATUS (exit_status) == 0;
-}
-
-static void
-ev_migrate_metadata (void)
-{
- gchar *updated;
- gchar *metadata;
- gchar *dot_dir;
- const gchar *userdir;
-
- userdir = g_getenv ("GNOME22_USER_DIR");
- if (userdir) {
- dot_dir = g_build_filename (userdir, "evince", NULL);
- } else {
- dot_dir = g_build_filename (g_get_home_dir (),
- ".gnome2",
- "evince",
- NULL);
- }
-
- updated = g_build_filename (dot_dir, "migrated-to-gvfs", NULL);
- if (g_file_test (updated, G_FILE_TEST_EXISTS)) {
- /* Already migrated */
- g_free (updated);
- g_free (dot_dir);
- return;
- }
-
- metadata = g_build_filename (dot_dir, "ev-metadata.xml", NULL);
- if (g_file_test (metadata, G_FILE_TEST_EXISTS)) {
- if (convert_metadata (metadata)) {
- gint fd;
-
- fd = g_creat (updated, 0600);
- if (fd != -1) {
- close (fd);
- }
- }
- }
-
- g_free (dot_dir);
- g_free (updated);
- g_free (metadata);
-}
-
-static gboolean
spawn_evince (const gchar *uri)
{
gchar *argv[3];
@@ -495,8 +400,6 @@ name_acquired_cb (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
- ev_migrate_metadata ();
-
ev_daemon_maybe_start_killtimer (user_data);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]