[gnome-software] Do not use a GAction for setting the verbose output



commit 03caf52f174aed741aa40d3009c3fe5335138fa9
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jan 29 09:07:18 2014 +0000

    Do not use a GAction for setting the verbose output
    
    This doesn't happen early enough to capture all the useful startup data.

 src/gs-app-widget.c                   |    1 -
 src/gs-application.c                  |   28 +++++-----------------------
 src/gs-plugin-loader.c                |    4 ++--
 src/gs-shell-search-provider.c        |    4 ++--
 src/plugins/gs-plugin-desktopdb.c     |    2 +-
 src/plugins/gs-plugin-fedora-tagger.c |    4 ++--
 6 files changed, 12 insertions(+), 31 deletions(-)
---
diff --git a/src/gs-app-widget.c b/src/gs-app-widget.c
index 13d5e03..b2432f7 100644
--- a/src/gs-app-widget.c
+++ b/src/gs-app-widget.c
@@ -141,7 +141,6 @@ gs_app_widget_refresh (GsAppWidget *app_widget)
        /* join the lines*/
        str = gs_app_widget_get_description (app_widget);
        gs_string_replace (str, "\n", " ");
-       g_debug ("setting description: %s", str->str);
        gtk_label_set_markup (GTK_LABEL (priv->description_label), str->str);
        g_string_free (str, TRUE);
 
diff --git a/src/gs-application.c b/src/gs-application.c
index 8bf450f..9013c81 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -319,20 +319,6 @@ search_activated (GSimpleAction *action,
 }
 
 static void
-set_debug_level_activated (GSimpleAction *action,
-                          GVariant      *parameter,
-                          gpointer       data)
-{
-       if (g_variant_get_int32 (parameter) > 0) {
-               g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
-               g_debug ("enabled debugging");
-       } else {
-               g_debug ("enabled disabled");
-               g_setenv ("G_MESSAGES_DEBUG", "", TRUE);
-       }
-}
-
-static void
 details_activated (GSimpleAction *action,
                   GVariant      *parameter,
                   gpointer       data)
@@ -405,7 +391,6 @@ static GActionEntry actions[] = {
        { "profile", profile_activated, NULL, NULL, NULL },
        { "set-mode", set_mode_activated, "s", NULL, NULL },
        { "search", search_activated, "s", NULL, NULL },
-       { "set-debug-level", set_debug_level_activated, "i", NULL, NULL },
        { "details", details_activated, "(ss)", NULL, NULL },
        { "launch", launch_activated, "s", NULL, NULL },
         { "clear-offline-updates", clear_offline_updates, NULL, NULL, NULL },
@@ -469,7 +454,7 @@ gs_application_local_command_line (GApplication *app, gchar ***args, gint *statu
        gboolean activate_ui = TRUE;
        gboolean version = FALSE;
        gboolean profile = FALSE;
-       gint debug_level = -1;
+       gboolean verbose = FALSE;
        gint argc;
        const GOptionEntry options[] = {
                 { "gapplication-service", '\0', 0, G_OPTION_ARG_NONE, &gapplication_service,
@@ -481,7 +466,7 @@ gs_application_local_command_line (GApplication *app, gchar ***args, gint *statu
                  _("Search for applications"), _("SEARCH") },
                { "details", '\0', 0, G_OPTION_ARG_STRING, &id,
                  _("Show application details"), _("ID") },
-               { "set-debug-level", '\0', 0, G_OPTION_ARG_INT, &debug_level,
+               { "verbose", '\0', 0, G_OPTION_ARG_NONE, &verbose,
                  _("Set the specified debugging level"), _("ID") },
                { "profile", 0, 0, G_OPTION_ARG_NONE, &profile,
                  _("Show profiling information for the service"), NULL },
@@ -501,6 +486,9 @@ gs_application_local_command_line (GApplication *app, gchar ***args, gint *statu
                goto out;
        }
 
+       if (verbose)
+               g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
+
        if (version) {
                g_print ("gnome-software " VERSION "\n");
                *status = 0;
@@ -528,12 +516,6 @@ gs_application_local_command_line (GApplication *app, gchar ***args, gint *statu
                                                "profile",
                                                NULL);
        }
-       if (debug_level >= 0) {
-               activate_ui = FALSE;
-               g_action_group_activate_action (G_ACTION_GROUP (app),
-                                               "set-debug-level",
-                                               g_variant_new_int32 (debug_level));
-       }
 
        if (mode != NULL) {
                g_action_group_activate_action (G_ACTION_GROUP (app),
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 796db23..53dfe39 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -438,8 +438,8 @@ gs_plugin_loader_app_is_valid (GsApp *app, gpointer user_data)
 
        /* don't show unconverted packages in the application view */
        if (gs_app_get_kind (app) == GS_APP_KIND_PACKAGE) {
-               g_debug ("app invalid as only a package %s",
-                        gs_plugin_loader_get_app_str (app));
+//             g_debug ("app invalid as only a package %s",
+//                      gs_plugin_loader_get_app_str (app));
                return FALSE;
        }
 
diff --git a/src/gs-shell-search-provider.c b/src/gs-shell-search-provider.c
index 5ccfee5..b578a53 100644
--- a/src/gs-shell-search-provider.c
+++ b/src/gs-shell-search-provider.c
@@ -289,7 +289,7 @@ search_provider_name_acquired_cb (GDBusConnection *connection,
                                   const gchar     *name,
                                   gpointer         user_data)
 {
-       g_debug ("Search provider name acquired: %s\n", name);
+       g_debug ("Search provider name acquired: %s", name);
 }
 
 static void
@@ -297,7 +297,7 @@ search_provider_name_lost_cb (GDBusConnection *connection,
                               const gchar     *name,
                               gpointer         user_data)
 {
-       g_debug ("Search provider name lost: %s\n", name);
+       g_debug ("Search provider name lost: %s", name);
 }
 
 static void
diff --git a/src/plugins/gs-plugin-desktopdb.c b/src/plugins/gs-plugin-desktopdb.c
index 2cbcbbf..233ac99 100644
--- a/src/plugins/gs-plugin-desktopdb.c
+++ b/src/plugins/gs-plugin-desktopdb.c
@@ -111,7 +111,7 @@ gs_plugin_desktopdb_set_metadata (GsPlugin *plugin,
                        goto out;
                }
                if (files->len == 0) {
-                       g_debug ("not an application %s", pkg_name);
+                       g_debug ("no desktopdb entry for %s", pkg_name);
                        goto out;
                }
 
diff --git a/src/plugins/gs-plugin-fedora-tagger.c b/src/plugins/gs-plugin-fedora-tagger.c
index 28ca0a5..9b9a0e3 100644
--- a/src/plugins/gs-plugin-fedora-tagger.c
+++ b/src/plugins/gs-plugin-fedora-tagger.c
@@ -581,8 +581,8 @@ gs_plugin_refine (GsPlugin *plugin,
                        pkgname = g_ptr_array_index (sources, i);
                        rating = gs_plugin_resolve_app (plugin, pkgname);
                        if (rating != -1) {
-                               g_debug ("fedora-tagger setting rating on %s to %i",
-                                        pkgname, rating);
+//                             g_debug ("fedora-tagger setting rating on %s to %i",
+//                                      pkgname, rating);
                                gs_app_set_rating (app, rating);
                                gs_app_set_rating_kind (app, GS_APP_RATING_KIND_SYSTEM);
                        }


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