summaryrefslogtreecommitdiff
blob: dbc1d3fbc3f709d03fe22d4b46f4a406c6a4d671 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
From 0b266339403255b8c23ea31015e3ef40e620b9bb Mon Sep 17 00:00:00 2001
From: Ross Burton <ross@linux.intel.com>
Date: Mon, 17 May 2010 14:52:18 +0000
Subject: housekeeping: only check for baobob if we're about to show a dialog (part of BMC#1583)

---
diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c
index 82ff7e6..8c4d378 100644
--- a/plugins/housekeeping/gsd-disk-space.c
+++ b/plugins/housekeeping/gsd-disk-space.c
@@ -172,14 +172,14 @@ ldsm_analyze_path (const gchar *path)
 
 static gboolean
 ldsm_notify_for_mount (LdsmMountInfo *mount,
-                       gboolean       has_disk_analyzer,
                        gboolean       multiple_volumes,
                        gboolean       other_usable_volumes)
 {
-        gchar  *name;
+        gchar  *name, *program;
         gint64 free_space;
         gint response;
         gboolean has_trash;
+        gboolean has_disk_analyzer;
         gboolean retval = TRUE;
         const gchar *path;
 
@@ -192,6 +192,10 @@ ldsm_notify_for_mount (LdsmMountInfo *mount,
         has_trash = ldsm_mount_has_trash (mount);
         path = g_unix_mount_get_mount_path (mount->mount);
 
+        program = g_find_program_in_path (DISK_SPACE_ANALYZER);
+        has_disk_analyzer = (program != NULL);
+        g_free (program);
+
         dialog = gsd_ldsm_dialog_new (other_usable_volumes,
                                       multiple_volumes,
                                       has_disk_analyzer,
@@ -359,7 +363,6 @@ ldsm_free_mount_info (gpointer data)
 
 static void
 ldsm_maybe_warn_mounts (GList *mounts,
-                        gboolean has_disk_analyzer,
                         gboolean multiple_volumes,
                         gboolean other_usable_volumes)
 {
@@ -418,7 +421,7 @@ ldsm_maybe_warn_mounts (GList *mounts,
                 }
 
                 if (show_notify) {
-                        if (ldsm_notify_for_mount (mount_info, has_disk_analyzer, multiple_volumes, other_usable_volumes))
+                        if (ldsm_notify_for_mount (mount_info, multiple_volumes, other_usable_volumes))
                                 done = TRUE;
                 }
         }
@@ -431,17 +434,11 @@ ldsm_check_all_mounts (gpointer data)
         GList *l;
         GList *check_mounts = NULL;
         GList *full_mounts = NULL;
-        char *program;
-        gboolean has_disk_analyzer;
         guint number_of_mounts;
         guint number_of_full_mounts;
         gboolean multiple_volumes = FALSE;
         gboolean other_usable_volumes = FALSE;
 
-        program = g_find_program_in_path (DISK_SPACE_ANALYZER);
-        has_disk_analyzer = (program != NULL);
-        g_free (program);
-
         /* We iterate through the static mounts in /etc/fstab first, seeing if
          * they're mounted by checking if the GUnixMountPoint has a corresponding GUnixMountEntry.
          * Iterating through the static mounts means we automatically ignore dynamically mounted media.
@@ -509,7 +506,7 @@ ldsm_check_all_mounts (gpointer data)
         if (number_of_mounts > number_of_full_mounts)
                 other_usable_volumes = TRUE;
 
-        ldsm_maybe_warn_mounts (full_mounts, has_disk_analyzer, multiple_volumes,
+        ldsm_maybe_warn_mounts (full_mounts, multiple_volumes,
                                 other_usable_volumes);
 
         g_list_free (check_mounts);
--
cgit v0.8.3.1