[gnome-packagekit] Remove obsolete compile time version checks
- From: Christopher Aillon <caillon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-packagekit] Remove obsolete compile time version checks
- Date: Thu, 24 Feb 2011 17:09:25 +0000 (UTC)
commit 2d8ee2bdf4d76357a93709978f7f5071b2d058e0
Author: Christopher Aillon <caillon redhat com>
Date: Sun Feb 20 17:03:53 2011 -0800
Remove obsolete compile time version checks
The minimum version of packagekit-glib2 required to compile is 0.6.5,
so remove the checks for older versions.
src/gpk-application.c | 35 +++--------------------------------
src/gpk-enum.h | 23 -----------------------
src/gpk-task.c | 8 --------
3 files changed, 3 insertions(+), 63 deletions(-)
---
diff --git a/src/gpk-application.c b/src/gpk-application.c
index 83d3ab0..3e62865 100644
--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -317,18 +317,13 @@ gpk_application_set_buttons_apply_clear (gpointer user_data)
gboolean enabled;
gchar *package_id;
gint len;
-#if PK_CHECK_VERSION(0,6,1)
GPtrArray *array;
-#endif
/* okay to apply? */
-#if PK_CHECK_VERSION(0,6,1)
array = pk_package_sack_get_array (package_sack);
len = array->len;
g_ptr_array_unref (array);
-#else
- len = pk_package_sack_get_size (package_sack);
-#endif
+
if (len == 0) {
widget = GTK_WIDGET (gtk_builder_get_object (builder, "button_apply"));
gtk_widget_set_sensitive (widget, FALSE);
@@ -1685,7 +1680,6 @@ gpk_application_populate_selected (gpointer user_data)
{
guint i;
PkPackage *package;
-#if PK_CHECK_VERSION(0,6,1)
GPtrArray *array;
/* get size */
@@ -1702,27 +1696,9 @@ gpk_application_populate_selected (gpointer user_data)
package = g_ptr_array_index (array, i);
gpk_application_add_item_to_results (package);
}
-out:
- g_ptr_array_unref (array);
-#else
- guint len;
- /* get size */
- len = pk_package_sack_get_size (package_sack);
-
- /* nothing in queue */
- if (len == 0) {
- gpk_application_suggest_better_search (NULL);
- goto out;
- }
-
- /* dump queue to package window */
- for (i=0; i<len; i++) {
- package = pk_package_sack_get_index (package_sack, i);
- gpk_application_add_item_to_results (package);
- }
out:
-#endif
+ g_ptr_array_unref (array);
return TRUE;
}
@@ -1768,22 +1744,17 @@ gpk_application_find_cb (GtkWidget *button_widget, gpointer user_data)
static gboolean
gpk_application_quit (GtkApplication *application)
{
-#if PK_CHECK_VERSION(0,6,1)
GPtrArray *array;
-#endif
gint len;
GtkResponseType result;
GtkWindow *window;
GtkWidget *dialog;
/* do we have any items queued for removal or installation? */
-#if PK_CHECK_VERSION(0,6,1)
array = pk_package_sack_get_array (package_sack);
len = array->len;
g_ptr_array_unref (array);
-#else
- len = pk_package_sack_get_size (package_sack);
-#endif
+
if (len != 0) {
window = GTK_WINDOW (gtk_builder_get_object (builder, "window_manager"));
dialog = gtk_message_dialog_new (window, GTK_DIALOG_MODAL,
diff --git a/src/gpk-enum.h b/src/gpk-enum.h
index 0d98e46..dc8c95f 100644
--- a/src/gpk-enum.h
+++ b/src/gpk-enum.h
@@ -56,29 +56,6 @@ typedef enum {
} GpkInfoStatusEnum;
/* constants defined in previous versions */
-#if (!PK_CHECK_VERSION(0,5,6))
-#define PK_ERROR_ENUM_UPDATE_FAILED_DUE_TO_RUNNING_PROCESS (PK_ERROR_ENUM_PACKAGE_FAILED_TO_REMOVE + 1)
-#endif
-
-#if (!PK_CHECK_VERSION(0,5,7))
-#define PK_MESSAGE_ENUM_REPO_FOR_DEVELOPERS_ONLY (PK_MESSAGE_ENUM_REPO_METADATA_DOWNLOAD_FAILED + 1)
-#endif
-
-#if (!PK_CHECK_VERSION(0,6,2))
-#define PK_CLIENT_ERROR_DECLINED_SIMULATION PK_CLIENT_ERROR_FAILED
-#define PK_ERROR_ENUM_PACKAGE_DATABASE_CHANGED PK_ERROR_ENUM_LAST
-#define PK_CLIENT_ERROR_LAST (PK_CLIENT_ERROR_DECLINED_SIMULATION + 1)
-#endif
-
-#if (!PK_CHECK_VERSION(0,6,3))
-#define PK_ERROR_ENUM_PROVIDE_TYPE_NOT_SUPPORTED (PK_ERROR_ENUM_PACKAGE_DATABASE_CHANGED + 1)
-#endif
-
-#if (!PK_CHECK_VERSION(0,6,4))
-#define PK_MESSAGE_ENUM_OTHER_UPDATES_HELD_BACK (PK_MESSAGE_ENUM_REPO_FOR_DEVELOPERS_ONLY + 1)
-#define PK_ERROR_ENUM_INSTALL_ROOT_INVALID (PK_ERROR_ENUM_PROVIDE_TYPE_NOT_SUPPORTED + 1)
-#endif
-
#if (!PK_CHECK_VERSION(0,6,11))
#define PK_ROLE_ENUM_UPGRADE_SYSTEM (PK_ROLE_ENUM_SIMULATE_UPDATE_PACKAGES + 1)
#endif
diff --git a/src/gpk-task.c b/src/gpk-task.c
index 4403c3b..50e86c4 100644
--- a/src/gpk-task.c
+++ b/src/gpk-task.c
@@ -370,7 +370,6 @@ out:
g_ptr_array_unref (array);
}
-#if PK_CHECK_VERSION(0,6,2)
/**
* gpk_task_add_dialog_deps_section:
**/
@@ -437,7 +436,6 @@ out:
g_ptr_array_unref (array_tmp);
g_object_unref (sack_tmp);
}
-#endif
/**
* gpk_task_simulate_question:
@@ -509,7 +507,6 @@ gpk_task_simulate_question (PkTask *task, guint request, PkResults *results)
GTK_MESSAGE_INFO, GTK_BUTTONS_CANCEL, "%s", title));
gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (priv->current_window), "%s", message);
-#if PK_CHECK_VERSION(0,6,2)
/* get the details for all the packages */
sack = pk_results_get_package_sack (results);
@@ -529,11 +526,6 @@ gpk_task_simulate_question (PkTask *task, guint request, PkResults *results)
/* TRANSLATORS: additional message text for the deps dialog */
gpk_task_add_dialog_deps_section (task, sack, PK_INFO_ENUM_DOWNGRADING);
-#else
- /* get all the data */
- array = pk_results_get_package_array (results);
- gpk_dialog_embed_package_list_widget (GTK_DIALOG(priv->current_window), array);
-#endif
gpk_dialog_embed_do_not_show_widget (GTK_DIALOG(priv->current_window), GPK_SETTINGS_SHOW_DEPENDS);
/* TRANSLATORS: this is button text */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]