Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package xfce4-sensors-plugin for
openSUSE:Factory checked in at 2022-02-04 21:49:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xfce4-sensors-plugin (Old)
and /work/SRC/openSUSE:Factory/.xfce4-sensors-plugin.new.1898 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xfce4-sensors-plugin"
Fri Feb 4 21:49:29 2022 rev:6 rq:951632 version:1.4.3
Changes:
--------
---
/work/SRC/openSUSE:Factory/xfce4-sensors-plugin/xfce4-sensors-plugin.changes
2021-11-22 23:04:55.701782181 +0100
+++
/work/SRC/openSUSE:Factory/.xfce4-sensors-plugin.new.1898/xfce4-sensors-plugin.changes
2022-02-04 21:52:51.350962044 +0100
@@ -1,0 +2,8 @@
+Wed Feb 2 18:58:47 UTC 2022 - Marcel Kuehlhorn <[email protected]>
+
+- Update to version 1.4.3
+ * Fix translations not showing in the GUI
+ * Use locale-independent floats in configuration files
+ * Translation Updates
+
+-------------------------------------------------------------------
Old:
----
xfce4-sensors-plugin-1.4.2.tar.bz2
New:
----
xfce4-sensors-plugin-1.4.3.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xfce4-sensors-plugin.spec ++++++
--- /var/tmp/diff_new_pack.7UVftW/_old 2022-02-04 21:52:51.762959210 +0100
+++ /var/tmp/diff_new_pack.7UVftW/_new 2022-02-04 21:52:51.770959155 +0100
@@ -1,7 +1,7 @@
#
# spec file
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -20,7 +20,7 @@
%define plugin sensors
%bcond_with git
Name: xfce4-%{plugin}-plugin
-Version: 1.4.2
+Version: 1.4.3
Release: 0
Summary: Hardware Sensor Plugin for the Xfce Panel
License: GPL-2.0-or-later
++++++ xfce4-sensors-plugin-1.4.2.tar.bz2 -> xfce4-sensors-plugin-1.4.3.tar.bz2
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xfce4-sensors-plugin-1.4.2/NEWS
new/xfce4-sensors-plugin-1.4.3/NEWS
--- old/xfce4-sensors-plugin-1.4.2/NEWS 2021-11-15 20:52:34.000000000 +0100
+++ new/xfce4-sensors-plugin-1.4.3/NEWS 2022-02-02 01:31:12.000000000 +0100
@@ -1,3 +1,10 @@
+1.4.3 (2022-02-02)
+=====
+- Fix translations not showing in the GUI
+- Use locale-independent floats in configuration files
+- Translation Updates:
+ Swedish
+
1.4.2 (2021-11-15)
=====
- Prevent overlap of tachometer titles and improve standalone app layout
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xfce4-sensors-plugin-1.4.2/configure
new/xfce4-sensors-plugin-1.4.3/configure
--- old/xfce4-sensors-plugin-1.4.2/configure 2021-11-15 20:53:06.000000000
+0100
+++ new/xfce4-sensors-plugin-1.4.3/configure 2022-02-02 01:31:22.000000000
+0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for xfce4-sensors-plugin 1.4.2.
+# Generated by GNU Autoconf 2.69 for xfce4-sensors-plugin 1.4.3.
#
# Report bugs to <https://gitlab.xfce.org/panel-plugins/xfce4-sensors-plugin/>.
#
@@ -591,8 +591,8 @@
# Identity of this package.
PACKAGE_NAME='xfce4-sensors-plugin'
PACKAGE_TARNAME='xfce4-sensors-plugin'
-PACKAGE_VERSION='1.4.2'
-PACKAGE_STRING='xfce4-sensors-plugin 1.4.2'
+PACKAGE_VERSION='1.4.3'
+PACKAGE_STRING='xfce4-sensors-plugin 1.4.3'
PACKAGE_BUGREPORT='https://gitlab.xfce.org/panel-plugins/xfce4-sensors-plugin/'
PACKAGE_URL=''
@@ -1448,7 +1448,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures xfce4-sensors-plugin 1.4.2 to adapt to many kinds of
systems.
+\`configure' configures xfce4-sensors-plugin 1.4.3 to adapt to many kinds of
systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1520,7 +1520,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xfce4-sensors-plugin 1.4.2:";;
+ short | recursive ) echo "Configuration of xfce4-sensors-plugin 1.4.3:";;
esac
cat <<\_ACEOF
@@ -1669,7 +1669,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-xfce4-sensors-plugin configure 1.4.2
+xfce4-sensors-plugin configure 1.4.3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2159,7 +2159,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by xfce4-sensors-plugin $as_me 1.4.2, which was
+It was created by xfce4-sensors-plugin $as_me 1.4.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3027,7 +3027,7 @@
# Define the identity of the package.
PACKAGE='xfce4-sensors-plugin'
- VERSION='1.4.2'
+ VERSION='1.4.3'
cat >>confdefs.h <<_ACEOF
@@ -19455,7 +19455,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by xfce4-sensors-plugin $as_me 1.4.2, which was
+This file was extended by xfce4-sensors-plugin $as_me 1.4.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -19521,7 +19521,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-xfce4-sensors-plugin config.status 1.4.2
+xfce4-sensors-plugin config.status 1.4.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xfce4-sensors-plugin-1.4.2/configure.ac
new/xfce4-sensors-plugin-1.4.3/configure.ac
--- old/xfce4-sensors-plugin-1.4.2/configure.ac 2021-11-15 20:53:00.000000000
+0100
+++ new/xfce4-sensors-plugin-1.4.3/configure.ac 2022-02-02 01:31:16.000000000
+0100
@@ -16,8 +16,8 @@
AC_CONFIG_MACRO_DIRS([m4])
m4_define([sensors_version_major], [1])
m4_define([sensors_version_minor], [4])
-m4_define([sensors_version_micro], [2])
-m4_define([sensors_version_build], [096efe3])
+m4_define([sensors_version_micro], [3])
+m4_define([sensors_version_build], [d417165])
m4_define([sensors_version_tag], [])
m4_define([sensors_version],
[sensors_version_major().sensors_version_minor().sensors_version_micro()ifelse(sensors_version_tag(),
[git], [sensors_version_tag()-sensors_version_build()],
[sensors_version_tag()])])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xfce4-sensors-plugin-1.4.2/lib/configuration.cc
new/xfce4-sensors-plugin-1.4.3/lib/configuration.cc
--- old/xfce4-sensors-plugin-1.4.2/lib/configuration.cc 2021-11-10
00:55:57.000000000 +0100
+++ new/xfce4-sensors-plugin-1.4.3/lib/configuration.cc 2022-02-02
01:29:15.000000000 +0100
@@ -134,8 +134,8 @@
rc->write_bool_entry ("Show", feature->show);
- rc->write_entry ("Min", xfce4::sprintf ("%.2f",
feature->min_value));
- rc->write_entry ("Max", xfce4::sprintf ("%.2f",
feature->max_value));
+ rc->write_float_entry ("Min", feature->min_value);
+ rc->write_float_entry ("Max", feature->max_value);
}
}
}
@@ -309,11 +309,8 @@
feature->show = rc->read_bool_entry ("Show",
FALSE);
- if ((str_value = rc->read_entry ("Min", NULL))
&& !str_value->empty())
- feature->min_value = atof
(str_value->c_str());
-
- if ((str_value = rc->read_entry ("Max", NULL))
&& !str_value->empty())
- feature->max_value = atof
(str_value->c_str());
+ feature->min_value = rc->read_float_entry
("Min", feature->min_value);
+ feature->max_value = rc->read_float_entry
("Max", feature->max_value);
}
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xfce4-sensors-plugin-1.4.2/po/sv.po
new/xfce4-sensors-plugin-1.4.3/po/sv.po
--- old/xfce4-sensors-plugin-1.4.2/po/sv.po 2021-11-15 20:53:10.000000000
+0100
+++ new/xfce4-sensors-plugin-1.4.3/po/sv.po 2022-02-02 01:31:27.000000000
+0100
@@ -3,6 +3,7 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# Arve Eriksson <[email protected]>, 2021
# Daniel Nylander <[email protected]>, 2008
# Luna Jernberg <[email protected]>, 2020-2021
# P??vel Nicklasson<[email protected]>, 2015
@@ -11,8 +12,8 @@
"Project-Id-Version: Xfce Panel Plugins\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-07-22 00:48+0200\n"
-"PO-Revision-Date: 2021-07-21 22:48+0000\n"
-"Last-Translator: Xfce Bot <[email protected]>\n"
+"PO-Revision-Date: 2021-11-21 08:04+0000\n"
+"Last-Translator: Arve Eriksson <[email protected]>\n"
"Language-Team: Swedish
(http://www.transifex.com/xfce/xfce-panel-plugins/language/sv/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -62,7 +63,7 @@
#: ../panel-plugin/sensors-plugin.c:1779
msgid "_Automatic bar colors"
-msgstr ""
+msgstr "_Automatiska f??ltf??rger"
#: ../panel-plugin/sensors-plugin.c:1781
msgid ""
@@ -70,7 +71,7 @@
"If disabled, bars use the user-defined sensor colors.\n"
"If a particular user-defined sensor color is unspecified,\n"
"the bar color is derived from the current UI style."
-msgstr ""
+msgstr "Om det aktiveras kommer f??ltf??rger att bero p?? deras v??rden
(normal, h??g, mycket h??g).\nOm det avaktiveras kommer f??lt att anv??nda de
anv??ndardefinierade sensorf??rgerna.\nOm en viss anv??ndardefinierad
sensorf??rg l??mnas ospecificerad\nkommer f??ltf??rgen att h??mtas fr??n
aktuell UI-stil."
#: ../panel-plugin/sensors-plugin.c:1808
msgid "_Show title"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xfce4-sensors-plugin-1.4.2/xfce4++/util/fixes.h
new/xfce4-sensors-plugin-1.4.3/xfce4++/util/fixes.h
--- old/xfce4-sensors-plugin-1.4.2/xfce4++/util/fixes.h 2021-10-01
13:04:03.000000000 +0200
+++ new/xfce4-sensors-plugin-1.4.3/xfce4++/util/fixes.h 2022-02-02
01:29:15.000000000 +0100
@@ -37,7 +37,23 @@
#if LIBXFCE4UTIL_CHECK_VERSION(4, 17, 0)
#include <libxfce4util/xfce-gio-extensions.h>
#endif
- #include <libxfce4util/xfce-i18n.h>
+
+ /*
+ * Define the macro GETTEXT_PACKAGE in order to avoid getting
+ * an invalid ngettext() definition from <libxfce4util/xfce-i18n.h>.
+ *
+ * See also: https://gitlab.xfce.org/xfce/libxfce4util/-/issues/7
+ */
+ #ifdef GETTEXT_PACKAGE
+ #include <libxfce4util/xfce-i18n.h>
+ #else
+ /* Note: The symbol __UNDEFINED__GETTEXT_PACKAGE__... is meant not to
be defined anywhere.
+ * The numeric suffix is a random 64-bit number. The random
number makes it improbable
+ * for any 3rd-party source code to define such a symbol. */
+ #define GETTEXT_PACKAGE
__UNDEFINED__GETTEXT_PACKAGE__RND_11148334482592236430__
+ #include <libxfce4util/xfce-i18n.h>
+ #undef GETTEXT_PACKAGE
+ #endif
}
#undef LIBXFCE4UTIL_INSIDE_LIBXFCE4UTIL_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xfce4-sensors-plugin-1.4.2/xfce4++/util/gtk.cc
new/xfce4-sensors-plugin-1.4.3/xfce4++/util/gtk.cc
--- old/xfce4-sensors-plugin-1.4.2/xfce4++/util/gtk.cc 2021-11-15
18:03:14.000000000 +0100
+++ new/xfce4-sensors-plugin-1.4.3/xfce4++/util/gtk.cc 2022-02-02
01:29:15.000000000 +0100
@@ -131,6 +131,16 @@
_connect<void>(widget, "check-resize", handler);
}
+/* http://docs.gtk.org/gtk3/signal.Button.clicked.html */
+void connect_clicked(GtkButton *widget, const std::function<ClickHandler>
&handler) {
+ _connect<void>(widget, "clicked", handler);
+}
+
+/* http://docs.gtk.org/gtk3/signal.ColorButton.color-set.html */
+void connect_color_set(GtkColorButton *widget, const
std::function<ColorSetHandler> &handler) {
+ _connect<void>(widget, "color-set", handler);
+}
+
/* http://docs.gtk.org/gtk3/signal.Widget.destroy.html */
void connect_destroy(GtkWidget *widget, const std::function<DestroyHandler>
&handler) {
_connect<void>(widget, "destroy", handler);
@@ -151,11 +161,29 @@
_connect<void>(object, "edited", handler);
}
+/* http://docs.gtk.org/gtk3/signal.Widget.enter-notify-event.html
+ *
+ * Note: GTK+ documentation contains an error.
+ * The event actually passed to the handler is a pointer to
GdkEventCrossing.
+ */
+void connect_enter_notify(GtkWidget *widget, const
std::function<EnterNotifyHandler> &handler) {
+ _connect<gboolean>(widget, "enter-notify-event", handler);
+}
+
/* http://docs.gtk.org/gtk3/signal.FontButton.font-set.html */
void connect_font_set(GtkFontButton *widget, const
std::function<FontSetHandler> &handler) {
_connect<void>(widget, "font-set", handler);
}
+/* http://docs.gtk.org/gtk3/signal.Widget.leave-notify-event.html
+ *
+ * Note: GTK+ documentation contains an error.
+ * The event actually passed to the handler is a pointer to
GdkEventCrossing.
+ */
+void connect_leave_notify(GtkWidget *widget, const
std::function<LeaveNotifyHandler> &handler) {
+ _connect<gboolean>(widget, "leave-notify-event", handler);
+}
+
/* http://docs.gtk.org/gtk3/signal.Widget.query-tooltip.html */
void connect_query_tooltip(GtkWidget *widget, const
std::function<TooltipHandler> &handler) {
_connect<gboolean>(widget, "query-tooltip", handler);
@@ -215,7 +243,7 @@
_connect<void>(plugin, "mode-changed", handler);
}
-void connect_save(XfcePanelPlugin *plugin, const std::function<PluginHandler>
&handler) {
+void connect_save(XfcePanelPlugin *plugin, const std::function<PluginHandler>
&handler) {
_connect<void>(plugin, "save", handler);
}
@@ -224,6 +252,15 @@
}
+
+void invoke_later(const std::function<void()> &task) {
+ timeout_add(0, [task]() {
+ task();
+ return TIMEOUT_REMOVE;
+ });
+}
+
+
struct TimeoutHandlerData {
static const uint32_t MAGIC = 0x99F67650;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xfce4-sensors-plugin-1.4.2/xfce4++/util/gtk.h
new/xfce4-sensors-plugin-1.4.3/xfce4++/util/gtk.h
--- old/xfce4-sensors-plugin-1.4.2/xfce4++/util/gtk.h 2021-11-15
18:02:35.000000000 +0100
+++ new/xfce4-sensors-plugin-1.4.3/xfce4++/util/gtk.h 2022-02-02
01:29:15.000000000 +0100
@@ -90,11 +90,15 @@
typedef void ChangedHandler_ComboBox (GtkComboBox *widget);
typedef Propagation ChangeValueHandler_Range (GtkRange *widget,
GtkScrollType *scroll, gdouble value);
typedef void CheckResizeHandler (GtkContainer *widget);
+typedef void ClickHandler (GtkButton *widget);
+typedef void ColorSetHandler (GtkColorButton *widget);
typedef void DestroyHandler (GtkWidget *widget);
typedef Propagation DrawHandler1 (cairo_t *cr);
typedef Propagation DrawHandler2 (GtkWidget *widget,
cairo_t *cr);
typedef void EditedHandler (GtkCellRendererText
*object, gchar *path, gchar *new_text);
+typedef Propagation EnterNotifyHandler (GtkWidget *widget,
GdkEventCrossing *event);
typedef void FontSetHandler (GtkFontButton *widget);
+typedef Propagation LeaveNotifyHandler (GtkWidget *widget,
GdkEventCrossing *event);
typedef void ResponseHandler (GtkDialog *widget, gint
response);
typedef void ToggledHandler_CellRendererToggle(GtkCellRendererToggle
*object, gchar *path);
typedef void ToggledHandler_ToggleButton (GtkToggleButton *widget);
@@ -108,11 +112,15 @@
void connect_changed (GtkComboBox *widget, const
std::function<ChangedHandler_ComboBox> &handler);
void connect_change_value (GtkRange *widget, const
std::function<ChangeValueHandler_Range> &handler);
void connect_check_resize (GtkContainer *widget, const
std::function<CheckResizeHandler> &handler);
+void connect_clicked (GtkButton *widget, const
std::function<ClickHandler> &handler);
+void connect_color_set (GtkColorButton *widget, const
std::function<ColorSetHandler> &handler);
void connect_destroy (GtkWidget *widget, const
std::function<DestroyHandler> &handler);
void connect_draw (GtkWidget *widget, const
std::function<DrawHandler1> &handler);
void connect_draw (GtkWidget *widget, const
std::function<DrawHandler2> &handler);
void connect_edited (GtkCellRendererText *object, const
std::function<EditedHandler> &handler);
+void connect_enter_notify (GtkWidget *widget, const
std::function<EnterNotifyHandler> &handler);
void connect_font_set (GtkFontButton *widget, const
std::function<FontSetHandler> &handler);
+void connect_leave_notify (GtkWidget *widget, const
std::function<LeaveNotifyHandler> &handler);
void connect_query_tooltip(GtkWidget *widget, const
std::function<TooltipHandler> &handler);
void connect_response (GtkDialog *widget, const
std::function<ResponseHandler> &handler);
void connect_toggled (GtkCellRendererToggle *object, const
std::function<ToggledHandler_CellRendererToggle> &handler);
@@ -131,6 +139,8 @@
void connect_save (XfcePanelPlugin *plugin, const
std::function<PluginHandler> &handler);
void connect_size_changed (XfcePanelPlugin *plugin, const
std::function<SizeChangeHandler> &handler);
+void invoke_later(const std::function<void()> &task);
+
typedef TimeoutResponse TimeoutHandler();
guint timeout_add(guint interval_ms, const std::function<TimeoutHandler>
&handler);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xfce4-sensors-plugin-1.4.2/xfce4++/util/memory.h
new/xfce4-sensors-plugin-1.4.3/xfce4++/util/memory.h
--- old/xfce4-sensors-plugin-1.4.2/xfce4++/util/memory.h 2021-11-08
00:20:58.000000000 +0100
+++ new/xfce4-sensors-plugin-1.4.3/xfce4++/util/memory.h 2022-02-02
01:29:15.000000000 +0100
@@ -43,6 +43,7 @@
template<typename U> Ptr(const Ptr<U> &p) : ptr(p.ptr) {}
T* operator->() const { return ptr.get(); }
+ T& operator*() const { return *ptr; }
template<typename U> bool operator<(const Ptr<U> &p) const { return ptr <
p.ptr; }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xfce4-sensors-plugin-1.4.2/xfce4++/util/rc.cc
new/xfce4-sensors-plugin-1.4.3/xfce4++/util/rc.cc
--- old/xfce4-sensors-plugin-1.4.2/xfce4++/util/rc.cc 2021-11-10
00:33:04.000000000 +0100
+++ new/xfce4-sensors-plugin-1.4.3/xfce4++/util/rc.cc 2022-02-02
01:29:15.000000000 +0100
@@ -21,6 +21,7 @@
/* The fixes file has to be included before any other #include directives */
#include "xfce4++/util/fixes.h"
+#include <errno.h>
#include "rc.h"
#include "string-utils.h"
@@ -43,59 +44,75 @@
xfce_rc_delete_entry(rc, key, global);
}
-void Rc::delete_entry(const std::string &key, bool global) {
delete_entry(key.c_str(), global); }
+void Rc::delete_entry(const string &key, bool global) {
delete_entry(key.c_str(), global); }
bool Rc::has_group(const char *group) const {
return xfce_rc_has_group(rc, group);
}
-bool Rc::has_group(const std::string &group) const { return
has_group(group.c_str()); }
+bool Rc::has_group(const string &group) const { return
has_group(group.c_str()); }
bool Rc::read_bool_entry(const char *key, bool fallback) const {
return xfce_rc_read_bool_entry(rc, key, fallback);
}
-bool Rc::read_bool_entry(const std::string &key, bool fallback) const { return
read_bool_entry(key.c_str(), fallback); }
+bool Rc::read_bool_entry(const string &key, bool fallback) const { return
read_bool_entry(key.c_str(), fallback); }
Ptr0<std::string> Rc::read_entry(const char *key, const char *fallback_orNull)
const {
const gchar *e = xfce_rc_read_entry(rc, key, fallback_orNull);
if(e)
- return make<std::string>(e);
+ return make<string>(e);
else if(fallback_orNull)
- return make<std::string>(fallback_orNull);
+ return make<string>(fallback_orNull);
else
return nullptr;
}
-Ptr0<std::string> Rc::read_entry(const std::string &key, const char
*fallback_orNull) const {
+Ptr0<std::string> Rc::read_entry(const string &key, const char
*fallback_orNull) const {
return read_entry(key.c_str(), fallback_orNull);
}
+std::string Rc::read_entry(const char *key, const string &fallback) const {
+ const gchar *e = xfce_rc_read_entry(rc, key, fallback.c_str());
+ if(e)
+ return e;
+ else
+ return fallback;
+}
+
+std::string Rc::read_entry(const string &key, const string &fallback) const {
+ return read_entry(key.c_str(), fallback);
+}
+
float Rc::read_float_entry(const char *key, float fallback) const {
- Ptr0<std::string> e = read_entry(key, nullptr);
+ Ptr0<string> e = read_entry(key, nullptr);
if(e) {
- Optional<float> value = parse_float(*e);
- if(value.has_value())
- return value.value();
+ const std::string s = trim(*e.toPtr());
+ gchar *endptr = NULL;
+ errno = 0;
+ gdouble value = g_ascii_strtod(s.c_str(), &endptr);
+ if(errno == 0 && endptr == s.c_str() + s.size()) {
+ return value;
+ }
}
return fallback;
}
-float Rc::read_float_entry(const std::string &key, float fallback) const {
return read_float_entry(key.c_str(), fallback); }
+float Rc::read_float_entry(const string &key, float fallback) const { return
read_float_entry(key.c_str(), fallback); }
gint Rc::read_int_entry(const char *key, gint fallback) const {
return xfce_rc_read_int_entry(rc, key, fallback);
}
-gint Rc::read_int_entry(const std::string &key, gint fallback) const { return
read_int_entry(key.c_str(), fallback); }
+gint Rc::read_int_entry(const string &key, gint fallback) const { return
read_int_entry(key.c_str(), fallback); }
void Rc::set_group(const char *group) {
xfce_rc_set_group(rc, group);
}
-void Rc::set_group(const std::string &group) { set_group(group.c_str()); }
+void Rc::set_group(const string &group) { set_group(group.c_str()); }
-Ptr0<Rc> Rc::simple_open(const std::string &filename, bool readonly) {
+Ptr0<Rc> Rc::simple_open(const string &filename, bool readonly) {
XfceRc *rc = xfce_rc_simple_open(filename.c_str(), readonly);
if(rc)
return make<Rc>(rc);
@@ -103,19 +120,25 @@
return nullptr;
}
-void Rc::write_bool_entry(const char *key, bool value) {
xfce_rc_write_bool_entry(rc, key , value); }
-void Rc::write_bool_entry(const std::string &key, bool value) {
xfce_rc_write_bool_entry(rc, key.c_str(), value); }
+void Rc::write_bool_entry(const char *key, bool value) {
xfce_rc_write_bool_entry(rc, key , value); }
+void Rc::write_bool_entry(const string &key, bool value) {
xfce_rc_write_bool_entry(rc, key.c_str(), value); }
-void Rc::write_entry(const char *key, const char *value) {
xfce_rc_write_entry(rc, key , value ); }
-void Rc::write_entry(const char *key, const std::string &value) {
xfce_rc_write_entry(rc, key , value.c_str()); }
-void Rc::write_entry(const std::string &key, const char *value) {
xfce_rc_write_entry(rc, key.c_str(), value ); }
-void Rc::write_entry(const std::string &key, const std::string &value) {
xfce_rc_write_entry(rc, key.c_str(), value.c_str()); }
+void Rc::write_entry(const char *key, const char *value) {
xfce_rc_write_entry(rc, key , value ); }
+void Rc::write_entry(const char *key, const string &value) {
xfce_rc_write_entry(rc, key , value.c_str()); }
+void Rc::write_entry(const string &key, const char *value) {
xfce_rc_write_entry(rc, key.c_str(), value ); }
+void Rc::write_entry(const string &key, const string &value) {
xfce_rc_write_entry(rc, key.c_str(), value.c_str()); }
+
+void Rc::write_float_entry(const char *key, float value) {
+ gchar buf[G_ASCII_DTOSTR_BUF_SIZE+1];
+ g_ascii_dtostr(buf, G_ASCII_DTOSTR_BUF_SIZE, value);
+ buf[G_ASCII_DTOSTR_BUF_SIZE] = '\0';
+ write_entry(key, buf);
+}
-void Rc::write_float_entry(const char *key, float value) {
write_entry(key, xfce4::sprintf("%g", value)); }
-void Rc::write_float_entry(const std::string &key, float value) {
write_entry(key, xfce4::sprintf("%g", value)); }
+void Rc::write_float_entry(const string &key, float value) {
write_float_entry(key.c_str(), value); }
-void Rc::write_int_entry(const char *key, gint value) {
xfce_rc_write_int_entry(rc, key , value); }
-void Rc::write_int_entry(const std::string &key, gint value) {
xfce_rc_write_int_entry(rc, key.c_str(), value); }
+void Rc::write_int_entry(const char *key, gint value) {
xfce_rc_write_int_entry(rc, key , value); }
+void Rc::write_int_entry(const string &key, gint value) {
xfce_rc_write_int_entry(rc, key.c_str(), value); }
void Rc::write_default_bool_entry(const char *key, bool value, bool
default_value) {
if(value == default_value)
@@ -124,7 +147,7 @@
write_bool_entry(key, value);
}
-void Rc::write_default_bool_entry(const std::string &key, bool value, bool
default_value) {
+void Rc::write_default_bool_entry(const string &key, bool value, bool
default_value) {
if(value == default_value)
delete_entry(key, false);
else
@@ -138,21 +161,21 @@
write_entry(key, value);
}
-void Rc::write_default_entry(const char *key, const std::string &value, const
std::string &default_value) {
+void Rc::write_default_entry(const char *key, const string &value, const
string &default_value) {
if(value == default_value)
delete_entry(key, false);
else
write_entry(key, value);
}
-void Rc::write_default_entry(const std::string &key, const char *value, const
char *default_value) {
+void Rc::write_default_entry(const string &key, const char *value, const char
*default_value) {
if(value && default_value && strcmp(value, default_value) == 0)
delete_entry(key, false);
else
write_entry(key, value);
}
-void Rc::write_default_entry(const std::string &key, const std::string &value,
const std::string &default_value) {
+void Rc::write_default_entry(const string &key, const string &value, const
string &default_value) {
if(value == default_value)
delete_entry(key, false);
else
@@ -166,7 +189,7 @@
write_float_entry(key, value);
}
-void Rc::write_default_float_entry(const std::string &key, float value, float
default_value, float epsilon) {
+void Rc::write_default_float_entry(const string &key, float value, float
default_value, float epsilon) {
if(value == default_value)
delete_entry(key, false);
else
@@ -180,7 +203,7 @@
write_int_entry(key, value);
}
-void Rc::write_default_int_entry(const std::string &key, gint value, gint
default_value) {
+void Rc::write_default_int_entry(const string &key, gint value, gint
default_value) {
if(value == default_value)
delete_entry(key, false);
else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xfce4-sensors-plugin-1.4.2/xfce4++/util/rc.h
new/xfce4-sensors-plugin-1.4.3/xfce4++/util/rc.h
--- old/xfce4-sensors-plugin-1.4.2/xfce4++/util/rc.h 2021-11-10
00:35:57.000000000 +0100
+++ new/xfce4-sensors-plugin-1.4.3/xfce4++/util/rc.h 2022-02-02
01:29:15.000000000 +0100
@@ -33,55 +33,59 @@
namespace xfce4 {
struct Rc final {
+ typedef std::string string;
+
XfceRc *rc;
- static Ptr0<Rc> simple_open(const std::string &filename, bool readonly);
+ static Ptr0<Rc> simple_open(const string &filename, bool readonly);
Rc(XfceRc *rc);
~Rc();
void close();
- void delete_entry(const char *key, bool global);
- void delete_entry(const std::string &key, bool global);
+ void delete_entry(const char *key, bool global);
+ void delete_entry(const string &key, bool global);
- bool read_bool_entry (const char *key, bool
fallback ) const G_GNUC_WARN_UNUSED_RESULT;
- bool read_bool_entry (const std::string &key, bool
fallback ) const G_GNUC_WARN_UNUSED_RESULT;
- Ptr0<std::string> read_entry (const char *key, const char
*fallback_orNull) const G_GNUC_WARN_UNUSED_RESULT;
- Ptr0<std::string> read_entry (const std::string &key, const char
*fallback_orNull) const G_GNUC_WARN_UNUSED_RESULT;
- float read_float_entry(const char *key, float
fallback ) const G_GNUC_WARN_UNUSED_RESULT;
- float read_float_entry(const std::string &key, float
fallback ) const G_GNUC_WARN_UNUSED_RESULT;
- gint read_int_entry (const char *key, gint
fallback ) const G_GNUC_WARN_UNUSED_RESULT;
- gint read_int_entry (const std::string &key, gint
fallback ) const G_GNUC_WARN_UNUSED_RESULT;
-
- bool has_group(const char *group) const;
- bool has_group(const std::string &group) const;
- void set_group(const char *group);
- void set_group(const std::string &group);
-
- void write_bool_entry (const char *key, bool value);
- void write_bool_entry (const std::string &key, bool value);
- void write_entry (const char *key, const char *value);
- void write_entry (const char *key, const std::string &value);
- void write_entry (const std::string &key, const char *value);
- void write_entry (const std::string &key, const std::string &value);
- void write_float_entry(const char *key, float value);
- void write_float_entry(const std::string &key, float value);
- void write_int_entry (const char *key, gint value);
- void write_int_entry (const std::string &key, gint value);
+ bool read_bool_entry (const char *key, bool fallback
) const G_GNUC_WARN_UNUSED_RESULT;
+ bool read_bool_entry (const string &key, bool fallback
) const G_GNUC_WARN_UNUSED_RESULT;
+ Ptr0<string> read_entry (const char *key, const char
*fallback_orNull) const G_GNUC_WARN_UNUSED_RESULT;
+ Ptr0<string> read_entry (const string &key, const char
*fallback_orNull) const G_GNUC_WARN_UNUSED_RESULT;
+ string read_entry (const char *key, const string &fallback
) const G_GNUC_WARN_UNUSED_RESULT;
+ string read_entry (const string &key, const string &fallback
) const G_GNUC_WARN_UNUSED_RESULT;
+ float read_float_entry(const char *key, float fallback
) const G_GNUC_WARN_UNUSED_RESULT;
+ float read_float_entry(const string &key, float fallback
) const G_GNUC_WARN_UNUSED_RESULT;
+ gint read_int_entry (const char *key, gint fallback
) const G_GNUC_WARN_UNUSED_RESULT;
+ gint read_int_entry (const string &key, gint fallback
) const G_GNUC_WARN_UNUSED_RESULT;
+
+ bool has_group(const char *group) const;
+ bool has_group(const string &group) const;
+ void set_group(const char *group);
+ void set_group(const string &group);
+
+ void write_bool_entry (const char *key, bool value);
+ void write_bool_entry (const string &key, bool value);
+ void write_entry (const char *key, const char *value);
+ void write_entry (const char *key, const string &value);
+ void write_entry (const string &key, const char *value);
+ void write_entry (const string &key, const string &value);
+ void write_float_entry(const char *key, float value);
+ void write_float_entry(const string &key, float value);
+ void write_int_entry (const char *key, gint value);
+ void write_int_entry (const string &key, gint value);
/* Write an entry if it differs from the default value.
* Delete an entry if it equals to the default value. */
- void write_default_bool_entry (const char *key, bool
value, bool default_value);
- void write_default_bool_entry (const std::string &key, bool
value, bool default_value);
- void write_default_entry (const char *key, const char
*value, const char *default_value);
- void write_default_entry (const char *key, const std::string
&value, const std::string &default_value);
- void write_default_entry (const std::string &key, const char
*value, const char *default_value);
- void write_default_entry (const std::string &key, const std::string
&value, const std::string &default_value);
- void write_default_float_entry(const char *key, float
value, float default_value, float epsilon);
- void write_default_float_entry(const std::string &key, float
value, float default_value, float epsilon);
- void write_default_int_entry (const char *key, gint
value, gint default_value);
- void write_default_int_entry (const std::string &key, gint
value, gint default_value);
+ void write_default_bool_entry (const char *key, bool value,
bool default_value);
+ void write_default_bool_entry (const string &key, bool value,
bool default_value);
+ void write_default_entry (const char *key, const char *value,
const char *default_value);
+ void write_default_entry (const char *key, const string &value,
const string &default_value);
+ void write_default_entry (const string &key, const char *value,
const char *default_value);
+ void write_default_entry (const string &key, const string &value,
const string &default_value);
+ void write_default_float_entry(const char *key, float value,
float default_value, float epsilon);
+ void write_default_float_entry(const string &key, float value,
float default_value, float epsilon);
+ void write_default_int_entry (const char *key, gint value,
gint default_value);
+ void write_default_int_entry (const string &key, gint value,
gint default_value);
};
} /* namespace xfce4 */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xfce4-sensors-plugin-1.4.2/xfce4++/util/string-utils.cc
new/xfce4-sensors-plugin-1.4.3/xfce4++/util/string-utils.cc
--- old/xfce4-sensors-plugin-1.4.2/xfce4++/util/string-utils.cc 2021-11-10
00:26:46.000000000 +0100
+++ new/xfce4-sensors-plugin-1.4.3/xfce4++/util/string-utils.cc 2022-02-02
01:29:15.000000000 +0100
@@ -48,6 +48,29 @@
}
}
+std::string join(const std::vector<std::string> &strings, const char
*separator) {
+ return join(strings, std::string(separator));
+}
+
+std::string join(const std::vector<std::string> &strings, const std::string
&separator) {
+ size_t size = 0;
+ for (size_t i = 0; i < strings.size(); i++) {
+ if(i) {
+ size += separator.size();
+ }
+ size += strings[i].size();
+ }
+ std::string s;
+ s.reserve(size);
+ for (size_t i = 0; i < strings.size(); i++) {
+ if(i) {
+ s.append(separator);
+ }
+ s.append(strings[i]);
+ }
+ return s;
+}
+
template<typename T, typename fT>
static T parse_number(gchar **s, unsigned base, bool *error, fT (*f)(const
gchar*, gchar**, guint)) {
gchar *end;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xfce4-sensors-plugin-1.4.2/xfce4++/util/string-utils.h
new/xfce4-sensors-plugin-1.4.3/xfce4++/util/string-utils.h
--- old/xfce4-sensors-plugin-1.4.2/xfce4++/util/string-utils.h 2021-11-10
00:26:22.000000000 +0100
+++ new/xfce4-sensors-plugin-1.4.3/xfce4++/util/string-utils.h 2022-02-02
01:29:15.000000000 +0100
@@ -23,6 +23,7 @@
#include <glib.h>
#include <string>
+#include <vector>
#include "optional.h"
namespace xfce4 {
@@ -49,6 +50,8 @@
bool ends_with (const std::string &s, const char *suffix);
bool ends_with (const std::string &s, const std::string &suffix);
+std::string join (const std::vector<std::string> &strings, const char
*separator);
+std::string join (const std::vector<std::string> &strings, const
std::string &separator);
std::string sprintf (const char *fmt, ...) G_GNUC_PRINTF(1, 2);
bool starts_with(const std::string &s, const char *prefix);
bool starts_with(const std::string &s, const std::string &prefix);