[Xfce4-commits] [xfce/xfce4-power-manager] 02/05: Fix misc compilation warnings
noreply at xfce.org
noreply at xfce.org
Fri Oct 27 16:32:30 CEST 2017
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfce4-power-manager.
commit f1a0eebbc3e61e80204d848973de213295344752
Author: Viktor Odintsev <ninetls at xfce.org>
Date: Fri Sep 15 06:07:27 2017 +0300
Fix misc compilation warnings
---
.../power-manager-plugin/power-manager-button.c | 10 ++++-----
src/xfpm-battery.c | 24 +++++++++++-----------
src/xfpm-manager.c | 18 ++++++++--------
3 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/panel-plugins/power-manager-plugin/power-manager-button.c b/panel-plugins/power-manager-plugin/power-manager-button.c
index ad3088c..34b9f9a 100644
--- a/panel-plugins/power-manager-plugin/power-manager-button.c
+++ b/panel-plugins/power-manager-plugin/power-manager-button.c
@@ -1380,6 +1380,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
static void
display_inhibitors (PowerManagerButton *button, GtkWidget *menu)
{
+ GtkWidget *separator_mi;
gboolean needs_seperator = FALSE;
g_return_if_fail (POWER_MANAGER_IS_BUTTON (button));
@@ -1426,7 +1427,7 @@ display_inhibitors (PowerManagerButton *button, GtkWidget *menu)
if (needs_seperator)
{
/* add a separator */
- GtkWidget * separator_mi = gtk_separator_menu_item_new ();
+ separator_mi = gtk_separator_menu_item_new ();
gtk_widget_show (separator_mi);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), separator_mi);
}
@@ -1437,7 +1438,8 @@ display_inhibitors (PowerManagerButton *button, GtkWidget *menu)
static void
display_inhibitors (PowerManagerButton *button, GtkWidget *menu)
{
- gboolean needs_seperator = FALSE;
+ guint i;
+ GtkWidget *separator_mi;
const gchar **inhibitors;
g_return_if_fail (POWER_MANAGER_IS_BUTTON (button));
@@ -1446,15 +1448,13 @@ display_inhibitors (PowerManagerButton *button, GtkWidget *menu)
inhibitors = xfpm_inhibit_get_inhibit_list (button->priv->inhibit);
if (inhibitors != NULL && inhibitors[0] != NULL)
{
- guint i;
-
for (i=0; inhibitors[i] != NULL; i++)
{
add_inhibitor_to_menu (button, inhibitors[i]);
}
/* add a separator */
- GtkWidget * separator_mi = gtk_separator_menu_item_new ();
+ separator_mi = gtk_separator_menu_item_new ();
gtk_widget_show (separator_mi);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), separator_mi);
}
diff --git a/src/xfpm-battery.c b/src/xfpm-battery.c
index 981ad0f..2a37fe4 100644
--- a/src/xfpm-battery.c
+++ b/src/xfpm-battery.c
@@ -134,18 +134,18 @@ xfpm_battery_get_message_from_battery_state (XfpmBattery *battery)
else
msg = g_strdup_printf (_("System is running on %s power"), battery->priv->battery_name);
- if ( battery->priv->time_to_empty != 0 )
- {
- gchar *tmp, *est_time_str;
- tmp = g_strdup (msg);
- g_free (msg);
-
- est_time_str = xfpm_battery_get_time_string (battery->priv->time_to_empty);
-
- msg = g_strdup_printf (_("%s (%i%%)\nEstimated time left is %s."), tmp, battery->priv->percentage, est_time_str);
- g_free (tmp);
- g_free (est_time_str);
- }
+ if ( battery->priv->time_to_empty != 0 )
+ {
+ gchar *tmp, *est_time_str;
+ tmp = g_strdup (msg);
+ g_free (msg);
+
+ est_time_str = xfpm_battery_get_time_string (battery->priv->time_to_empty);
+
+ msg = g_strdup_printf (_("%s (%i%%)\nEstimated time left is %s."), tmp, battery->priv->percentage, est_time_str);
+ g_free (tmp);
+ g_free (est_time_str);
+ }
break;
case UP_DEVICE_STATE_EMPTY:
msg = g_strdup_printf (_("Your %s is empty"), battery->priv->battery_name);
diff --git a/src/xfpm-manager.c b/src/xfpm-manager.c
index 675c42c..2b52eb5 100644
--- a/src/xfpm-manager.c
+++ b/src/xfpm-manager.c
@@ -173,7 +173,7 @@ xfpm_manager_finalize (GObject *object)
if ( manager->priv->session_bus )
g_object_unref (manager->priv->session_bus);
- if ( manager->priv->system_bus )
+ if ( manager->priv->system_bus )
g_object_unref (manager->priv->system_bus);
g_object_unref (manager->priv->power);
@@ -501,14 +501,14 @@ xfpm_manager_alarm_timeout_cb (EggIdletime *idle, guint id, XfpmManager *manager
return;
}
- if ( id == TIMEOUT_INACTIVITY_ON_AC)
- g_object_get (G_OBJECT (manager->priv->conf),
- INACTIVITY_SLEEP_MODE_ON_AC, &sleep_mode,
- NULL);
- else
- g_object_get (G_OBJECT (manager->priv->conf),
- INACTIVITY_SLEEP_MODE_ON_BATTERY, &sleep_mode,
- NULL);
+ if ( id == TIMEOUT_INACTIVITY_ON_AC)
+ g_object_get (G_OBJECT (manager->priv->conf),
+ INACTIVITY_SLEEP_MODE_ON_AC, &sleep_mode,
+ NULL);
+ else
+ g_object_get (G_OBJECT (manager->priv->conf),
+ INACTIVITY_SLEEP_MODE_ON_BATTERY, &sleep_mode,
+ NULL);
g_object_get (G_OBJECT (manager->priv->power),
"on-battery", &on_battery,
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list