Hello community,
here is the log from the commit of package gnome-power-manager for
openSUSE:Factory checked in at 2014-01-27 11:23:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gnome-power-manager (Old)
and /work/SRC/openSUSE:Factory/.gnome-power-manager.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gnome-power-manager"
Changes:
--------
--- /work/SRC/openSUSE:Factory/gnome-power-manager/gnome-power-manager.changes
2013-10-15 10:41:19.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.gnome-power-manager.new/gnome-power-manager.changes
2014-01-27 11:23:43.000000000 +0100
@@ -1,0 +2,6 @@
+Wed Dec 11 16:42:54 UTC 2013 - [email protected]
+
+- Add gnome-power-manager-new-upower-api.patch: port to UPower
+ 0.99.
+
+-------------------------------------------------------------------
New:
----
gnome-power-manager-new-upower-api.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gnome-power-manager.spec ++++++
--- /var/tmp/diff_new_pack.LGr7U4/_old 2014-01-27 11:23:44.000000000 +0100
+++ /var/tmp/diff_new_pack.LGr7U4/_new 2014-01-27 11:23:44.000000000 +0100
@@ -26,6 +26,8 @@
Source:
http://download.gnome.org/sources/gnome-power-manager/3.10/%{name}-%{version}.tar.xz
# PATCH-NEEDS-REBASE gnome-power-manager-schedule-wakeups.patch gburt
fate302448 -- add tab to prefs to schedule rtcwake (was PATCH-FEATURE-OPENSUSE)
Patch10: gnome-power-manager-schedule-wakeups.patch
+# PATCH-FEATURE-UPSTREAM gnome-power-manager-new-upower-api.patch
[email protected] -- Port to upower 0.99.
+Patch11: gnome-power-manager-new-upower-api.patch
BuildRequires: docbook-utils-minimal
BuildRequires: fdupes
# For directory ownership
@@ -62,6 +64,7 @@
#gnome-patch-translation-prepare
# Needs rebase:
#patch10 -p1
+%patch11 -p1
#gnome-patch-translation-update
%if 0%{?BUILD_FROM_VCS}
++++++ gnome-power-manager-new-upower-api.patch ++++++
>From b6dd2b53ec4b96ebef0ea1742bda498d3524d2c5 Mon Sep 17 00:00:00 2001
From: Richard Hughes <[email protected]>
Date: Tue, 5 Nov 2013 11:20:54 +0000
Subject: [PATCH] Port to the new upower API
---
src/gpm-statistics.c | 80 ++++++++++++++++++++++++++++++----------------------
1 file changed, 46 insertions(+), 34 deletions(-)
diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c
index c749191..78bc4bf 100644
--- a/src/gpm-statistics.c
+++ b/src/gpm-statistics.c
@@ -54,6 +54,8 @@ static gfloat sigma_smoothing = 0.0f;
static UpWakeups *wakeups = NULL;
static GtkWidget *graph_history = NULL;
static GtkWidget *graph_statistics = NULL;
+static UpClient *client = NULL;
+static GPtrArray *devices = NULL;
enum {
GPM_INFO_COLUMN_TEXT,
@@ -1451,6 +1453,21 @@ gpm_stats_devices_treeview_clicked_cb (GtkTreeSelection
*selection, gpointer use
}
/**
+ * gpm_stats_device_changed_cb:
+ **/
+static void
+gpm_stats_device_changed_cb (UpDevice *device, GParamSpec *pspec, gpointer
user_data)
+{
+ const gchar *object_path;
+ object_path = up_device_get_object_path (device);
+ if (object_path == NULL || current_device == NULL)
+ return;
+ g_debug ("changed: %s", object_path);
+ if (g_strcmp0 (current_device, object_path) == 0)
+ gpm_stats_update_info_data (device);
+}
+
+/**
* gpm_stats_add_device:
**/
static void
@@ -1466,6 +1483,9 @@ gpm_stats_add_device (UpDevice *device)
g_object_get (device,
"kind", &kind,
NULL);
+ g_ptr_array_add (devices, g_object_ref (device));
+ g_signal_connect (device, "notify",
+ G_CALLBACK (gpm_stats_device_changed_cb), NULL);
id = up_device_get_object_path (device);
text = gpm_device_kind_to_localised_string (kind, 1);
@@ -1483,7 +1503,7 @@ gpm_stats_add_device (UpDevice *device)
* gpm_stats_data_changed_cb:
**/
static void
-gpm_stats_data_changed_cb (UpClient *client, gpointer user_data)
+gpm_stats_data_changed_cb (UpClient *_client, gpointer user_data)
{
if (g_strcmp0 (current_device, "wakeups") == 0)
gpm_stats_update_wakeups_data ();
@@ -1493,7 +1513,7 @@ gpm_stats_data_changed_cb (UpClient *client, gpointer
user_data)
* gpm_stats_device_added_cb:
**/
static void
-gpm_stats_device_added_cb (UpClient *client, UpDevice *device, gpointer
user_data)
+gpm_stats_device_added_cb (UpClient *_client, UpDevice *device, gpointer
user_data)
{
const gchar *object_path;
object_path = up_device_get_object_path (device);
@@ -1502,32 +1522,25 @@ gpm_stats_device_added_cb (UpClient *client, UpDevice
*device, gpointer user_dat
}
/**
- * gpm_stats_device_changed_cb:
- **/
-static void
-gpm_stats_device_changed_cb (UpClient *client, UpDevice *device, gpointer
user_data)
-{
- const gchar *object_path;
- object_path = up_device_get_object_path (device);
- if (object_path == NULL || current_device == NULL)
- return;
- g_debug ("changed: %s", object_path);
- if (g_strcmp0 (current_device, object_path) == 0)
- gpm_stats_update_info_data (device);
-}
-
-/**
* gpm_stats_device_removed_cb:
**/
static void
-gpm_stats_device_removed_cb (UpClient *client, UpDevice *device, gpointer
user_data)
+gpm_stats_device_removed_cb (UpClient *_client, const gchar *object_path,
gpointer user_data)
{
- const gchar *object_path;
GtkTreeIter iter;
- gchar *id = NULL;
+ UpDevice *device_tmp;
gboolean ret;
+ gchar *id = NULL;
+ guint i;
+
+ for (i = 0; i < devices->len; i++) {
+ device_tmp = g_ptr_array_index (devices, i);
+ if (g_strcmp0 (up_device_get_object_path (device_tmp),
object_path) == 0) {
+ g_ptr_array_remove_index_fast (devices, i);
+ break;
+ }
+ }
- object_path = up_device_get_object_path (device);
g_debug ("removed: %s", object_path);
if (g_strcmp0 (current_device, object_path) == 0) {
gtk_list_store_clear (list_store_info);
@@ -1860,8 +1873,7 @@ gpm_stats_startup_cb (GApplication *application,
GtkWindow *window;
GtkTreeSelection *selection;
gboolean ret;
- UpClient *client;
- GPtrArray *devices;
+ GPtrArray *devices_tmp;
UpDevice *device;
UpDeviceKind kind;
guint i, j;
@@ -1870,6 +1882,9 @@ gpm_stats_startup_cb (GApplication *application,
guint retval;
GError *error = NULL;
+ /* a store of UpDevices */
+ devices = g_ptr_array_new_with_free_func ((GDestroyNotify)
g_object_unref);
+
/* get UI */
builder = gtk_builder_new ();
retval = gtk_builder_add_from_resource (builder,
@@ -2039,18 +2054,14 @@ gpm_stats_startup_cb (GApplication *application,
/* coldplug */
client = up_client_new ();
- ret = up_client_enumerate_devices_sync (client, NULL, NULL);
- if (!ret)
- goto out;
- devices = up_client_get_devices (client);
+ devices_tmp = up_client_get_devices (client);
g_signal_connect (client, "device-added", G_CALLBACK
(gpm_stats_device_added_cb), NULL);
g_signal_connect (client, "device-removed", G_CALLBACK
(gpm_stats_device_removed_cb), NULL);
- g_signal_connect (client, "device-changed", G_CALLBACK
(gpm_stats_device_changed_cb), NULL);
/* add devices in visually pleasing order */
for (j=0; j<UP_DEVICE_KIND_LAST; j++) {
- for (i=0; i < devices->len; i++) {
- device = g_ptr_array_index (devices, i);
+ for (i=0; i < devices_tmp->len; i++) {
+ device = g_ptr_array_index (devices_tmp, i);
g_object_get (device, "kind", &kind, NULL);
if (kind == j)
gpm_stats_add_device (device);
@@ -2079,8 +2090,6 @@ gpm_stats_startup_cb (GApplication *application,
g_object_unref (icon);
}
- g_ptr_array_unref (devices);
-
/* set axis */
widget = GTK_WIDGET (gtk_builder_get_object (builder,
"combobox_history_type"));
gpm_stats_history_type_combo_changed_cb (widget, NULL);
@@ -2089,8 +2098,7 @@ gpm_stats_startup_cb (GApplication *application,
widget = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_stats"));
gtk_widget_show (widget);
-out:
- g_object_unref (client);
+ g_ptr_array_unref (devices_tmp);
}
/**
@@ -2128,6 +2136,10 @@ main (int argc, char *argv[])
/* run */
status = g_application_run (G_APPLICATION (application), argc, argv);
+ if (client != NULL)
+ g_object_unref (client);
+ if (devices != NULL)
+ g_ptr_array_unref (devices);
g_object_unref (settings);
g_object_unref (application);
return status;
--
1.8.4
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]