summaryrefslogtreecommitdiff
path: root/plugins/housekeeping
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/housekeeping')
-rw-r--r--plugins/housekeeping/msd-disk-space.c3
-rw-r--r--plugins/housekeeping/msd-disk-space.h1
-rw-r--r--plugins/housekeeping/msd-housekeeping-manager.c40
-rw-r--r--plugins/housekeeping/msd-housekeeping-manager.h1
-rw-r--r--plugins/housekeeping/msd-housekeeping-plugin.c1
-rw-r--r--plugins/housekeeping/msd-housekeeping-plugin.h1
-rw-r--r--plugins/housekeeping/msd-ldsm-dialog.c1
-rw-r--r--plugins/housekeeping/msd-ldsm-dialog.h1
-rw-r--r--plugins/housekeeping/msd-ldsm-trash-empty.c1
-rw-r--r--plugins/housekeeping/msd-ldsm-trash-empty.h1
10 files changed, 34 insertions, 17 deletions
diff --git a/plugins/housekeeping/msd-disk-space.c b/plugins/housekeeping/msd-disk-space.c
index 14b67a1..91738e0 100644
--- a/plugins/housekeeping/msd-disk-space.c
+++ b/plugins/housekeeping/msd-disk-space.c
@@ -2,6 +2,7 @@
* vim: set et sw=8 ts=8:
*
* Copyright (c) 2008, Novell, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* Authors: Vincent Untz <[email protected]>
*
@@ -40,7 +41,6 @@
#include "msd-ldsm-dialog.h"
#include "msd-ldsm-trash-empty.h"
-
#define GIGABYTE 1024 * 1024 * 1024
#define CHECK_EVERY_X_SECONDS 60
@@ -279,7 +279,6 @@ ldsm_mount_is_user_ignore (const gchar *path)
return FALSE;
}
-
static gboolean
is_in (const gchar *value, const gchar *set[])
{
diff --git a/plugins/housekeeping/msd-disk-space.h b/plugins/housekeeping/msd-disk-space.h
index 13d4aa4..ff84a41 100644
--- a/plugins/housekeeping/msd-disk-space.h
+++ b/plugins/housekeeping/msd-disk-space.h
@@ -4,6 +4,7 @@
* Copyright (c) 2008, Novell, Inc.
*
* Authors: Vincent Untz <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/housekeeping/msd-housekeeping-manager.c b/plugins/housekeeping/msd-housekeeping-manager.c
index a4596cf..367cbb1 100644
--- a/plugins/housekeeping/msd-housekeeping-manager.c
+++ b/plugins/housekeeping/msd-housekeeping-manager.c
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2008 Michael J. Chudobiak <[email protected]>
* Copyright (C) 2012 Jasmine Hassan <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,7 +29,6 @@
#include "msd-housekeeping-manager.h"
#include "msd-disk-space.h"
-
/* General */
#define INTERVAL_ONCE_A_DAY 24*60*60
#define INTERVAL_TWO_MINUTES 2*60
@@ -44,6 +44,7 @@ struct _MsdHousekeepingManager {
guint long_term_cb;
guint short_term_cb;
GSettings *settings;
+ gulong config_listener_id;
};
G_DEFINE_TYPE (MsdHousekeepingManager, msd_housekeeping_manager, G_TYPE_OBJECT)
@@ -63,7 +64,6 @@ typedef struct {
glong size;
} ThumbData;
-
static void
thumb_data_free (gpointer data)
{
@@ -245,13 +245,6 @@ msd_housekeeping_manager_start (MsdHousekeepingManager *manager,
g_debug ("Starting housekeeping manager");
mate_settings_profile_start (NULL);
- msd_ldsm_setup (FALSE);
-
- manager->settings = g_settings_new (THUMB_CACHE_SCHEMA);
-
- g_signal_connect (manager->settings, "changed",
- G_CALLBACK (settings_changed_callback), manager);
-
/* Clean once, a few minutes after start-up */
do_cleanup_soon (manager);
@@ -267,7 +260,23 @@ msd_housekeeping_manager_start (MsdHousekeepingManager *manager,
static void
msd_housekeeping_manager_finalize (GObject *object)
{
- msd_housekeeping_manager_stop (MSD_HOUSEKEEPING_MANAGER (object));
+ MsdHousekeepingManager *manager = MSD_HOUSEKEEPING_MANAGER (object);
+ msd_housekeeping_manager_stop (manager);
+#if GLIB_CHECK_VERSION(2,62,0)
+ g_clear_signal_handler (&manager->config_listener_id,
+ manager->settings);
+#else
+ if (manager->config_listener_id != 0) {
+ g_signal_handler_disconnect (manager->settings,
+ manager->config_listener_id);
+ manager->config_listener_id = 0;
+ }
+#endif
+ g_object_unref (manager->settings);
+ manager->settings = NULL;
+
+ msd_ldsm_clean ();
+
G_OBJECT_CLASS (msd_housekeeping_manager_parent_class)->finalize (object);
}
@@ -293,11 +302,6 @@ msd_housekeeping_manager_stop (MsdHousekeepingManager *manager)
do_cleanup (manager);
}
}
-
- g_object_unref (manager->settings);
- manager->settings = NULL;
-
- msd_ldsm_clean ();
}
static void
@@ -311,6 +315,12 @@ msd_housekeeping_manager_class_init (MsdHousekeepingManagerClass *klass)
static void
msd_housekeeping_manager_init (MsdHousekeepingManager *manager)
{
+ msd_ldsm_setup (FALSE);
+
+ manager->settings = g_settings_new (THUMB_CACHE_SCHEMA);
+ manager->config_listener_id = g_signal_connect (manager->settings, "changed",
+ G_CALLBACK (settings_changed_callback),
+ manager);
}
MsdHousekeepingManager *
diff --git a/plugins/housekeeping/msd-housekeeping-manager.h b/plugins/housekeeping/msd-housekeeping-manager.h
index 5d481cc..40ed061 100644
--- a/plugins/housekeeping/msd-housekeeping-manager.h
+++ b/plugins/housekeeping/msd-housekeeping-manager.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Michael J. Chudobiak <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/housekeeping/msd-housekeeping-plugin.c b/plugins/housekeeping/msd-housekeeping-plugin.c
index 8a829fe..3d2b7ed 100644
--- a/plugins/housekeeping/msd-housekeeping-plugin.c
+++ b/plugins/housekeeping/msd-housekeeping-plugin.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Michael J. Chudobiak <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/housekeeping/msd-housekeeping-plugin.h b/plugins/housekeeping/msd-housekeeping-plugin.h
index 15be276..7fb155a 100644
--- a/plugins/housekeeping/msd-housekeeping-plugin.h
+++ b/plugins/housekeeping/msd-housekeeping-plugin.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Michael J. Chudobiak <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/plugins/housekeeping/msd-ldsm-dialog.c b/plugins/housekeeping/msd-ldsm-dialog.c
index a0e118d..3b06d09 100644
--- a/plugins/housekeeping/msd-ldsm-dialog.c
+++ b/plugins/housekeeping/msd-ldsm-dialog.c
@@ -2,6 +2,7 @@
*
* msd-ldsm-dialog.c
* Copyright (C) Chris Coulson 2009 <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* msd-ldsm-dialog.c is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
diff --git a/plugins/housekeeping/msd-ldsm-dialog.h b/plugins/housekeeping/msd-ldsm-dialog.h
index 8b95fb9..7b59c80 100644
--- a/plugins/housekeeping/msd-ldsm-dialog.h
+++ b/plugins/housekeeping/msd-ldsm-dialog.h
@@ -2,6 +2,7 @@
*
* msd-ldsm-dialog.c
* Copyright (C) Chris Coulson 2009 <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* msd-ldsm-dialog.c is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
diff --git a/plugins/housekeeping/msd-ldsm-trash-empty.c b/plugins/housekeeping/msd-ldsm-trash-empty.c
index 301b6dc..e331dda 100644
--- a/plugins/housekeeping/msd-ldsm-trash-empty.c
+++ b/plugins/housekeeping/msd-ldsm-trash-empty.c
@@ -3,6 +3,7 @@
* msd-ldsm-trash-empty.c
* Copyright (C) Chris Coulson 2009 <[email protected]>
* (C) Ryan Lortie 2008
+ * Copyright (C) 2012-2021 MATE Developers
*
* msd-ldsm-trash-empty.c is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
diff --git a/plugins/housekeeping/msd-ldsm-trash-empty.h b/plugins/housekeeping/msd-ldsm-trash-empty.h
index 478f0a7..52daa95 100644
--- a/plugins/housekeeping/msd-ldsm-trash-empty.h
+++ b/plugins/housekeeping/msd-ldsm-trash-empty.h
@@ -2,6 +2,7 @@
*
* msd-ldsm-trash-empty.h
* Copyright (C) Chris Coulson 2009 <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* msd-ldsm-trash-empty.h is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the