[gnome-packagekit] Do not use the deprecated (and unused) PkMessage



commit ae7713c3f368a8fa4f4b5e7eff0dab7ee2a5d8c4
Author: Richard Hughes <richard hughsie com>
Date:   Thu Dec 5 14:20:29 2013 +0000

    Do not use the deprecated (and unused) PkMessage

 src/gpk-enum.c      |   88 ---------------------------------------------------
 src/gpk-enum.h      |    3 --
 src/gpk-self-test.c |   18 ----------
 3 files changed, 0 insertions(+), 109 deletions(-)
---
diff --git a/src/gpk-enum.c b/src/gpk-enum.c
index f60de4a..3e78a09 100644
--- a/src/gpk-enum.c
+++ b/src/gpk-enum.c
@@ -236,26 +236,6 @@ static const PkEnumMatch enum_restart_dialog_icon_name[] = {
        {0, NULL}
 };
 
-static const PkEnumMatch enum_message_icon_name[] = {
-       {PK_MESSAGE_ENUM_UNKNOWN,               "help-browser"},        /* fall though value */
-       {PK_MESSAGE_ENUM_BROKEN_MIRROR,         "dialog-error"},
-       {PK_MESSAGE_ENUM_CONNECTION_REFUSED,    "dialog-error"},
-       {PK_MESSAGE_ENUM_PARAMETER_INVALID,     "dialog-error"},
-       {PK_MESSAGE_ENUM_PRIORITY_INVALID,      "dialog-error"},
-       {PK_MESSAGE_ENUM_BACKEND_ERROR,         "dialog-error"},
-       {PK_MESSAGE_ENUM_DAEMON_ERROR,          "dialog-error"},
-       {PK_MESSAGE_ENUM_CACHE_BEING_REBUILT,   "dialog-information"},
-       {PK_MESSAGE_ENUM_NEWER_PACKAGE_EXISTS,  "dialog-information"},
-       {PK_MESSAGE_ENUM_COULD_NOT_FIND_PACKAGE,"dialog-error"},
-       {PK_MESSAGE_ENUM_CONFIG_FILES_CHANGED,  "dialog-information"},
-       {PK_MESSAGE_ENUM_PACKAGE_ALREADY_INSTALLED,     "dialog-information"},
-       {PK_MESSAGE_ENUM_AUTOREMOVE_IGNORED,    "dialog-information"},
-       {PK_MESSAGE_ENUM_REPO_METADATA_DOWNLOAD_FAILED, "dialog-warning"},
-       {PK_MESSAGE_ENUM_REPO_FOR_DEVELOPERS_ONLY,      "dialog-warning"},
-       {PK_MESSAGE_ENUM_OTHER_UPDATES_HELD_BACK,       "dialog-information"},
-       {0, NULL}
-};
-
 /**
  * gpk_media_type_enum_to_localised_text:
  **/
