[Xfce4-commits] [panel-plugins/xfce4-fsguard-plugin] 01/02: Shuffle statements to fix logic bug - if the partition was smaller than 1G, an error message was shown in the tooltip

noreply at xfce.org noreply at xfce.org
Fri Apr 29 09:32:33 CEST 2016


This is an automated email from the git hooks/post-receive script.

landry pushed a commit to branch master
in repository panel-plugins/xfce4-fsguard-plugin.

commit 89cf1d1980933ae75b3d3a0b5f2846b23a697c1e
Author: Landry Breuil <landry at xfce.org>
Date:   Fri Apr 29 09:12:30 2016 +0200

    Shuffle statements to fix logic bug - if the partition was smaller than 1G, an error message was shown in the tooltip
---
 panel-plugin/fsguard.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/panel-plugin/fsguard.c b/panel-plugin/fsguard.c
index 4bb0422..152e759 100644
--- a/panel-plugin/fsguard.c
+++ b/panel-plugin/fsguard.c
@@ -284,22 +284,23 @@ fsguard_check_fs (FsGuard *fsguard)
             icon_id = ICON_URGENT;
         }
     }
+        g_snprintf (msg, sizeof (msg),
+                    _("could not check mountpoint %s, please check your config"),
+                    fsguard->path);
 
     /* msg_total_size, msg_size */
     if (total > 1024) {
         g_snprintf (msg_total_size, sizeof(msg_total_size), _("%.2f GB"), total / 1024);
         g_snprintf (msg_size, sizeof (msg_size), _("%.2f GB"), freespace / 1024);
-        g_snprintf (msg, sizeof (msg),
-                    (*(fsguard->name) != '\0' && strcmp(fsguard->path, fsguard->name)) ?
-                    _("%s/%s space left on %s (%s)") : _("%s/%s space left on %s"),
-                    msg_size, msg_total_size, fsguard->path, fsguard->name);
     } else {
         g_snprintf (msg_total_size, sizeof (msg_total_size), _("%.0f MB"), total);
         g_snprintf (msg_size, sizeof (msg_size), _("%.0f MB"), freespace);
-        g_snprintf (msg, sizeof (msg),
-                    _("could not check mountpoint %s, please check your config"),
-                    fsguard->path);
     }
+    if (err != -1)
+        g_snprintf (msg, sizeof (msg),
+                    (*(fsguard->name) != '\0' && strcmp(fsguard->path, fsguard->name)) ?
+                    _("%s/%s space left on %s (%s)") : _("%s/%s space left on %s"),
+                    msg_size, msg_total_size, fsguard->path, fsguard->name);
 
     if (fsguard->show_size) {
         gtk_label_set_text (GTK_LABEL(fsguard->lab_size),

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list