[gnome-packagekit] trivial: Remove some unused API



commit 0477a3fcb1e0f35202d45f3c8bace0489de570c2
Author: Richard Hughes <richard hughsie com>
Date:   Mon Jul 18 14:35:29 2016 +0100

    trivial: Remove some unused API

 src/gpk-common.c    |  125 ----------------------------------------------
 src/gpk-common.h    |    2 -
 src/gpk-enum.c      |  137 ---------------------------------------------------
 src/gpk-enum.h      |    2 -
 src/gpk-error.c     |   14 -----
 src/gpk-error.h     |    3 -
 src/gpk-self-test.c |    9 ---
 7 files changed, 0 insertions(+), 292 deletions(-)
---
diff --git a/src/gpk-common.c b/src/gpk-common.c
index 2d60ed6..828164f 100644
--- a/src/gpk-common.c
+++ b/src/gpk-common.c
@@ -296,131 +296,6 @@ out:
 }
 
 /**
- * gpk_time_to_imprecise_string:
- * @time_secs: The time value to convert in seconds
- *
- * Returns a localized timestring
- *
- * Return value: The time string, e.g. "2 hours"
- **/
-gchar *
-gpk_time_to_imprecise_string (guint time_secs)
-{
-       gchar* timestring = NULL;
-       guint hours;
-       guint minutes;
-       guint seconds;
-
-       /* is valid? */
-       if (time_secs == 0) {
-               /* TRANSLATORS: The actions has just literally happened */
-               timestring = g_strdup_printf (_("Now"));
-               goto out;
-       }
-
-       /* make local copy */
-       seconds = time_secs;
-
-       /* less than a minute */
-       if (seconds < 60) {
-               /* TRANSLATORS: time */
-               timestring = g_strdup_printf (ngettext ("%i second", "%i seconds", seconds), seconds);
-               goto out;
-       }
-
-       /* Add 0.5 to do rounding */
-       minutes = (guint) ((time_secs / 60.0 ) + 0.5);
-
-       /* less than an hour */
-       if (minutes < 60) {
-               /* TRANSLATORS: time */
-               timestring = g_strdup_printf (ngettext ("%i minute", "%i minutes", minutes), minutes);
-               goto out;
-       }
-
-       hours = minutes / 60;
-       /* TRANSLATORS: time */
-       timestring = g_strdup_printf (ngettext ("%i hour", "%i hours", hours), hours);
-out:
-       return timestring;
-}
-
-/**
- * gpk_time_to_localised_string:
- * @time_secs: The time value to convert in seconds
- *
- * Returns a localized timestring
- *
- * Return value: The time string, e.g. "2 hours 3 minutes"
- **/
-gchar *
-gpk_time_to_localised_string (guint time_secs)
-{
-       gchar* timestring = NULL;
-       guint hours;
-       guint minutes;
-       guint seconds;
-
-       /* is valid? */
-       if (time_secs == 0) {
-               /* TRANSLATORS: The actions has just literally happened */
-               timestring = g_strdup_printf (_("Now"));
-               goto out;
-       }
-
-       /* make local copy */
-       seconds = time_secs;
-
-       /* less than a minute */
-       if (seconds < 60) {
-               /* TRANSLATORS: time */
-               timestring = g_strdup_printf (ngettext ("%i second",
-                                                       "%i seconds",
-                                                       seconds), seconds);
-               goto out;
-       }
-
-       /* Add 0.5 to do rounding */
-       minutes = (guint) ((time_secs / 60.0 ) + 0.5);
-       seconds = seconds % 60;
-
-       /* less than an hour */
-       if (minutes < 60) {
-               if (seconds == 0) {
-                       timestring = g_strdup_printf (ngettext ("%i minute",
-                                                               "%i minutes",
-                                                               minutes), minutes);
-               } else {
-                       /* TRANSLATOR: "%i %s %i %s" are "%i minutes %i seconds"
-                        * Swap order with "%2$s %2$i %1$s %1$i if needed */
-                       timestring = g_strdup_printf (_("%i %s %i %s"),
-                                       minutes, ngettext ("minute", "minutes", minutes),
-                                       seconds, ngettext ("second", "seconds", seconds));
-               }
-               goto out;
-       }
-
-       /* more than an hour */
-       hours = minutes / 60;
-       minutes = minutes % 60;
-       if (minutes == 0) {
-               /* TRANSLATORS: time */
-               timestring = g_strdup_printf (ngettext (
-                               "%i hour",
-                               "%i hours",
-                               hours), hours);
-       } else {
-               /* TRANSLATOR: "%i %s %i %s" are "%i hours %i minutes"
-                * Swap order with "%2$s %2$i %1$s %1$i if needed */
-               timestring = g_strdup_printf (_("%i %s %i %s"),
-                               hours, ngettext ("hour", "hours", hours),
-                               minutes, ngettext ("minute", "minutes", minutes));
-       }
-out:
-       return timestring;
-}
-
-/**
  * gpk_strv_join_locale:
  *
  * Return value: "dave" or "dave and john" or "dave, john and alice",
diff --git a/src/gpk-common.h b/src/gpk-common.h
index 458f951..ed98f46 100644
--- a/src/gpk-common.h
+++ b/src/gpk-common.h
@@ -64,8 +64,6 @@ gchar         *gpk_package_id_format_twoline          (GtkStyleContext *style,
                                                         const gchar    *summary);
 gchar          *gpk_package_id_format_oneline          (const gchar    *package_id,
                                                         const gchar    *summary);
-gchar          *gpk_time_to_localised_string           (guint           time_secs);
-gchar          *gpk_time_to_imprecise_string           (guint           time_secs);
 gboolean        gpk_check_privileged_user              (const gchar    *application_name,
                                                         gboolean        show_ui);
 gchar          *gpk_strv_join_locale                   (gchar          **array);
diff --git a/src/gpk-enum.c b/src/gpk-enum.c
index 7825d9e..397581c 100644
--- a/src/gpk-enum.c
+++ b/src/gpk-enum.c
@@ -1046,143 +1046,6 @@ gpk_info_enum_to_localised_past (PkInfoEnum info)
 }
 
 const gchar *
-gpk_role_enum_to_localised_present (PkRoleEnum role)
-{
-       const gchar *text = NULL;
-       switch (role) {
-       case PK_ROLE_ENUM_UNKNOWN:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Unknown role type");
-               break;
-       case PK_ROLE_ENUM_DEPENDS_ON:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Getting dependencies");
-               break;
-       case PK_ROLE_ENUM_GET_UPDATE_DETAIL:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Getting update detail");
-               break;
-       case PK_ROLE_ENUM_GET_DETAILS:
-       case PK_ROLE_ENUM_GET_DETAILS_LOCAL:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Getting details");
-               break;
-       case PK_ROLE_ENUM_REQUIRED_BY:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Getting requires");
-               break;
-       case PK_ROLE_ENUM_GET_UPDATES:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Getting updates");
-               break;
-       case PK_ROLE_ENUM_SEARCH_DETAILS:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Searching details");
-               break;
-       case PK_ROLE_ENUM_SEARCH_FILE:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Searching for file");
-               break;
-       case PK_ROLE_ENUM_SEARCH_GROUP:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Searching groups");
-               break;
-       case PK_ROLE_ENUM_SEARCH_NAME:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Searching for package name");
-               break;
-       case PK_ROLE_ENUM_REMOVE_PACKAGES:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Removing");
-               break;
-       case PK_ROLE_ENUM_INSTALL_PACKAGES:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Installing");
-               break;
-       case PK_ROLE_ENUM_INSTALL_FILES:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Installing file");
-               break;
-       case PK_ROLE_ENUM_REFRESH_CACHE:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Refreshing package cache");
-               break;
-       case PK_ROLE_ENUM_UPDATE_PACKAGES:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Updating packages");
-               break;
-       case PK_ROLE_ENUM_CANCEL:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Canceling");
-               break;
-       case PK_ROLE_ENUM_GET_REPO_LIST:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Getting list of repositories");
-               break;
-       case PK_ROLE_ENUM_REPO_ENABLE:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Enabling repository");
-               break;
-       case PK_ROLE_ENUM_REPO_REMOVE:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Removing repository");
-               break;
-       case PK_ROLE_ENUM_REPO_SET_DATA:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Setting repository data");
-               break;
-       case PK_ROLE_ENUM_RESOLVE:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Resolving");
-               break;
-       case PK_ROLE_ENUM_GET_FILES:
-       case PK_ROLE_ENUM_GET_FILES_LOCAL:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Getting file list");
-               break;
-       case PK_ROLE_ENUM_WHAT_PROVIDES:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Getting what provides");
-               break;
-       case PK_ROLE_ENUM_INSTALL_SIGNATURE:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Installing signature");
-               break;
-       case PK_ROLE_ENUM_GET_PACKAGES:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Getting package lists");
-               break;
-       case PK_ROLE_ENUM_ACCEPT_EULA:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Accepting EULA");
-               break;
-       case PK_ROLE_ENUM_DOWNLOAD_PACKAGES:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Downloading packages");
-               break;
-       case PK_ROLE_ENUM_GET_DISTRO_UPGRADES:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Getting distribution upgrade information");
-               break;
-       case PK_ROLE_ENUM_GET_CATEGORIES:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Getting categories");
-               break;
-       case PK_ROLE_ENUM_GET_OLD_TRANSACTIONS:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Getting old transactions");
-               break;
-       case PK_ROLE_ENUM_REPAIR_SYSTEM:
-               /* TRANSLATORS: The role of the transaction, in present tense */
-               text = _("Repairing the system");
-               break;
-       default:
-               g_warning ("role unrecognized: %s", pk_role_enum_to_string (role));
-       }
-       return text;
-}
-
-const gchar *
 gpk_role_enum_to_localised_past (PkRoleEnum role)
 {
        const gchar *text = NULL;
diff --git a/src/gpk-enum.h b/src/gpk-enum.h
index 3e8460a..2bd1aa8 100644
--- a/src/gpk-enum.h
+++ b/src/gpk-enum.h
@@ -75,8 +75,6 @@ typedef enum {
 
 const gchar    *gpk_role_enum_to_localised_past        (PkRoleEnum      role)
                                                         G_GNUC_CONST;
-const gchar    *gpk_role_enum_to_localised_present     (PkRoleEnum      role)
-                                                        G_GNUC_CONST;
 const gchar    *gpk_role_enum_to_icon_name             (PkRoleEnum      role);
 const gchar    *gpk_media_type_enum_to_localised_text  (PkMediaTypeEnum type)
                                                         G_GNUC_CONST;
diff --git a/src/gpk-error.c b/src/gpk-error.c
index 42ab26a..2da6059 100644
--- a/src/gpk-error.c
+++ b/src/gpk-error.c
@@ -152,17 +152,3 @@ gpk_error_dialog_modal (GtkWindow *window, const gchar *title, const gchar *mess
 {
        return gpk_error_dialog_modal_with_time (window, title, message, details, 0);
 }
-
-/**
- * gpk_error_dialog:
- * @title: the localized text to put in bold as a title
- * @message: the localized text to put as a message
- * @details: the geeky text to in the expander, or %NULL if nothing
- *
- * Shows a modal error, and blocks until the user clicks close
- **/
-gboolean
-gpk_error_dialog (const gchar *title, const gchar *message, const gchar *details)
-{
-       return gpk_error_dialog_modal (NULL, title, message, details);
-}
diff --git a/src/gpk-error.h b/src/gpk-error.h
index 9028ca8..91df8c4 100644
--- a/src/gpk-error.h
+++ b/src/gpk-error.h
@@ -26,9 +26,6 @@
 
 G_BEGIN_DECLS
 
-gboolean        gpk_error_dialog                       (const gchar    *title,
-                                                        const gchar    *message,
-                                                        const gchar    *details);
 gboolean        gpk_error_dialog_modal                 (GtkWindow      *window,
                                                         const gchar    *title,
                                                         const gchar    *message,
diff --git a/src/gpk-self-test.c b/src/gpk-self-test.c
index 8aae381..d26dcc5 100644
--- a/src/gpk-self-test.c
+++ b/src/gpk-self-test.c
@@ -80,15 +80,6 @@ gpk_test_enum_func (void)
                }
        }
 
-       /* check we convert all the localized present role enums */
-       for (i = 0; i < PK_ROLE_ENUM_LAST; i++) {
-               string = gpk_role_enum_to_localised_present (i);
-               if (string == NULL) {
-                       g_warning ("failed to get %i", i);
-                       break;
-               }
-       }
-
        /* check we convert all the role icon name enums */
        for (i = PK_ROLE_ENUM_UNKNOWN+1; i < PK_ROLE_ENUM_LAST; i++) {
                string = gpk_role_enum_to_icon_name (i);


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