diff options
20 files changed, 46 insertions, 42 deletions
diff --git a/plugins/cover-thumbnailer/cover-thumbnailer-plugin.c b/plugins/cover-thumbnailer/cover-thumbnailer-plugin.c index 6bf82b4..540899e 100644 --- a/plugins/cover-thumbnailer/cover-thumbnailer-plugin.c +++ b/plugins/cover-thumbnailer/cover-thumbnailer-plugin.c @@ -56,7 +56,7 @@ tumbler_plugin_initialize (TumblerProviderPlugin *plugin) TUMBLER_MICRO_VERSION); if (G_UNLIKELY (mismatch != NULL)) { - g_warning (_("Version mismatch: %s"), mismatch); + g_warning (TUMBLER_WARNING_VERSION_MISMATCH, mismatch); return; } diff --git a/plugins/desktop-thumbnailer/desktop-thumbnailer-plugin.c b/plugins/desktop-thumbnailer/desktop-thumbnailer-plugin.c index d79024b..f862654 100644 --- a/plugins/desktop-thumbnailer/desktop-thumbnailer-plugin.c +++ b/plugins/desktop-thumbnailer/desktop-thumbnailer-plugin.c @@ -53,7 +53,7 @@ tumbler_plugin_initialize (TumblerProviderPlugin *plugin) TUMBLER_MICRO_VERSION); if (G_UNLIKELY (mismatch != NULL)) { - g_warning (_("Version mismatch: %s"), mismatch); + g_warning (TUMBLER_WARNING_VERSION_MISMATCH, mismatch); return; } diff --git a/plugins/desktop-thumbnailer/desktop-thumbnailer-provider.c b/plugins/desktop-thumbnailer/desktop-thumbnailer-provider.c index 7c10698..e76e405 100644 --- a/plugins/desktop-thumbnailer/desktop-thumbnailer-provider.c +++ b/plugins/desktop-thumbnailer/desktop-thumbnailer-provider.c @@ -116,7 +116,7 @@ desktop_thumbnailer_get_from_desktop_file (GFile *file, /* try to load the key file data from the input file */ if (!g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, &error)) { - g_warning (_("Failed to load the file \"%s\": %s"), filename, error->message); + g_warning (TUMBLER_WARNING_LOAD_FILE_FAILED, filename, error->message); g_clear_error (&error); g_key_file_free (key_file); @@ -130,7 +130,7 @@ desktop_thumbnailer_get_from_desktop_file (GFile *file, "Exec", &error); if (exec == NULL) { - g_warning (_("Malformed file \"%s\": %s"), filename, error->message); + g_warning (TUMBLER_WARNING_MALFORMED_FILE, filename, error->message); g_clear_error (&error); g_key_file_free (key_file); @@ -144,7 +144,7 @@ desktop_thumbnailer_get_from_desktop_file (GFile *file, "MimeType", NULL, &error); if (mime_types == NULL) { - g_warning (_("Malformed file \"%s\": %s"), filename, error->message); + g_warning (TUMBLER_WARNING_MALFORMED_FILE, filename, error->message); g_clear_error (&error); g_free (exec); diff --git a/plugins/desktop-thumbnailer/desktop-thumbnailer.c b/plugins/desktop-thumbnailer/desktop-thumbnailer.c index 5248a49..916d5bc 100644 --- a/plugins/desktop-thumbnailer/desktop-thumbnailer.c +++ b/plugins/desktop-thumbnailer/desktop-thumbnailer.c @@ -362,7 +362,7 @@ desktop_thumbnailer_load_thumbnail (DesktopThumbnailer *thumbnailer, g_strfreev (cmd_argv); } else - g_warning (_("Malformed command line \"%s\": %s"), exec, (*error)->message); + g_warning ("Malformed command line \"%s\": %s", exec, (*error)->message); g_free (tmpfilepath); g_object_unref (tmpfile); diff --git a/plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer-plugin.c b/plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer-plugin.c index 3f393a7..abff227 100644 --- a/plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer-plugin.c +++ b/plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer-plugin.c @@ -55,7 +55,7 @@ tumbler_plugin_initialize (TumblerProviderPlugin *plugin) TUMBLER_MICRO_VERSION); if (G_UNLIKELY (mismatch != NULL)) { - g_warning (_("Version mismatch: %s"), mismatch); + g_warning (TUMBLER_WARNING_VERSION_MISMATCH, mismatch); return; } diff --git a/plugins/font-thumbnailer/font-thumbnailer-plugin.c b/plugins/font-thumbnailer/font-thumbnailer-plugin.c index 340885c..cc09a40 100644 --- a/plugins/font-thumbnailer/font-thumbnailer-plugin.c +++ b/plugins/font-thumbnailer/font-thumbnailer-plugin.c @@ -54,7 +54,7 @@ tumbler_plugin_initialize (TumblerProviderPlugin *plugin) TUMBLER_MICRO_VERSION); if (G_UNLIKELY (mismatch != NULL)) { - g_warning (_("Version mismatch: %s"), mismatch); + g_warning (TUMBLER_WARNING_VERSION_MISMATCH, mismatch); return; } diff --git a/plugins/gepub-thumbnailer/gepub-thumbnailer-plugin.c b/plugins/gepub-thumbnailer/gepub-thumbnailer-plugin.c index 8f17a46..4441f38 100644 --- a/plugins/gepub-thumbnailer/gepub-thumbnailer-plugin.c +++ b/plugins/gepub-thumbnailer/gepub-thumbnailer-plugin.c @@ -56,7 +56,7 @@ tumbler_plugin_initialize (TumblerProviderPlugin *plugin) TUMBLER_MICRO_VERSION); if (G_UNLIKELY (mismatch != NULL)) { - g_warning (_("Version mismatch: %s"), mismatch); + g_warning (TUMBLER_WARNING_VERSION_MISMATCH, mismatch); return; } diff --git a/plugins/gst-thumbnailer/gst-thumbnailer-plugin.c b/plugins/gst-thumbnailer/gst-thumbnailer-plugin.c index 1f86ee9..3b513b0 100644 --- a/plugins/gst-thumbnailer/gst-thumbnailer-plugin.c +++ b/plugins/gst-thumbnailer/gst-thumbnailer-plugin.c @@ -56,7 +56,7 @@ tumbler_plugin_initialize (TumblerProviderPlugin *plugin) TUMBLER_MICRO_VERSION); if (G_UNLIKELY (mismatch != NULL)) { - g_warning (_("Version mismatch: %s"), mismatch); + g_warning (TUMBLER_WARNING_VERSION_MISMATCH, mismatch); return; } diff --git a/plugins/jpeg-thumbnailer/jpeg-thumbnailer-plugin.c b/plugins/jpeg-thumbnailer/jpeg-thumbnailer-plugin.c index 036ebd1..7f45577 100644 --- a/plugins/jpeg-thumbnailer/jpeg-thumbnailer-plugin.c +++ b/plugins/jpeg-thumbnailer/jpeg-thumbnailer-plugin.c @@ -54,7 +54,7 @@ tumbler_plugin_initialize (TumblerProviderPlugin *plugin) TUMBLER_MICRO_VERSION); if (G_UNLIKELY (mismatch != NULL)) { - g_warning (_("Version mismatch: %s"), mismatch); + g_warning (TUMBLER_WARNING_VERSION_MISMATCH, mismatch); return; } diff --git a/plugins/odf-thumbnailer/odf-thumbnailer-plugin.c b/plugins/odf-thumbnailer/odf-thumbnailer-plugin.c index b9df7e7..8330945 100644 --- a/plugins/odf-thumbnailer/odf-thumbnailer-plugin.c +++ b/plugins/odf-thumbnailer/odf-thumbnailer-plugin.c @@ -56,7 +56,7 @@ tumbler_plugin_initialize (TumblerProviderPlugin *plugin) TUMBLER_MICRO_VERSION); if (G_UNLIKELY (mismatch != NULL)) { - g_warning (_("Version mismatch: %s"), mismatch); + g_warning (TUMBLER_WARNING_VERSION_MISMATCH, mismatch); return; } diff --git a/plugins/pixbuf-thumbnailer/pixbuf-thumbnailer-plugin.c b/plugins/pixbuf-thumbnailer/pixbuf-thumbnailer-plugin.c index 2c5e243..167b4db 100644 --- a/plugins/pixbuf-thumbnailer/pixbuf-thumbnailer-plugin.c +++ b/plugins/pixbuf-thumbnailer/pixbuf-thumbnailer-plugin.c @@ -54,7 +54,7 @@ tumbler_plugin_initialize (TumblerProviderPlugin *plugin) TUMBLER_MICRO_VERSION); if (G_UNLIKELY (mismatch != NULL)) { - g_warning (_("Version mismatch: %s"), mismatch); + g_warning (TUMBLER_WARNING_VERSION_MISMATCH, mismatch); return; } diff --git a/plugins/poppler-thumbnailer/poppler-thumbnailer-plugin.c b/plugins/poppler-thumbnailer/poppler-thumbnailer-plugin.c index b60ed0b..3f351e0 100644 --- a/plugins/poppler-thumbnailer/poppler-thumbnailer-plugin.c +++ b/plugins/poppler-thumbnailer/poppler-thumbnailer-plugin.c @@ -54,7 +54,7 @@ tumbler_plugin_initialize (TumblerProviderPlugin *plugin) TUMBLER_MICRO_VERSION); if (G_UNLIKELY (mismatch != NULL)) { - g_warning (_("Version mismatch: %s"), mismatch); + g_warning (TUMBLER_WARNING_VERSION_MISMATCH, mismatch); return; } diff --git a/plugins/raw-thumbnailer/raw-thumbnailer-plugin.c b/plugins/raw-thumbnailer/raw-thumbnailer-plugin.c index ec49bed..5c653bd 100644 --- a/plugins/raw-thumbnailer/raw-thumbnailer-plugin.c +++ b/plugins/raw-thumbnailer/raw-thumbnailer-plugin.c @@ -54,7 +54,7 @@ tumbler_plugin_initialize (TumblerProviderPlugin *plugin) TUMBLER_MICRO_VERSION); if (G_UNLIKELY (mismatch != NULL)) { - g_warning (_("Version mismatch: %s"), mismatch); + g_warning (TUMBLER_WARNING_VERSION_MISMATCH, mismatch); return; } diff --git a/plugins/xdg-cache/xdg-cache-plugin.c b/plugins/xdg-cache/xdg-cache-plugin.c index fbbc578..ff2de1d 100644 --- a/plugins/xdg-cache/xdg-cache-plugin.c +++ b/plugins/xdg-cache/xdg-cache-plugin.c @@ -49,7 +49,7 @@ tumbler_plugin_initialize (TumblerCachePlugin *plugin) TUMBLER_MICRO_VERSION); if (G_UNLIKELY (mismatch != NULL)) { - g_warning (_("Version mismatch: %s"), mismatch); + g_warning (TUMBLER_WARNING_VERSION_MISMATCH, mismatch); return; } diff --git a/tumbler/tumbler-cache-plugin.c b/tumbler/tumbler-cache-plugin.c index 6a010e6..76989e9 100644 --- a/tumbler/tumbler-cache-plugin.c +++ b/tumbler/tumbler-cache-plugin.c @@ -29,6 +29,7 @@ #include <tumbler/tumbler-cache.h> #include <tumbler/tumbler-cache-plugin.h> +#include <tumbler/tumbler-error.h> @@ -142,7 +143,7 @@ tumbler_cache_plugin_load (GTypeModule *type_module) } else { - g_warning (_("Cache plugin \"%s\" lacks required symbols"), type_module->name); + g_warning (TUMBLER_WARNING_PLUGIN_LACKS_SYMBOLS, type_module->name); g_module_close (plugin->library); plugin->library = NULL; return FALSE; @@ -150,8 +151,7 @@ tumbler_cache_plugin_load (GTypeModule *type_module) } else { - g_warning (_("Failed to load the cache plugin \"%s\": %s"), type_module->name, - g_module_error ()); + g_warning (TUMBLER_WARNING_LOAD_PLUGIN_FAILED, type_module->name, g_module_error ()); return FALSE; } } diff --git a/tumbler/tumbler-error.h b/tumbler/tumbler-error.h index d988ad4..036a7b8 100644 --- a/tumbler/tumbler-error.h +++ b/tumbler/tumbler-error.h @@ -45,6 +45,13 @@ G_BEGIN_DECLS #define TUMBLER_ERROR_MESSAGE_NO_THUMB_OF_THUMB _("The file \"%s\" is a thumbnail itself") #define TUMBLER_ERROR_MESSAGE_NO_THUMBNAILER _("No thumbnailer available for \"%s\"") #define TUMBLER_ERROR_MESSAGE_SHUT_DOWN _("The thumbnailer service is shutting down") +#define TUMBLER_ERROR_MESSAGE_UNSUPPORTED_FLAVOR _("Unsupported thumbnail flavor requested") + +#define TUMBLER_WARNING_VERSION_MISMATCH "Version mismatch: %s" +#define TUMBLER_WARNING_MALFORMED_FILE "Malformed file \"%s\": %s" +#define TUMBLER_WARNING_LOAD_FILE_FAILED "Failed to load the file \"%s\": %s" +#define TUMBLER_WARNING_LOAD_PLUGIN_FAILED "Failed to load plugin \"%s\": %s" +#define TUMBLER_WARNING_PLUGIN_LACKS_SYMBOLS "Plugin \"%s\" lacks required symbols" typedef enum /*< enum >*/ { diff --git a/tumbler/tumbler-provider-plugin.c b/tumbler/tumbler-provider-plugin.c index 5decad0..6b2cca2 100644 --- a/tumbler/tumbler-provider-plugin.c +++ b/tumbler/tumbler-provider-plugin.c @@ -28,6 +28,7 @@ #include <gmodule.h> #include "tumbler/tumbler-provider-plugin.h" +#include <tumbler/tumbler-error.h> @@ -132,7 +133,7 @@ tumbler_provider_plugin_load (GTypeModule *type_module) } else { - g_warning (_("Plugin \"%s\" lacks required symbols."), type_module->name); + g_warning (TUMBLER_WARNING_PLUGIN_LACKS_SYMBOLS, type_module->name); g_module_close (plugin->library); plugin->library = NULL; return FALSE; @@ -140,8 +141,7 @@ tumbler_provider_plugin_load (GTypeModule *type_module) } else { - g_warning (_("Failed to load plugin \"%s\": %s"), type_module->name, - g_module_error ()); + g_warning (TUMBLER_WARNING_LOAD_PLUGIN_FAILED, type_module->name, g_module_error ()); return FALSE; } } diff --git a/tumblerd/main.c b/tumblerd/main.c index 9c3be3f..eaf6658 100644 --- a/tumblerd/main.c +++ b/tumblerd/main.c @@ -90,7 +90,7 @@ on_dbus_name_lost (GDBusConnection *connection, { GMainLoop *main_loop; - g_critical (_("Name %s lost on the message dbus, exiting."),name); + g_critical ("Name %s lost on the message dbus, exiting.",name); main_loop = (GMainLoop*)user_data; g_main_loop_quit(main_loop); } @@ -126,7 +126,7 @@ main (int argc, #ifdef G_OS_UNIX if (nice (19) != 19) - g_warning (_("Couldn't change nice value of process.")); + g_warning ("Couldn't change nice value of process."); #endif #ifdef DEBUG @@ -135,7 +135,7 @@ main (int argc, #endif /* set the application name. Translators: Don't translate "Tumbler". */ - g_set_application_name (_("Tumbler Thumbnailing Service")); + g_set_application_name ("Tumbler Thumbnailing Service"); connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); @@ -228,7 +228,7 @@ main (int argc, /* try to load specialized thumbnailers and exit if that fails */ if (!tumbler_registry_load (registry, &error)) { - g_warning (_("Failed to load specialized thumbnailers into the registry: %s"), + g_warning ("Failed to load specialized thumbnailers into the registry: %s", error->message); g_error_free (error); diff --git a/tumblerd/tumbler-manager.c b/tumblerd/tumbler-manager.c index a7d7982..54e8c3e 100644 --- a/tumblerd/tumbler-manager.c +++ b/tumblerd/tumbler-manager.c @@ -43,6 +43,7 @@ #include <tumblerd/tumbler-specialized-thumbnailer.h> #include <tumblerd/tumbler-utils.h> +#define WARNING_MALFORMED_SECTION "Malformed section \"%s\" in file \"%s\": %s" /* Property identifiers */ enum @@ -544,7 +545,7 @@ tumbler_manager_parse_overrides (TumblerManager *manager, /* try to load the key file from the overrides file */ if (!g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, &error)) { - g_warning (_("Failed to load the file \"%s\": %s"), filename, error->message); + g_warning (TUMBLER_WARNING_LOAD_FILE_FAILED, filename, error->message); g_clear_error (&error); g_key_file_free (key_file); g_free (filename); @@ -562,8 +563,7 @@ tumbler_manager_parse_overrides (TumblerManager *manager, info->name = g_key_file_get_string (key_file, sections[n], "Name", &error); if (info->name == NULL) { - g_warning (_("Malformed section \"%s\" in file \"%s\": %s"), - sections[n], filename, error->message); + g_warning (WARNING_MALFORMED_SECTION, sections[n], filename, error->message); g_clear_error (&error); override_info_free (info); @@ -576,8 +576,7 @@ tumbler_manager_parse_overrides (TumblerManager *manager, "UriScheme", &error); if (info->uri_scheme == NULL) { - g_warning (_("Malformed section \"%s\" in file \"%s\": %s"), - sections[n], filename, error->message); + g_warning (WARNING_MALFORMED_SECTION, sections[n], filename, error->message); g_clear_error (&error); override_info_free (info); @@ -590,8 +589,7 @@ tumbler_manager_parse_overrides (TumblerManager *manager, "MimeType", &error); if (info->mime_type == NULL) { - g_warning (_("Malformed section \"%s\" in file \"%s\": %s"), - sections[n], filename, error->message); + g_warning (WARNING_MALFORMED_SECTION, sections[n], filename, error->message); g_clear_error (&error); override_info_free (info); @@ -603,9 +601,8 @@ tumbler_manager_parse_overrides (TumblerManager *manager, uri_type = g_strdup_printf ("%s-%s", info->uri_scheme, info->mime_type); if (g_strcmp0 (sections[n], uri_type) != 0) { - g_warning (_("Malformed section \"%s\" in file \"%s\": " - "Mismatch between section name and UriScheme/MimeType"), - sections[n], filename); + g_warning (WARNING_MALFORMED_SECTION, sections[n], filename, + "Mismatch between section name and UriScheme/MimeType"); g_free (uri_type); override_info_free (info); @@ -950,7 +947,7 @@ tumbler_manager_load_thumbnailer (TumblerManager *manager, /* try to load the key file data from the input file */ if (!g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, &error)) { - g_warning (_("Failed to load the file \"%s\": %s"), filename, error->message); + g_warning (TUMBLER_WARNING_LOAD_FILE_FAILED, filename, error->message); g_clear_error (&error); g_key_file_free (key_file); @@ -963,7 +960,7 @@ tumbler_manager_load_thumbnailer (TumblerManager *manager, name = g_key_file_get_string (key_file, "Specialized Thumbnailer", "Name", &error); if (name == NULL) { - g_warning (_("Malformed file \"%s\": %s"), filename, error->message); + g_warning (TUMBLER_WARNING_MALFORMED_FILE, filename, error->message); g_clear_error (&error); g_key_file_free (key_file); @@ -977,7 +974,7 @@ tumbler_manager_load_thumbnailer (TumblerManager *manager, "ObjectPath", &error); if (object_path == NULL) { - g_warning (_("Malformed file \"%s\": %s"), filename, error->message); + g_warning (TUMBLER_WARNING_MALFORMED_FILE, filename, error->message); g_clear_error (&error); g_key_file_free (key_file); @@ -991,7 +988,7 @@ tumbler_manager_load_thumbnailer (TumblerManager *manager, "MimeTypes", NULL, &error); if (mime_types == NULL) { - g_warning (_("Malformed file \"%s\": %s"), filename, error->message); + g_warning (TUMBLER_WARNING_MALFORMED_FILE, filename, error->message); g_clear_error (&error); g_free (object_path); @@ -1017,7 +1014,7 @@ tumbler_manager_load_thumbnailer (TumblerManager *manager, /* determine the time the file was last modified */ if (g_stat (filename, &file_stat) != 0) { - g_warning (_("Failed to determine last modified time of \"%s\""), filename); + g_warning ("Failed to determine last modified time of \"%s\"", filename); g_strfreev (uri_schemes); g_strfreev (mime_types); diff --git a/tumblerd/tumbler-service.c b/tumblerd/tumbler-service.c index f9c9118..ca72c10 100644 --- a/tumblerd/tumbler-service.c +++ b/tumblerd/tumbler-service.c @@ -765,7 +765,7 @@ tumbler_service_queue_cb (TumblerExportedService *skeleton, /* emit an error signal */ tumbler_service_scheduler_error (scheduler, handle, uris, TUMBLER_ERROR_UNSUPPORTED_FLAVOR, - _("Unsupported thumbnail flavor requested"), + TUMBLER_ERROR_MESSAGE_UNSUPPORTED_FLAVOR, scheduler_request->origin, service); |