Hello community,
here is the log from the commit of package upower for openSUSE:Factory checked in at 2019-09-11 10:24:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/upower (Old)
and /work/SRC/openSUSE:Factory/.upower.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "upower"
Wed Sep 11 10:24:58 2019 rev:69 rq:728160 version:0.99.11
Changes:
--------
--- /work/SRC/openSUSE:Factory/upower/upower.changes 2019-03-24 14:56:37.835204412 +0100
+++ /work/SRC/openSUSE:Factory/.upower.new.7948/upower.changes 2019-09-11 10:25:00.259476434 +0200
@@ -1,0 +2,21 @@
+Tue Sep 3 15:31:25 UTC 2019 - Bjørn Lie
+
+- Update to version 0.99.11:
+ + New Features:
+ - Add code of conduct document.
+ - build: Migrate from intltool to gettext.
+ - rules: Split off HID++ udev rules.
+ - Harden systemd service.
+ - Let systemd create /var/lib/upower.
+ - Move D-Bus policy file to /usr/share/dbus-1/system.d/.
+ + Bug fixes:
+ - Fix endless loop burning 100% CPU on keyboard plugout with
+ external backlight.
+ - linux:
+ . Start polling for unknown device batteries too.
+ . Retry to get a battery type if it's unknown.
+ . Don't treat device batteries like laptop batteries.
+ - Replace use of G_TYPE_INSTANCE_GET_PRIVATE and
+ g_type_class_add_private().
+
+-------------------------------------------------------------------
Old:
----
upower-0.99.10.obscpio
New:
----
upower-0.99.11.obscpio
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ upower.spec ++++++
--- /var/tmp/diff_new_pack.XQMna5/_old 2019-09-11 10:25:01.247476311 +0200
+++ /var/tmp/diff_new_pack.XQMna5/_new 2019-09-11 10:25:01.247476311 +0200
@@ -23,7 +23,7 @@
BuildRequires: pkgconfig(udev)
%endif
Name: upower
-Version: 0.99.10
+Version: 0.99.11
Release: 0
Summary: Power Device Enumeration Framework
License: GPL-2.0-or-later
@@ -152,7 +152,7 @@
%endif
%{_udevrulesdir}/*.rules
%{_unitdir}/upower.service
-%config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.UPower.conf
+%{_datadir}/dbus-1/system.d/org.freedesktop.UPower.conf
%{_datadir}/dbus-1/interfaces/org.freedesktop.UPower.xml
%{_datadir}/dbus-1/interfaces/org.freedesktop.UPower.Device.xml
%{_datadir}/dbus-1/interfaces/org.freedesktop.UPower.KbdBacklight.xml
++++++ _service ++++++
--- /var/tmp/diff_new_pack.XQMna5/_old 2019-09-11 10:25:01.263476309 +0200
+++ /var/tmp/diff_new_pack.XQMna5/_new 2019-09-11 10:25:01.263476309 +0200
@@ -2,8 +2,8 @@
<service name="obs_scm" mode="disabled">
<param name="url">https://gitlab.freedesktop.org/upower/upower.git</param>
<param name="scm">git</param>
- <param name="version">0.99.10</param>
- <param name="revision">UPOWER_0_99_10</param>
+ <param name="version">0.99.11</param>
+ <param name="revision">UPOWER_0_99_11</param>
</service>
<service mode="disabled" name="set_version" />
++++++ upower-0.99.10.obscpio -> upower-0.99.11.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/.gitlab-ci.yml new/upower-0.99.11/.gitlab-ci.yml
--- old/upower-0.99.10/.gitlab-ci.yml 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/.gitlab-ci.yml 2019-09-03 08:47:44.000000000 +0200
@@ -1,8 +1,7 @@
image: fedora:rawhide
variables:
- DEPENDENCIES: gettext libtool intltool gtk-doc
- autoconf automake
+ DEPENDENCIES: libtool gtk-doc autoconf automake gettext-devel
gcc redhat-rpm-config gcc-c++ glibc-devel make
systemd sqlite-devel gobject-introspection-devel
libusbx-devel libgudev-devel libimobiledevice-devel
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/NEWS new/upower-0.99.11/NEWS
--- old/upower-0.99.10/NEWS 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/NEWS 2019-09-03 08:47:44.000000000 +0200
@@ -1,3 +1,23 @@
+Version 0.99.11
+~~~~~~~~~~~~~~~
+Released: 2019-09-03
+
+New Features:
+ - Add code of conduct document
+ - build: Migrate from intltool to gettext
+ - rules: Split off HID++ udev rules
+ - Harden systemd service
+ - Let systemd create /var/lib/upower
+ - Move D-Bus policy file to /usr/share/dbus-1/system.d/
+
+Bug fixes:
+ - Fix endless loop burning 100% CPU on keyboard plugout with external
+ backlight
+ - linux: Start polling for unknown device batteries too
+ - linux: Retry to get a battery type if it's unknown
+ - linux: Don't treat device batteries like laptop batteries
+ - Replace use of G_TYPE_INSTANCE_GET_PRIVATE and g_type_class_add_private()
+
Version 0.99.10
~~~~~~~~~~~~~~~
Released: 2019-02-20
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/autogen.sh new/upower-0.99.11/autogen.sh
--- old/upower-0.99.10/autogen.sh 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/autogen.sh 2019-09-03 08:47:44.000000000 +0200
@@ -13,21 +13,14 @@
exit 1
fi
-INTLTOOLIZE=`which intltoolize`
-if test -z $INTLTOOLIZE; then
- echo "*** No intltoolize found, please install the intltool package ***"
- exit 1
-fi
-
GTKDOCIZE=`which gtkdocize`
if test -z $GTKDOCIZE; then
echo "*** No GTK-Doc found, please install it ***"
exit 1
fi
-gtkdocize
-autopoint --force
-AUTOPOINT='intltoolize --automake --copy' autoreconf --force --install --verbose
+gtkdocize --copy || exit 1
+autoreconf --verbose --force --install || exit 1
cd $olddir
test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/code-of-conduct.md new/upower-0.99.11/code-of-conduct.md
--- old/upower-0.99.10/code-of-conduct.md 1970-01-01 01:00:00.000000000 +0100
+++ new/upower-0.99.11/code-of-conduct.md 2019-09-03 08:47:44.000000000 +0200
@@ -0,0 +1,3 @@
+This project and its community follow the [Freedesktop.org code of conduct]
+
+[Freedesktop.org code of conduct]: https://www.freedesktop.org/wiki/CodeOfConduct/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/configure.ac new/upower-0.99.11/configure.ac
--- old/upower-0.99.10/configure.ac 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/configure.ac 2019-09-03 08:47:44.000000000 +0200
@@ -2,7 +2,7 @@
m4_define([up_major_version], [0])
m4_define([up_minor_version], [99])
-m4_define([up_micro_version], [10])
+m4_define([up_micro_version], [11])
m4_define([up_version],
[up_major_version.up_minor_version.up_micro_version])
@@ -152,7 +152,7 @@
[RELRO_LDFLAGS="-Wl,-z,relro,-z,now"])
AC_SUBST([RELRO_LDFLAGS])
-PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.34.0 gobject-2.0])
+PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.38.0 gobject-2.0])
PKG_CHECK_MODULES(GIO, [gio-2.0 >= 2.16.1])
PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0])
@@ -229,9 +229,7 @@
fi
# i18n support
-IT_PROG_INTLTOOL([0.40.0])
-
-AM_GNU_GETTEXT_VERSION([0.17])
+AM_GNU_GETTEXT_VERSION([0.19.8])
AM_GNU_GETTEXT([external])
AC_SUBST([GETTEXT_PACKAGE],[${PACKAGE_TARNAME}])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/dbus/org.freedesktop.UPower.Device.xml new/upower-0.99.11/dbus/org.freedesktop.UPower.Device.xml
--- old/upower-0.99.10/dbus/org.freedesktop.UPower.Device.xml 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/dbus/org.freedesktop.UPower.Device.xml 2019-09-03 08:47:44.000000000 +0200
@@ -336,6 +336,12 @@
doc:term8doc:definitionPhone
+ doc:para
+ If the value is set to "Battery", you will need to verify that the
+ property power-supply
+ has the value "true" before considering it as a laptop battery. Otherwise it
+ will likely be the battery for a device of an unknown type.
+
</property>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/libupower-glib/up-client.c new/upower-0.99.11/libupower-glib/up-client.c
--- old/upower-0.99.10/libupower-glib/up-client.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/libupower-glib/up-client.c 2019-09-03 08:47:44.000000000 +0200
@@ -43,8 +43,6 @@
static void up_client_init (UpClient *client);
static void up_client_finalize (GObject *object);
-#define UP_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_CLIENT, UpClientPrivate))
-
/**
* UpClientPrivate:
*
@@ -73,6 +71,7 @@
static guint signals [UP_CLIENT_LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE_WITH_CODE (UpClient, up_client, G_TYPE_OBJECT,
+ G_ADD_PRIVATE(UpClient)
G_IMPLEMENT_INTERFACE(G_TYPE_INITABLE, up_client_initable_iface_init))
/**
@@ -451,8 +450,6 @@
G_STRUCT_OFFSET (UpClientClass, device_removed),
NULL, NULL, g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1, G_TYPE_STRING);
-
- g_type_class_add_private (klass, sizeof (UpClientPrivate));
}
/*
@@ -463,7 +460,7 @@
up_client_initable_init (GInitable *initable, GCancellable *cancellable, GError **error)
{
UpClient *client = UP_CLIENT (initable);
- client->priv = UP_CLIENT_GET_PRIVATE (client);
+ client->priv = up_client_get_instance_private (client);
/* connect to main interface */
client->priv->proxy = up_exported_daemon_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/libupower-glib/up-device.c new/upower-0.99.11/libupower-glib/up-device.c
--- old/upower-0.99.10/libupower-glib/up-device.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/libupower-glib/up-device.c 2019-09-03 08:47:44.000000000 +0200
@@ -44,8 +44,6 @@
static void up_device_init (UpDevice *device);
static void up_device_finalize (GObject *object);
-#define UP_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE, UpDevicePrivate))
-
/**
* UpDevicePrivate:
*
@@ -94,7 +92,7 @@
PROP_LAST
};
-G_DEFINE_TYPE (UpDevice, up_device, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpDevice, up_device, G_TYPE_OBJECT)
/*
* up_device_changed_cb:
@@ -1202,8 +1200,6 @@
g_param_spec_string ("icon-name",
NULL, NULL, NULL,
G_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (UpDevicePrivate));
}
static void
@@ -1219,7 +1215,7 @@
static void
up_device_init (UpDevice *device)
{
- device->priv = UP_DEVICE_GET_PRIVATE (device);
+ device->priv = up_device_get_instance_private (device);
device->priv->offline_props = g_hash_table_new_full (g_direct_hash,
g_direct_equal,
NULL,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/libupower-glib/up-history-item.c new/upower-0.99.11/libupower-glib/up-history-item.c
--- old/upower-0.99.10/libupower-glib/up-history-item.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/libupower-glib/up-history-item.c 2019-09-03 08:47:44.000000000 +0200
@@ -39,8 +39,6 @@
static void up_history_item_init (UpHistoryItem *history_item);
static void up_history_item_finalize (GObject *object);
-#define UP_HISTORY_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_HISTORY_ITEM, UpHistoryItemPrivate))
-
struct UpHistoryItemPrivate
{
gdouble value;
@@ -56,7 +54,7 @@
PROP_LAST
};
-G_DEFINE_TYPE (UpHistoryItem, up_history_item, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpHistoryItem, up_history_item, G_TYPE_OBJECT)
/**
* up_history_item_set_value:
@@ -321,8 +319,6 @@
0, G_MAXUINT,
UP_DEVICE_STATE_UNKNOWN,
G_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (UpHistoryItemPrivate));
}
/**
@@ -331,7 +327,7 @@
static void
up_history_item_init (UpHistoryItem *history_item)
{
- history_item->priv = UP_HISTORY_ITEM_GET_PRIVATE (history_item);
+ history_item->priv = up_history_item_get_instance_private (history_item);
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/libupower-glib/up-stats-item.c new/upower-0.99.11/libupower-glib/up-stats-item.c
--- old/upower-0.99.10/libupower-glib/up-stats-item.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/libupower-glib/up-stats-item.c 2019-09-03 08:47:44.000000000 +0200
@@ -38,8 +38,6 @@
static void up_stats_item_init (UpStatsItem *stats_item);
static void up_stats_item_finalize (GObject *object);
-#define UP_STATS_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_STATS_ITEM, UpStatsItemPrivate))
-
struct UpStatsItemPrivate
{
gdouble value;
@@ -53,7 +51,7 @@
PROP_LAST
};
-G_DEFINE_TYPE (UpStatsItem, up_stats_item, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpStatsItem, up_stats_item, G_TYPE_OBJECT)
/**
* up_stats_item_set_value:
@@ -193,8 +191,6 @@
g_param_spec_double ("accuracy", NULL, NULL,
0.0, G_MAXDOUBLE, 0.0,
G_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (UpStatsItemPrivate));
}
/**
@@ -204,7 +200,7 @@
static void
up_stats_item_init (UpStatsItem *stats_item)
{
- stats_item->priv = UP_STATS_ITEM_GET_PRIVATE (stats_item);
+ stats_item->priv = up_stats_item_get_instance_private (stats_item);
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/libupower-glib/up-wakeup-item.c new/upower-0.99.11/libupower-glib/up-wakeup-item.c
--- old/upower-0.99.10/libupower-glib/up-wakeup-item.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/libupower-glib/up-wakeup-item.c 2019-09-03 08:47:44.000000000 +0200
@@ -38,8 +38,6 @@
static void up_wakeup_item_init (UpWakeupItem *wakeup_item);
static void up_wakeup_item_finalize (GObject *object);
-#define UP_WAKEUP_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_WAKEUP_ITEM, UpWakeupItemPrivate))
-
struct UpWakeupItemPrivate
{
gboolean is_userspace;
@@ -61,7 +59,7 @@
PROP_LAST
};
-G_DEFINE_TYPE (UpWakeupItem, up_wakeup_item, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpWakeupItem, up_wakeup_item, G_TYPE_OBJECT)
/**
* up_wakeup_item_get_is_userspace:
@@ -409,8 +407,6 @@
g_param_spec_string ("details", NULL, NULL,
NULL,
G_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (UpWakeupItemPrivate));
}
/**
@@ -420,7 +416,7 @@
static void
up_wakeup_item_init (UpWakeupItem *wakeup_item)
{
- wakeup_item->priv = UP_WAKEUP_ITEM_GET_PRIVATE (wakeup_item);
+ wakeup_item->priv = up_wakeup_item_get_instance_private (wakeup_item);
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/libupower-glib/up-wakeups.c new/upower-0.99.11/libupower-glib/up-wakeups.c
--- old/upower-0.99.10/libupower-glib/up-wakeups.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/libupower-glib/up-wakeups.c 2019-09-03 08:47:44.000000000 +0200
@@ -32,8 +32,6 @@
static void up_wakeups_init (UpWakeups *wakeups);
static void up_wakeups_finalize (GObject *object);
-#define UP_WAKEUPS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_WAKEUPS, UpWakeupsPrivate))
-
struct UpWakeupsPrivate
{
UpExportedWakeups *proxy;
@@ -47,7 +45,7 @@
static guint signals [UP_WAKEUPS_LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (UpWakeups, up_wakeups, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpWakeups, up_wakeups, G_TYPE_OBJECT)
/**
* up_wakeups_get_total_sync:
@@ -233,8 +231,6 @@
G_STRUCT_OFFSET (UpWakeupsClass, data_changed),
NULL, NULL, g_cclosure_marshal_VOID__UINT,
G_TYPE_NONE, 1, G_TYPE_UINT);
-
- g_type_class_add_private (klass, sizeof (UpWakeupsPrivate));
}
/**
@@ -245,7 +241,7 @@
{
GError *error = NULL;
- wakeups->priv = UP_WAKEUPS_GET_PRIVATE (wakeups);
+ wakeups->priv = up_wakeups_get_instance_private (wakeups);
/* connect to main interface */
wakeups->priv->proxy = up_exported_wakeups_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/po/Makevars new/upower-0.99.11/po/Makevars
--- old/upower-0.99.10/po/Makevars 1970-01-01 01:00:00.000000000 +0100
+++ new/upower-0.99.11/po/Makevars 2019-09-03 08:47:44.000000000 +0200
@@ -0,0 +1,78 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --add-comments
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = The UPower authors.
+
+# This tells whether or not to prepend "GNU " prefix to the package
+# name that gets inserted into the header of the $(DOMAIN).pot file.
+# Possible values are "yes", "no", or empty. If it is empty, try to
+# detect it automatically by scanning the files in $(top_srcdir) for
+# "GNU packagename" string.
+PACKAGE_GNU = no
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = https://gitlab.freedesktop.org/upower/upower/issues
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
+
+# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
+# context. Possible values are "yes" and "no". Set this to yes if the
+# package uses functions taking also a message context, like pgettext(), or
+# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
+USE_MSGCTXT = yes
+
+# These options get passed to msgmerge.
+# Useful options are in particular:
+# --previous to keep previous msgids of translated messages,
+# --quiet to reduce the verbosity.
+MSGMERGE_OPTIONS =
+
+# These options get passed to msginit.
+# If you want to disable line wrapping when writing PO files, add
+# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
+# MSGINIT_OPTIONS.
+MSGINIT_OPTIONS =
+
+# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
+# has changed. Possible values are "yes" and "no". Set this to no if
+# the POT file is checked in the repository and the version control
+# program ignores timestamps.
+PO_DEPENDS_ON_POT = no
+
+# This tells whether or not to forcibly update $(DOMAIN).pot and
+# regenerate PO files on "make dist". Possible values are "yes" and
+# "no". Set this to no if the POT file and PO files are maintained
+# externally.
+DIST_DEPENDS_ON_UPDATE_PO = no
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/po/POTFILES.in new/upower-0.99.11/po/POTFILES.in
--- old/upower-0.99.10/po/POTFILES.in 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/po/POTFILES.in 2019-09-03 08:47:44.000000000 +0200
@@ -1,5 +1,4 @@
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
-[encoding: UTF-8]
src/up-main.c
tools/up-tool.c
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/rules/95-upower-csr.rules new/upower-0.99.11/rules/95-upower-csr.rules
--- old/upower-0.99.10/rules/95-upower-csr.rules 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/rules/95-upower-csr.rules 2019-09-03 08:47:44.000000000 +0200
@@ -19,17 +19,3 @@
ATTR{idVendor}=="046d", ATTR{idProduct}=="c702", ENV{UPOWER_PRODUCT}="Presenter", ENV{UPOWER_BATTERY_TYPE}="mouse"
LABEL="up_csr_end"
-
-# Unifying HID++ devices
-SUBSYSTEM!="hid", GOTO="up_unifying_end"
-# Kernel provides the battery information already
-ATTRS{idVendor}=="046d", TEST=="builtin_power_supply", GOTO="up_unifying_end"
-ATTRS{idVendor}=="046d", ENV{UPOWER_VENDOR}="Logitech, Inc."
-ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c52b", DRIVER=="logitech-djdevice", ENV{UPOWER_BATTERY_TYPE}="unifying"
-ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c532", DRIVER=="logitech-djdevice", ENV{UPOWER_BATTERY_TYPE}="unifying"
-# These devices bind to the hid-logitech-hidpp module since Linux 3.19
-ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c52b", DRIVER=="logitech-hidpp-device", ENV{UPOWER_BATTERY_TYPE}="unifying"
-ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c532", DRIVER=="logitech-hidpp-device", ENV{UPOWER_BATTERY_TYPE}="unifying"
-ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c52f", ENV{UPOWER_BATTERY_TYPE}="lg-wireless"
-ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c531", ENV{UPOWER_BATTERY_TYPE}="lg-wireless"
-LABEL="up_unifying_end"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/rules/95-upower-hidpp.rules new/upower-0.99.11/rules/95-upower-hidpp.rules
--- old/upower-0.99.10/rules/95-upower-hidpp.rules 1970-01-01 01:00:00.000000000 +0100
+++ new/upower-0.99.11/rules/95-upower-hidpp.rules 2019-09-03 08:47:44.000000000 +0200
@@ -0,0 +1,9 @@
+##############################################################################################################
+# Unifying HID++ devices
+SUBSYSTEM!="hid", GOTO="up_unifying_end"
+# Kernel provides the battery information already
+ATTRS{idVendor}=="046d", TEST=="builtin_power_supply", GOTO="up_unifying_end"
+ATTRS{idVendor}=="046d", ENV{UPOWER_VENDOR}="Logitech, Inc."
+ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c52f", ENV{UPOWER_BATTERY_TYPE}="lg-wireless"
+ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c531", ENV{UPOWER_BATTERY_TYPE}="lg-wireless"
+LABEL="up_unifying_end"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/rules/Makefile.am new/upower-0.99.11/rules/Makefile.am
--- old/upower-0.99.10/rules/Makefile.am 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/rules/Makefile.am 2019-09-03 08:47:44.000000000 +0200
@@ -3,7 +3,8 @@
udevrules_DATA = \
95-upower-wup.rules \
95-upower-hid.rules \
- 95-upower-csr.rules
+ 95-upower-csr.rules \
+ 95-upower-hidpp.rules
EXTRA_DIST = \
$(udevrules_DATA)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/Makefile.am new/upower-0.99.11/src/Makefile.am
--- old/upower-0.99.10/src/Makefile.am 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/Makefile.am 2019-09-03 08:47:44.000000000 +0200
@@ -163,7 +163,7 @@
$(dbusservice_DATA): $(dbusservice_in_files) Makefile
@sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
-dbusconfdir = $(sysconfdir)/dbus-1/system.d
+dbusconfdir = $(datadir)/dbus-1/system.d
dbusconf_in_files = org.freedesktop.UPower.conf.in
dbusconf_DATA = $(dbusconf_in_files:.conf.in=.conf)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/dummy/up-backend.c new/upower-0.99.11/src/dummy/up-backend.c
--- old/upower-0.99.10/src/dummy/up-backend.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/dummy/up-backend.c 2019-09-03 08:47:44.000000000 +0200
@@ -35,8 +35,6 @@
static void up_backend_init (UpBackend *backend);
static void up_backend_finalize (GObject *object);
-#define UP_BACKEND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_BACKEND, UpBackendPrivate))
-
struct UpBackendPrivate
{
UpDaemon *daemon;
@@ -57,7 +55,7 @@
static guint signals [SIGNAL_LAST] = { 0 };
-G_DEFINE_TYPE (UpBackend, up_backend, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpBackend, up_backend, G_TYPE_OBJECT)
#ifdef EGG_TEST
/**
@@ -194,8 +192,6 @@
G_STRUCT_OFFSET (UpBackendClass, device_removed),
NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
-
- g_type_class_add_private (klass, sizeof (UpBackendPrivate));
}
/**
@@ -204,7 +200,7 @@
static void
up_backend_init (UpBackend *backend)
{
- backend->priv = UP_BACKEND_GET_PRIVATE (backend);
+ backend->priv = up_backend_get_instance_private (backend);
backend->priv->daemon = NULL;
backend->priv->device_list = NULL;
#ifdef EGG_TEST
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/freebsd/up-backend.c new/upower-0.99.11/src/freebsd/up-backend.c
--- old/upower-0.99.10/src/freebsd/up-backend.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/freebsd/up-backend.c 2019-09-03 08:47:44.000000000 +0200
@@ -54,8 +54,6 @@
static gboolean up_backend_create_new_device (UpBackend *backend, UpAcpiNative *native);
static void up_backend_lid_coldplug (UpBackend *backend);
-#define UP_BACKEND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_BACKEND, UpBackendPrivate))
-
struct UpBackendPrivate
{
UpDaemon *daemon;
@@ -74,7 +72,7 @@
static guint signals [SIGNAL_LAST] = { 0 };
-G_DEFINE_TYPE (UpBackend, up_backend, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpBackend, up_backend, G_TYPE_OBJECT)
static const gchar *handlers[] = {
"battery",
@@ -404,8 +402,6 @@
G_STRUCT_OFFSET (UpBackendClass, device_removed),
NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
-
- g_type_class_add_private (klass, sizeof (UpBackendPrivate));
}
/**
@@ -414,7 +410,7 @@
static void
up_backend_init (UpBackend *backend)
{
- backend->priv = UP_BACKEND_GET_PRIVATE (backend);
+ backend->priv = up_backend_get_instance_private (backend);
backend->priv->handle_map = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) g_object_unref);
backend->priv->config = up_config_new ();
backend->priv->seat_manager_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/linux/hidpp-device.c new/upower-0.99.11/src/linux/hidpp-device.c
--- old/upower-0.99.10/src/linux/hidpp-device.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/linux/hidpp-device.c 2019-09-03 08:47:44.000000000 +0200
@@ -163,8 +163,7 @@
gchar *name;
} HidppDeviceMap;
-G_DEFINE_TYPE (HidppDevice, hidpp_device, G_TYPE_OBJECT)
-#define HIDPP_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), HIDPP_TYPE_DEVICE, HidppDevicePrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (HidppDevice, hidpp_device, G_TYPE_OBJECT)
/**
* hidpp_is_error:
@@ -1033,7 +1032,7 @@
{
HidppDeviceMap *map;
- device->priv = HIDPP_DEVICE_GET_PRIVATE (device);
+ device->priv = hidpp_device_get_instance_private (device);
device->priv->fd = -1;
device->priv->feature_index = g_ptr_array_new_with_free_func (hidpp_device_free_feature);
device->priv->batt_status = HIDPP_DEVICE_BATT_STATUS_UNKNOWN;
@@ -1089,7 +1088,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = hidpp_device_finalize;
- g_type_class_add_private (klass, sizeof (HidppDevicePrivate));
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/linux/integration-test new/upower-0.99.11/src/linux/integration-test
--- old/upower-0.99.10/src/linux/integration-test 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/linux/integration-test 2019-09-03 08:47:44.000000000 +0200
@@ -85,7 +85,8 @@
UP_DEVICE_KIND_PHONE,
UP_DEVICE_KIND_MEDIA_PLAYER,
UP_DEVICE_KIND_TABLET,
- UP_DEVICE_KIND_COMPUTER) = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
+ UP_DEVICE_KIND_COMPUTER,
+ UP_DEVICE_KIND_GAMING_INPUT) = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
class Tests(dbusmock.DBusTestCase):
@classmethod
@@ -331,7 +332,7 @@
self.assertEqual(self.get_dbus_property('OnBattery'), False)
self.assertEqual(self.get_dbus_display_property('WarningLevel'), UP_DEVICE_LEVEL_NONE)
self.assertEqual(self.get_dbus_dev_property(ac_up, 'PowerSupply'), True)
- self.assertEqual(self.get_dbus_dev_property(ac_up, 'Type'), 1)
+ self.assertEqual(self.get_dbus_dev_property(ac_up, 'Type'), UP_DEVICE_KIND_LINE_POWER)
self.assertEqual(self.get_dbus_dev_property(ac_up, 'Online'), True)
self.assertEqual(self.get_dbus_dev_property(ac_up, 'NativePath'), 'AC')
self.stop_daemon()
@@ -429,7 +430,7 @@
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'State'), UP_DEVICE_STATE_DISCHARGING)
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Percentage'), 2.5)
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'PowerSupply'), True)
- self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Type'), 2)
+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Type'), UP_DEVICE_KIND_BATTERY)
self.stop_daemon()
# now connect AC again
@@ -707,7 +708,7 @@
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'EnergyFullDesign'), 132.0)
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Voltage'), 12.0)
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'PowerSupply'), True)
- self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Type'), 2)
+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Type'), UP_DEVICE_KIND_BATTERY)
self.assertEqual(self.get_dbus_property('OnBattery'), True)
self.assertEqual(self.get_dbus_display_property('WarningLevel'), UP_DEVICE_LEVEL_NONE)
@@ -744,7 +745,7 @@
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'EnergyFullDesign'), 132.0)
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Voltage'), 12.0)
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'PowerSupply'), True)
- self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Type'), 2)
+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Type'), UP_DEVICE_KIND_BATTERY)
# capacity_level is unused because a 'capacity' attribute is present and used instead
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'BatteryLevel'), UP_DEVICE_LEVEL_NONE)
self.stop_daemon()
@@ -811,7 +812,7 @@
self.assertEqual(self.get_dbus_dev_property(ups0_up, 'Percentage'), 70.0)
self.assertEqual(self.get_dbus_dev_property(ups0_up, 'State'), UP_DEVICE_STATE_CHARGING)
self.assertEqual(self.get_dbus_dev_property(ups0_up, 'PowerSupply'), True)
- self.assertEqual(self.get_dbus_dev_property(ups0_up, 'Type'), 3)
+ self.assertEqual(self.get_dbus_dev_property(ups0_up, 'Type'), UP_DEVICE_KIND_UPS)
self.assertEqual(self.get_dbus_property('OnBattery'), False)
self.assertEqual(self.get_dbus_display_property('WarningLevel'), UP_DEVICE_LEVEL_NONE)
@@ -1222,11 +1223,59 @@
self.assertEqual(self.get_dbus_dev_property(joypadbat0_up, 'Model'), 'Sony Interactive Entertainment Wireless Controller')
self.assertEqual(self.get_dbus_dev_property(joypadbat0_up, 'Serial'), 'ff:ff:ff:ff:ff:ff')
self.assertEqual(self.get_dbus_dev_property(joypadbat0_up, 'PowerSupply'), False)
- # 12 == gaming input
- self.assertEqual(self.get_dbus_dev_property(joypadbat0_up, 'Type'), 12)
+ self.assertEqual(self.get_dbus_dev_property(joypadbat0_up, 'Type'), UP_DEVICE_KIND_GAMING_INPUT)
self.assertEqual(self.get_dbus_property('OnBattery'), False)
self.assertEqual(self.get_dbus_display_property('WarningLevel'), UP_DEVICE_LEVEL_NONE)
+ def test_hidpp_touchpad_race(self):
+ '''HID++ touchpad with input node that appears later'''
+
+ dev = self.testbed.add_device('hid',
+ '/devices/pci0000:00/0000:00:14.0/usb3/3-10/3-10:1.2/0003:046D:C52B.0009/0003:046D:4101.000A',
+ None,
+ [], [])
+
+ parent = dev
+ batt_dev = self.testbed.add_device(
+ 'power_supply',
+ '/devices/pci0000:00/0000:00:14.0/usb3/3-10/3-10:1.2/0003:046D:C52B.0009/0003:046D:4101.000A/power_supply/hidpp_battery_3',
+ parent,
+ ['type', 'Battery',
+ 'scope', 'Device',
+ 'present', '1',
+ 'online', '1',
+ 'status', 'Discharging',
+ 'capacity_level', 'Full\n',
+ 'serial_number', '123456',
+ 'model_name', 'Logitech T650'],
+ [])
+
+ self.start_daemon()
+ devs = self.proxy.EnumerateDevices()
+ self.assertEqual(len(devs), 1)
+ mousebat0_up = devs[0]
+
+ self.assertEqual(self.get_dbus_dev_property(mousebat0_up, 'Model'), 'Logitech T650')
+ self.assertEqual(self.get_dbus_dev_property(mousebat0_up, 'PowerSupply'), False)
+ self.assertEqual(self.get_dbus_dev_property(mousebat0_up, 'Type'), UP_DEVICE_KIND_BATTERY)
+ self.assertEqual(self.get_dbus_dev_property(mousebat0_up, 'Serial'), '123456')
+ self.assertEqual(self.get_dbus_property('OnBattery'), False)
+ self.assertEqual(self.get_dbus_display_property('WarningLevel'), UP_DEVICE_LEVEL_NONE)
+
+ # Now test all the levels
+ self.assertEqual(self.get_dbus_dev_property(mousebat0_up, 'Percentage'), 100)
+ self.assertEqual(self.get_dbus_dev_property(mousebat0_up, 'BatteryLevel'), UP_DEVICE_LEVEL_FULL)
+
+ self.testbed.add_device(
+ 'input',
+ '/devices/pci0000:00/0000:00:14.0/usb3/3-10/3-10:1.2/0003:046D:C52B.0009/0003:046D:4101.000A/input/input22',
+ parent,
+ [], ['DEVNAME', 'input/mouse3', 'ID_INPUT_TOUCHPAD', '1'])
+ self.testbed.uevent(batt_dev, 'change')
+
+ time.sleep(0.5)
+ self.assertEqual(self.get_dbus_dev_property(mousebat0_up, 'Type'), UP_DEVICE_KIND_MOUSE)
+
def test_hidpp_touchpad(self):
'''HID++ touchpad battery with 5 capacity levels'''
@@ -1263,8 +1312,7 @@
self.assertEqual(self.get_dbus_dev_property(mousebat0_up, 'Model'), 'Logitech T650')
self.assertEqual(self.get_dbus_dev_property(mousebat0_up, 'PowerSupply'), False)
- # 5 == mouse
- self.assertEqual(self.get_dbus_dev_property(mousebat0_up, 'Type'), 5)
+ self.assertEqual(self.get_dbus_dev_property(mousebat0_up, 'Type'), UP_DEVICE_KIND_MOUSE)
self.assertEqual(self.get_dbus_dev_property(mousebat0_up, 'Serial'), '123456')
self.assertEqual(self.get_dbus_property('OnBattery'), False)
self.assertEqual(self.get_dbus_display_property('WarningLevel'), UP_DEVICE_LEVEL_NONE)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/linux/up-backend.c new/upower-0.99.11/src/linux/up-backend.c
--- old/upower-0.99.10/src/linux/up-backend.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/linux/up-backend.c 2019-09-03 08:47:44.000000000 +0200
@@ -57,8 +57,6 @@
#define LOGIND_DBUS_PATH "/org/freedesktop/login1"
#define LOGIND_DBUS_INTERFACE "org.freedesktop.login1.Manager"
-#define UP_BACKEND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_BACKEND, UpBackendPrivate))
-
struct UpBackendPrivate
{
UpDaemon *daemon;
@@ -83,7 +81,7 @@
static guint signals [SIGNAL_LAST] = { 0 };
-G_DEFINE_TYPE (UpBackend, up_backend, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpBackend, up_backend, G_TYPE_OBJECT)
static gboolean up_backend_device_add (UpBackend *backend, GUdevDevice *native);
static void up_backend_device_remove (UpBackend *backend, GUdevDevice *native);
@@ -805,8 +803,6 @@
G_STRUCT_OFFSET (UpBackendClass, device_removed),
NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
-
- g_type_class_add_private (klass, sizeof (UpBackendPrivate));
}
static void
@@ -815,7 +811,7 @@
GDBusConnection *bus;
guint sleep_id;
- backend->priv = UP_BACKEND_GET_PRIVATE (backend);
+ backend->priv = up_backend_get_instance_private (backend);
backend->priv->config = up_config_new ();
backend->priv->managed_devices = up_device_list_new ();
backend->priv->logind_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/linux/up-device-bluez.c new/upower-0.99.11/src/linux/up-device-bluez.c
--- old/upower-0.99.10/src/linux/up-device-bluez.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/linux/up-device-bluez.c 2019-09-03 08:47:44.000000000 +0200
@@ -28,7 +28,6 @@
#include "up-device-bluez.h"
G_DEFINE_TYPE (UpDeviceBluez, up_device_bluez, UP_TYPE_DEVICE)
-#define UP_DEVICE_BLUEZ_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_BLUEZ, UpDeviceBluezPrivate))
static UpDeviceKind
appearance_to_kind (guint16 appearance)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/linux/up-device-csr.c new/upower-0.99.11/src/linux/up-device-csr.c
--- old/upower-0.99.10/src/linux/up-device-csr.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/linux/up-device-csr.c 2019-09-03 08:47:44.000000000 +0200
@@ -60,8 +60,7 @@
libusb_device *device;
};
-G_DEFINE_TYPE (UpDeviceCsr, up_device_csr, UP_TYPE_DEVICE)
-#define UP_DEVICE_CSR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_CSR, UpDeviceCsrPrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceCsr, up_device_csr, UP_TYPE_DEVICE)
static gboolean up_device_csr_refresh (UpDevice *device);
@@ -291,7 +290,7 @@
up_device_csr_init (UpDeviceCsr *csr)
{
gint retval;
- csr->priv = UP_DEVICE_CSR_GET_PRIVATE (csr);
+ csr->priv = up_device_csr_get_instance_private (csr);
csr->priv->raw_value = -1;
retval = libusb_init (&csr->priv->ctx);
@@ -332,8 +331,6 @@
object_class->finalize = up_device_csr_finalize;
device_class->coldplug = up_device_csr_coldplug;
device_class->refresh = up_device_csr_refresh;
-
- g_type_class_add_private (klass, sizeof (UpDeviceCsrPrivate));
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/linux/up-device-hid.c new/upower-0.99.11/src/linux/up-device-hid.c
--- old/upower-0.99.10/src/linux/up-device-hid.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/linux/up-device-hid.c 2019-09-03 08:47:44.000000000 +0200
@@ -90,8 +90,7 @@
int fd;
};
-G_DEFINE_TYPE (UpDeviceHid, up_device_hid, UP_TYPE_DEVICE)
-#define UP_DEVICE_HID_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_HID, UpDeviceHidPrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceHid, up_device_hid, UP_TYPE_DEVICE)
static gboolean up_device_hid_refresh (UpDevice *device);
@@ -470,7 +469,7 @@
static void
up_device_hid_init (UpDeviceHid *hid)
{
- hid->priv = UP_DEVICE_HID_GET_PRIVATE (hid);
+ hid->priv = up_device_hid_get_instance_private (hid);
hid->priv->fd = -1;
hid->priv->poll_timer_id = g_timeout_add_seconds (UP_DEVICE_HID_REFRESH_TIMEOUT,
(GSourceFunc) up_device_hid_poll, hid);
@@ -512,8 +511,6 @@
device_class->coldplug = up_device_hid_coldplug;
device_class->get_on_battery = up_device_hid_get_on_battery;
device_class->refresh = up_device_hid_refresh;
-
- g_type_class_add_private (klass, sizeof (UpDeviceHidPrivate));
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/linux/up-device-idevice.c new/upower-0.99.11/src/linux/up-device-idevice.c
--- old/upower-0.99.10/src/linux/up-device-idevice.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/linux/up-device-idevice.c 2019-09-03 08:47:44.000000000 +0200
@@ -48,8 +48,7 @@
lockdownd_client_t client;
};
-G_DEFINE_TYPE (UpDeviceIdevice, up_device_idevice, UP_TYPE_DEVICE)
-#define UP_DEVICE_IDEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_IDEVICE, UpDeviceIdevicePrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceIdevice, up_device_idevice, UP_TYPE_DEVICE)
static gboolean up_device_idevice_refresh (UpDevice *device);
@@ -347,7 +346,7 @@
static void
up_device_idevice_init (UpDeviceIdevice *idevice)
{
- idevice->priv = UP_DEVICE_IDEVICE_GET_PRIVATE (idevice);
+ idevice->priv = up_device_idevice_get_instance_private (idevice);
}
/**
@@ -390,8 +389,6 @@
object_class->finalize = up_device_idevice_finalize;
device_class->coldplug = up_device_idevice_coldplug;
device_class->refresh = up_device_idevice_refresh;
-
- g_type_class_add_private (klass, sizeof (UpDeviceIdevicePrivate));
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/linux/up-device-supply.c new/upower-0.99.11/src/linux/up-device-supply.c
--- old/upower-0.99.10/src/linux/up-device-supply.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/linux/up-device-supply.c 2019-09-03 08:47:44.000000000 +0200
@@ -70,12 +70,13 @@
gboolean shown_invalid_voltage_warning;
};
-G_DEFINE_TYPE (UpDeviceSupply, up_device_supply, UP_TYPE_DEVICE)
-#define UP_DEVICE_SUPPLY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_SUPPLY, UpDeviceSupplyPrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceSupply, up_device_supply, UP_TYPE_DEVICE)
static gboolean up_device_supply_refresh (UpDevice *device);
static void up_device_supply_setup_unknown_poll (UpDevice *device,
UpDeviceState state);
+static UpDeviceKind up_device_supply_guess_type (GUdevDevice *native,
+ const char *native_path);
static RefreshResult
up_device_supply_refresh_line_power (UpDeviceSupply *supply)
@@ -919,10 +920,19 @@
GUdevDevice *native;
gdouble percentage = 0.0f;
UpDeviceLevel level = UP_DEVICE_LEVEL_NONE;
+ UpDeviceKind type;
native = G_UDEV_DEVICE (up_device_get_native (device));
native_path = g_udev_device_get_sysfs_path (native);
+ /* Try getting a more precise type again */
+ g_object_get (device, "type", &type, NULL);
+ if (type == UP_DEVICE_KIND_BATTERY) {
+ type = up_device_supply_guess_type (native, native_path);
+ if (type != UP_DEVICE_KIND_BATTERY)
+ g_object_set (device, "type", type, NULL);
+ }
+
/* initial values */
if (!supply->priv->has_coldplug_values) {
gchar *model_name;
@@ -1133,7 +1143,7 @@
type != UP_DEVICE_KIND_BATTERY)
up_daemon_start_poll (G_OBJECT (device), (GSourceFunc) up_device_supply_refresh);
else if (type == UP_DEVICE_KIND_BATTERY &&
- !supply->priv->disable_battery_poll)
+ (!supply->priv->disable_battery_poll || !supply->priv->is_power_supply))
up_daemon_start_poll (G_OBJECT (device), (GSourceFunc) up_device_supply_refresh);
/* coldplug values */
@@ -1193,17 +1203,14 @@
UpDeviceState state;
g_object_get (device, "type", &type, NULL);
- switch (type) {
- case UP_DEVICE_KIND_LINE_POWER:
+ if (type == UP_DEVICE_KIND_LINE_POWER) {
ret = up_device_supply_refresh_line_power (supply);
- break;
- case UP_DEVICE_KIND_BATTERY:
+ } else if (type == UP_DEVICE_KIND_BATTERY &&
+ supply->priv->is_power_supply) {
up_device_supply_disable_unknown_poll (device);
ret = up_device_supply_refresh_battery (supply, &state);
- break;
- default:
+ } else {
ret = up_device_supply_refresh_device (supply, &state);
- break;
}
/* reset time if we got new data */
@@ -1221,7 +1228,7 @@
{
UpConfig *config;
- supply->priv = UP_DEVICE_SUPPLY_GET_PRIVATE (supply);
+ supply->priv = up_device_supply_get_instance_private (supply);
/* allocate the stats for the battery charging & discharging */
supply->priv->energy_old = g_new (gdouble, UP_DEVICE_SUPPLY_ENERGY_OLD_LENGTH);
@@ -1276,8 +1283,6 @@
device_class->get_online = up_device_supply_get_online;
device_class->coldplug = up_device_supply_coldplug;
device_class->refresh = up_device_supply_refresh;
-
- g_type_class_add_private (klass, sizeof (UpDeviceSupplyPrivate));
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/linux/up-device-unifying.c new/upower-0.99.11/src/linux/up-device-unifying.c
--- old/upower-0.99.10/src/linux/up-device-unifying.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/linux/up-device-unifying.c 2019-09-03 08:47:44.000000000 +0200
@@ -35,8 +35,7 @@
HidppDevice *hidpp_device;
};
-G_DEFINE_TYPE (UpDeviceUnifying, up_device_unifying, UP_TYPE_DEVICE)
-#define UP_DEVICE_UNIFYING_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_UNIFYING, UpDeviceUnifyingPrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceUnifying, up_device_unifying, UP_TYPE_DEVICE)
/**
* up_device_unifying_refresh:
@@ -300,7 +299,7 @@
static void
up_device_unifying_init (UpDeviceUnifying *unifying)
{
- unifying->priv = UP_DEVICE_UNIFYING_GET_PRIVATE (unifying);
+ unifying->priv = up_device_unifying_get_instance_private (unifying);
}
/**
@@ -335,8 +334,6 @@
object_class->finalize = up_device_unifying_finalize;
device_class->coldplug = up_device_unifying_coldplug;
device_class->refresh = up_device_unifying_refresh;
-
- g_type_class_add_private (klass, sizeof (UpDeviceUnifyingPrivate));
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/linux/up-device-wup.c new/upower-0.99.11/src/linux/up-device-wup.c
--- old/upower-0.99.10/src/linux/up-device-wup.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/linux/up-device-wup.c 2019-09-03 08:47:44.000000000 +0200
@@ -72,8 +72,7 @@
int fd;
};
-G_DEFINE_TYPE (UpDeviceWup, up_device_wup, UP_TYPE_DEVICE)
-#define UP_DEVICE_WUP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_WUP, UpDeviceWupPrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceWup, up_device_wup, UP_TYPE_DEVICE)
static gboolean up_device_wup_refresh (UpDevice *device);
@@ -420,7 +419,7 @@
static void
up_device_wup_init (UpDeviceWup *wup)
{
- wup->priv = UP_DEVICE_WUP_GET_PRIVATE (wup);
+ wup->priv = up_device_wup_get_instance_private (wup);
wup->priv->fd = -1;
wup->priv->poll_timer_id = g_timeout_add_seconds (UP_DEVICE_WUP_REFRESH_TIMEOUT,
(GSourceFunc) up_device_wup_poll_cb, wup);
@@ -461,8 +460,6 @@
object_class->finalize = up_device_wup_finalize;
device_class->coldplug = up_device_wup_coldplug;
device_class->refresh = up_device_wup_refresh;
-
- g_type_class_add_private (klass, sizeof (UpDeviceWupPrivate));
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/linux/up-input.c new/upower-0.99.11/src/linux/up-input.c
--- old/upower-0.99.10/src/linux/up-input.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/linux/up-input.c 2019-09-03 08:47:44.000000000 +0200
@@ -54,8 +54,7 @@
UpDaemon *daemon;
};
-G_DEFINE_TYPE (UpInput, up_input, G_TYPE_OBJECT)
-#define UP_INPUT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_INPUT, UpInputPrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (UpInput, up_input, G_TYPE_OBJECT)
/* we must use this kernel-compatible implementation */
#define BITS_PER_LONG (sizeof(long) * 8)
@@ -267,7 +266,7 @@
static void
up_input_init (UpInput *input)
{
- input->priv = UP_INPUT_GET_PRIVATE (input);
+ input->priv = up_input_get_instance_private (input);
input->priv->eventfp = -1;
}
@@ -304,7 +303,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = up_input_finalize;
- g_type_class_add_private (klass, sizeof (UpInputPrivate));
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/openbsd/up-backend.c new/upower-0.99.11/src/openbsd/up-backend.c
--- old/upower-0.99.10/src/openbsd/up-backend.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/openbsd/up-backend.c 2019-09-03 08:47:44.000000000 +0200
@@ -39,8 +39,6 @@
static gboolean up_apm_device_get_online (UpDevice *device, gboolean *online);
static gboolean up_apm_device_refresh (UpDevice *device);
-#define UP_BACKEND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_BACKEND, UpBackendPrivate))
-
struct UpBackendPrivate
{
UpDaemon *daemon;
@@ -60,7 +58,7 @@
static guint signals [SIGNAL_LAST] = { 0 };
-G_DEFINE_TYPE (UpBackend, up_backend, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpBackend, up_backend, G_TYPE_OBJECT)
/**
* functions called by upower daemon
@@ -585,8 +583,6 @@
G_STRUCT_OFFSET (UpBackendClass, device_removed),
NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
-
- g_type_class_add_private (klass, sizeof (UpBackendPrivate));
}
/**
@@ -599,7 +595,7 @@
UpDeviceClass *device_class;
gint64 current_time;
- backend->priv = UP_BACKEND_GET_PRIVATE (backend);
+ backend->priv = up_backend_get_instance_private (backend);
backend->priv->is_laptop = up_native_is_laptop();
g_debug("is_laptop:%d",backend->priv->is_laptop);
if (backend->priv->is_laptop)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/up-config.c new/upower-0.99.11/src/up-config.c
--- old/upower-0.99.10/src/up-config.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/up-config.c 2019-09-03 08:47:44.000000000 +0200
@@ -28,8 +28,6 @@
static void up_config_finalize (GObject *object);
-#define UP_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_CONFIG, UpConfigPrivate))
-
/**
* UpConfigPrivate:
*
@@ -40,7 +38,7 @@
GKeyFile *keyfile;
};
-G_DEFINE_TYPE (UpConfig, up_config, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpConfig, up_config, G_TYPE_OBJECT)
static gpointer up_config_object = NULL;
@@ -88,7 +86,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = up_config_finalize;
- g_type_class_add_private (klass, sizeof (UpConfigPrivate));
}
/**
@@ -101,7 +98,7 @@
GError *error = NULL;
gchar *filename;
- config->priv = UP_CONFIG_GET_PRIVATE (config);
+ config->priv = up_config_get_instance_private (config);
config->priv->keyfile = g_key_file_new ();
filename = g_strdup (g_getenv ("UPOWER_CONF_FILE_NAME"));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/up-daemon.c new/upower-0.99.11/src/up-daemon.c
--- old/upower-0.99.10/src/up-daemon.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/up-daemon.c 2019-09-03 08:47:44.000000000 +0200
@@ -76,9 +76,7 @@
static gboolean up_daemon_get_warning_level_local(UpDaemon *daemon);
static gboolean up_daemon_get_on_ac_local (UpDaemon *daemon);
-G_DEFINE_TYPE (UpDaemon, up_daemon, UP_TYPE_EXPORTED_DAEMON_SKELETON)
-
-#define UP_DAEMON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DAEMON, UpDaemonPrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (UpDaemon, up_daemon, UP_TYPE_EXPORTED_DAEMON_SKELETON)
#define UP_DAEMON_ACTION_DELAY 20 /* seconds */
#define UP_INTERFACE_PREFIX "org.freedesktop.UPower."
@@ -1082,7 +1080,7 @@
static void
up_daemon_init (UpDaemon *daemon)
{
- daemon->priv = UP_DAEMON_GET_PRIVATE (daemon);
+ daemon->priv = up_daemon_get_instance_private (daemon);
daemon->priv->config = up_config_new ();
daemon->priv->power_devices = up_device_list_new ();
daemon->priv->display_device = up_device_new ();
@@ -1141,8 +1139,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = up_daemon_finalize;
-
- g_type_class_add_private (klass, sizeof (UpDaemonPrivate));
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/up-device-list.c new/upower-0.99.11/src/up-device-list.c
--- old/upower-0.99.10/src/up-device-list.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/up-device-list.c 2019-09-03 08:47:44.000000000 +0200
@@ -30,15 +30,13 @@
static void up_device_list_finalize (GObject *object);
-#define UP_DEVICE_LIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_LIST, UpDeviceListPrivate))
-
struct UpDeviceListPrivate
{
GPtrArray *array;
GHashTable *map_native_path_to_device;
};
-G_DEFINE_TYPE (UpDeviceList, up_device_list, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceList, up_device_list, G_TYPE_OBJECT)
/**
* up_device_list_lookup:
@@ -183,7 +181,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = up_device_list_finalize;
- g_type_class_add_private (klass, sizeof (UpDeviceListPrivate));
}
/**
@@ -193,7 +190,7 @@
static void
up_device_list_init (UpDeviceList *list)
{
- list->priv = UP_DEVICE_LIST_GET_PRIVATE (list);
+ list->priv = up_device_list_get_instance_private (list);
list->priv->array = g_ptr_array_new_with_free_func (g_object_unref);
list->priv->map_native_path_to_device = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/up-device.c new/upower-0.99.11/src/up-device.c
--- old/upower-0.99.10/src/up-device.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/up-device.c 2019-09-03 08:47:44.000000000 +0200
@@ -44,8 +44,7 @@
gboolean has_ever_refresh;
};
-G_DEFINE_TYPE (UpDevice, up_device, UP_TYPE_EXPORTED_DEVICE_SKELETON)
-#define UP_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE, UpDevicePrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (UpDevice, up_device, UP_TYPE_EXPORTED_DEVICE_SKELETON)
#define UP_DEVICES_DBUS_PATH "/org/freedesktop/UPower/devices"
@@ -711,7 +710,7 @@
{
UpExportedDevice *skeleton;
- device->priv = UP_DEVICE_GET_PRIVATE (device);
+ device->priv = up_device_get_instance_private (device);
device->priv->history = up_history_new ();
skeleton = UP_EXPORTED_DEVICE (device);
@@ -754,8 +753,6 @@
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->notify = up_device_notify;
object_class->finalize = up_device_finalize;
-
- g_type_class_add_private (klass, sizeof (UpDevicePrivate));
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/up-history.c new/upower-0.99.11/src/up-history.c
--- old/upower-0.99.10/src/up-history.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/up-history.c 2019-09-03 08:47:44.000000000 +0200
@@ -33,8 +33,6 @@
static void up_history_finalize (GObject *object);
-#define UP_HISTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_HISTORY, UpHistoryPrivate))
-
#define UP_HISTORY_FILE_HEADER "PackageKit Profile"
#define UP_HISTORY_SAVE_INTERVAL (10*60) /* seconds */
#define UP_HISTORY_DEFAULT_MAX_DATA_AGE (7*24*60*60) /* seconds */
@@ -61,7 +59,7 @@
UP_HISTORY_LAST_SIGNAL
};
-G_DEFINE_TYPE (UpHistory, up_history, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (UpHistory, up_history, G_TYPE_OBJECT)
/**
* up_history_set_max_data_age:
@@ -874,7 +872,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = up_history_finalize;
- g_type_class_add_private (klass, sizeof (UpHistoryPrivate));
}
/**
@@ -884,7 +881,7 @@
static void
up_history_init (UpHistory *history)
{
- history->priv = UP_HISTORY_GET_PRIVATE (history);
+ history->priv = up_history_get_instance_private (history);
history->priv->data_rate = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
history->priv->data_charge = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
history->priv->data_time_full = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/up-kbd-backlight.c new/upower-0.99.11/src/up-kbd-backlight.c
--- old/upower-0.99.10/src/up-kbd-backlight.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/up-kbd-backlight.c 2019-09-03 08:47:44.000000000 +0200
@@ -31,6 +31,7 @@
#include
#include
#include
+#include
#include "up-kbd-backlight.h"
#include "up-daemon.h"
@@ -38,8 +39,6 @@
static void up_kbd_backlight_finalize (GObject *object);
-#define UP_KBD_BACKLIGHT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_KBD_BACKLIGHT, UpKbdBacklightPrivate))
-
struct UpKbdBacklightPrivate
{
gint fd;
@@ -48,7 +47,7 @@
gint max_brightness;
};
-G_DEFINE_TYPE (UpKbdBacklight, up_kbd_backlight, UP_TYPE_EXPORTED_KBD_BACKLIGHT_SKELETON)
+G_DEFINE_TYPE_WITH_PRIVATE (UpKbdBacklight, up_kbd_backlight, UP_TYPE_EXPORTED_KBD_BACKLIGHT_SKELETON)
/**
* up_kbd_backlight_emit_change:
@@ -207,8 +206,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = up_kbd_backlight_finalize;
-
- g_type_class_add_private (klass, sizeof (UpKbdBacklightPrivate));
}
/**
@@ -224,7 +221,11 @@
return FALSE;
brightness = up_kbd_backlight_brightness_read (kbd_backlight, kbd_backlight->priv->fd_hw_changed);
- up_kbd_backlight_emit_change (kbd_backlight, brightness, "internal");
+ if (brightness < 0 && errno == ENODEV)
+ return FALSE;
+
+ if (brightness >= 0)
+ up_kbd_backlight_emit_change (kbd_backlight, brightness, "internal");
return TRUE;
}
@@ -322,7 +323,7 @@
static void
up_kbd_backlight_init (UpKbdBacklight *kbd_backlight)
{
- kbd_backlight->priv = UP_KBD_BACKLIGHT_GET_PRIVATE (kbd_backlight);
+ kbd_backlight->priv = up_kbd_backlight_get_instance_private (kbd_backlight);
g_signal_connect (kbd_backlight, "handle-get-brightness",
G_CALLBACK (up_kbd_backlight_get_brightness), kbd_backlight);
@@ -344,7 +345,7 @@
g_return_if_fail (UP_IS_KBD_BACKLIGHT (object));
kbd_backlight = UP_KBD_BACKLIGHT (object);
- kbd_backlight->priv = UP_KBD_BACKLIGHT_GET_PRIVATE (kbd_backlight);
+ kbd_backlight->priv = up_kbd_backlight_get_instance_private (kbd_backlight);
if (kbd_backlight->priv->channel_hw_changed) {
g_io_channel_shutdown (kbd_backlight->priv->channel_hw_changed, FALSE, NULL);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/up-wakeups.c new/upower-0.99.11/src/up-wakeups.c
--- old/upower-0.99.10/src/up-wakeups.c 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/up-wakeups.c 2019-09-03 08:47:44.000000000 +0200
@@ -33,8 +33,6 @@
static void up_wakeups_finalize (GObject *object);
static gboolean up_wakeups_timerstats_enable (UpWakeups *wakeups);
-#define UP_WAKEUPS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_WAKEUPS, UpWakeupsPrivate))
-
#define UP_WAKEUPS_POLL_INTERVAL_KERNEL 2 /* seconds */
#define UP_WAKEUPS_POLL_INTERVAL_USERSPACE 2 /* seconds */
#define UP_WAKEUPS_DISABLE_INTERVAL 30 /* seconds */
@@ -54,7 +52,7 @@
gboolean polling_enabled;
};
-G_DEFINE_TYPE (UpWakeups, up_wakeups, UP_TYPE_EXPORTED_WAKEUPS_SKELETON)
+G_DEFINE_TYPE_WITH_PRIVATE (UpWakeups, up_wakeups, UP_TYPE_EXPORTED_WAKEUPS_SKELETON)
/**
* up_wakeups_get_cmdline:
@@ -656,8 +654,6 @@
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = up_wakeups_finalize;
-
- g_type_class_add_private (klass, sizeof (UpWakeupsPrivate));
}
/**
@@ -666,7 +662,7 @@
static void
up_wakeups_init (UpWakeups *wakeups)
{
- wakeups->priv = UP_WAKEUPS_GET_PRIVATE (wakeups);
+ wakeups->priv = up_wakeups_get_instance_private (wakeups);
wakeups->priv->data = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
/* test if we have an interface */
@@ -693,7 +689,7 @@
g_return_if_fail (UP_IS_WAKEUPS (object));
wakeups = UP_WAKEUPS (object);
- wakeups->priv = UP_WAKEUPS_GET_PRIVATE (wakeups);
+ wakeups->priv = up_wakeups_get_instance_private (wakeups);
/* stop timerstats */
up_wakeups_timerstats_disable (wakeups);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upower-0.99.10/src/upower.service.in new/upower-0.99.11/src/upower.service.in
--- old/upower-0.99.10/src/upower.service.in 2019-02-20 14:40:19.000000000 +0100
+++ new/upower-0.99.11/src/upower.service.in 2019-09-03 08:47:44.000000000 +0200
@@ -14,11 +14,13 @@
ProtectKernelTunables=false
ProtectControlGroups=true
ReadWritePaths=@historydir@
+StateDirectory=upower
ProtectHome=true
PrivateTmp=true
# Network
# PrivateNetwork=true would block udev's netlink socket
+IPAddressDeny=any
RestrictAddressFamilies=AF_UNIX AF_NETLINK
# Execute Mappings
@@ -33,5 +35,21 @@
# Privilege escalation
NoNewPrivileges=true
+# Capabilities
+CapabilityBoundingSet=
+
+# System call interfaces
+LockPersonality=yes
+SystemCallArchitectures=native
+SystemCallFilter=@system-service
+SystemCallFilter=ioprio_get
+
+# Namespaces
+PrivateUsers=yes
+RestrictNamespaces=yes
+
+# Locked memory
+LimitMEMLOCK=0
+
[Install]
WantedBy=graphical.target
++++++ upower.obsinfo ++++++
--- /var/tmp/diff_new_pack.XQMna5/_old 2019-09-11 10:25:01.403476292 +0200
+++ /var/tmp/diff_new_pack.XQMna5/_new 2019-09-11 10:25:01.403476292 +0200
@@ -1,5 +1,5 @@
name: upower
-version: 0.99.10
-mtime: 1550670019
-commit: 215049e7b80c5f24cb35cd229a445c6cf19bd381
+version: 0.99.11
+mtime: 1567493264
+commit: e1548bba61206a05bbc318b3d49ae24571755ac6