@@ -852,65 +832,6 @@ gpk_update_state_enum_to_localised_text (PkUpdateStateEnum state)
 }
 
 /**
- * gpk_message_enum_to_localised_text:
- **/
-const gchar *
-gpk_message_enum_to_localised_text (PkMessageEnum message)
-{
-       const gchar *text = NULL;
-       switch (message) {
-       case PK_MESSAGE_ENUM_BROKEN_MIRROR:
-               text = _("A mirror is possibly broken");
-               break;
-       case PK_MESSAGE_ENUM_CONNECTION_REFUSED:
-               text = _("The connection was refused");
-               break;
-       case PK_MESSAGE_ENUM_PARAMETER_INVALID:
-               text = _("The parameter was invalid");
-               break;
-       case PK_MESSAGE_ENUM_PRIORITY_INVALID:
-               text = _("The priority was invalid");
-               break;
-       case PK_MESSAGE_ENUM_BACKEND_ERROR:
-               text = _("Backend warning");
-               break;
-       case PK_MESSAGE_ENUM_DAEMON_ERROR:
-               text = _("Daemon warning");
-               break;
-       case PK_MESSAGE_ENUM_CACHE_BEING_REBUILT:
-               text = _("The package list cache is being rebuilt");
-               break;
-       case PK_MESSAGE_ENUM_NEWER_PACKAGE_EXISTS:
-               text = _("A newer package exists");
-               break;
-       case PK_MESSAGE_ENUM_COULD_NOT_FIND_PACKAGE:
-               text = _("Could not find package");
-               break;
-       case PK_MESSAGE_ENUM_CONFIG_FILES_CHANGED:
-               text = _("Configuration files were changed");
-               break;
-       case PK_MESSAGE_ENUM_PACKAGE_ALREADY_INSTALLED:
-               text = _("Package is already installed");
-               break;
-       case PK_MESSAGE_ENUM_AUTOREMOVE_IGNORED:
-               text = _("Automatic cleanup is being ignored");
-               break;
-       case PK_MESSAGE_ENUM_REPO_METADATA_DOWNLOAD_FAILED:
-               text = _("Software source download failed");
-               break;
-       case PK_MESSAGE_ENUM_REPO_FOR_DEVELOPERS_ONLY:
-               text = _("This software source is for developers only");
-               break;
-       case PK_MESSAGE_ENUM_OTHER_UPDATES_HELD_BACK:
-               text = _("Other updates have been held back");
-               break;
-       default:
-               g_warning ("message unrecognized: %i", message);
-       }
-       return text;
-}
-
-/**
  * gpk_status_enum_to_localised_text:
  **/
 const gchar *
@@ -1770,15 +1691,6 @@ gpk_restart_enum_to_dialog_icon_name (PkRestartEnum restart)
 }
 
 /**
- * gpk_message_enum_to_icon_name:
- **/
-const gchar *
-gpk_message_enum_to_icon_name (PkMessageEnum message)
-{
-       return pk_enum_find_string (enum_message_icon_name, message);
-}
-
-/**
  * gpk_info_status_enum_to_string:
  **/
 const gchar *
diff --git a/src/gpk-enum.h b/src/gpk-enum.h
index ab1e874..4ad5cff 100644
--- a/src/gpk-enum.h
+++ b/src/gpk-enum.h
@@ -92,9 +92,6 @@ const gchar   *gpk_restart_enum_to_localised_text     (PkRestartEnum   restart)
                                                         G_GNUC_CONST;
 const gchar    *gpk_update_state_enum_to_localised_text (PkUpdateStateEnum state)
                                                         G_GNUC_CONST;
-const gchar    *gpk_message_enum_to_icon_name          (PkMessageEnum   message);
-const gchar    *gpk_message_enum_to_localised_text     (PkMessageEnum   message)
-                                                        G_GNUC_CONST;
 const gchar    *gpk_restart_enum_to_localised_text_future(PkRestartEnum         restart)
                                                         G_GNUC_CONST;
 const gchar    *gpk_group_enum_to_localised_text       (PkGroupEnum     group)
diff --git a/src/gpk-self-test.c b/src/gpk-self-test.c
index 2a0c8c3..e796125 100644
--- a/src/gpk-self-test.c
+++ b/src/gpk-self-test.c
@@ -182,24 +182,6 @@ gpk_test_enum_func (void)
                }
        }
 
-       /* check we convert all the message icon name enums */
-       for (i = PK_MESSAGE_ENUM_UNKNOWN+1; i < PK_MESSAGE_ENUM_LAST; i++) {
-               string = gpk_message_enum_to_icon_name (i);
-               if (string == NULL || g_strcmp0 (string, "help-browser") == 0) {
-                       g_warning ("failed to get %s", pk_message_enum_to_string (i));
-                       break;
-               }
-       }
-
-       /* check we convert all the localized message enums */
-       for (i = PK_MESSAGE_ENUM_UNKNOWN+1; i < PK_MESSAGE_ENUM_LAST; i++) {
-               string = gpk_message_enum_to_localised_text (i);
-               if (string == NULL) {
-                       g_warning ("failed to get %i", i);
-                       break;
-               }
-       }
-
        /* check we convert all the localized restart future enums */
        for (i = PK_RESTART_ENUM_UNKNOWN+1; i < PK_RESTART_ENUM_LAST; i++) {
                string = gpk_restart_enum_to_localised_text_future (i);


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