From 1270cfdce5fb0bbedda8c60f070280f6a35715a4 Mon Sep 17 00:00:00 2001 From: Christer Ekholm Date: Sun, 19 Jul 2015 23:19:53 +0200 Subject: [PATCH] Pass arg verbose to cleanup functions. --- client/cleanup.cc | 12 ++++++------ client/cleanup.h | 6 +++--- client/snapper.cc | 6 +++--- client/systemd-helper.cc | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/client/cleanup.cc b/client/cleanup.cc index d80f1b8e..634c680d 100644 --- a/client/cleanup.cc +++ b/client/cleanup.cc @@ -94,7 +94,7 @@ is_important(XSnapshots::const_iterator it1) bool -do_cleanup_number(DBus::Connection& conn, const string& config_name) +do_cleanup_number(DBus::Connection& conn, const string& config_name, bool verbose) { time_t min_age = 1800; size_t limit = 50; @@ -153,7 +153,7 @@ do_cleanup_number(DBus::Connection& conn, const string& config_name) { list nums; nums.push_back((*it)->getNum()); - command_delete_xsnapshots(conn, config_name, nums, false); + command_delete_xsnapshots(conn, config_name, nums, verbose); } return true; @@ -232,7 +232,7 @@ is_first_hourly(list::const_iterator first, bool -do_cleanup_timeline(DBus::Connection& conn, const string& config_name) +do_cleanup_timeline(DBus::Connection& conn, const string& config_name, bool verbose) { time_t min_age = 1800; size_t limit_hourly = 10; @@ -318,7 +318,7 @@ do_cleanup_timeline(DBus::Connection& conn, const string& config_name) { list nums; nums.push_back((*it)->getNum()); - command_delete_xsnapshots(conn, config_name, nums, false); + command_delete_xsnapshots(conn, config_name, nums, verbose); } return true; @@ -326,7 +326,7 @@ do_cleanup_timeline(DBus::Connection& conn, const string& config_name) bool -do_cleanup_empty_pre_post(DBus::Connection& conn, const string& config_name) +do_cleanup_empty_pre_post(DBus::Connection& conn, const string& config_name, bool verbose) { time_t min_age = 1800; @@ -369,7 +369,7 @@ do_cleanup_empty_pre_post(DBus::Connection& conn, const string& config_name) { list nums; nums.push_back((*it)->getNum()); - command_delete_xsnapshots(conn, config_name, nums, false); + command_delete_xsnapshots(conn, config_name, nums, verbose); } return true; diff --git a/client/cleanup.h b/client/cleanup.h index 0c5e3f09..9d00a4d2 100644 --- a/client/cleanup.h +++ b/client/cleanup.h @@ -21,10 +21,10 @@ bool -do_cleanup_number(DBus::Connection& conn, const string& config_name); +do_cleanup_number(DBus::Connection& conn, const string& config_name, bool verbose); bool -do_cleanup_timeline(DBus::Connection& conn, const string& config_name); +do_cleanup_timeline(DBus::Connection& conn, const string& config_name, bool verbose); bool -do_cleanup_empty_pre_post(DBus::Connection& conn, const string& config_name); +do_cleanup_empty_pre_post(DBus::Connection& conn, const string& config_name, bool verbose); diff --git a/client/snapper.cc b/client/snapper.cc index 0ee04311..4c2ad31c 100644 --- a/client/snapper.cc +++ b/client/snapper.cc @@ -1420,15 +1420,15 @@ command_cleanup(DBus::Connection* conn, Snapper* snapper) if (cleanup == "number") { - do_cleanup_number(*conn, config_name); + do_cleanup_number(*conn, config_name, verbose); } else if (cleanup == "timeline") { - do_cleanup_timeline(*conn, config_name); + do_cleanup_timeline(*conn, config_name, verbose); } else if (cleanup == "empty-pre-post") { - do_cleanup_empty_pre_post(*conn, config_name); + do_cleanup_empty_pre_post(*conn, config_name, verbose); } else { diff --git a/client/systemd-helper.cc b/client/systemd-helper.cc index db0a6687..3c76371f 100644 --- a/client/systemd-helper.cc +++ b/client/systemd-helper.cc @@ -67,19 +67,19 @@ cleanup(DBus::Connection* conn) map::const_iterator pos1 = config_info.raw.find("NUMBER_CLEANUP"); if (pos1 != config_info.raw.end() && pos1->second == "yes") { - do_cleanup_number(*conn, config_info.config_name); + do_cleanup_number(*conn, config_info.config_name, false); } map::const_iterator pos2 = config_info.raw.find("TIMELINE_CLEANUP"); if (pos2 != config_info.raw.end() && pos2->second == "yes") { - do_cleanup_timeline(*conn, config_info.config_name); + do_cleanup_timeline(*conn, config_info.config_name, false); } map::const_iterator pos3 = config_info.raw.find("EMPTY_PRE_POST_CLEANUP"); if (pos3 != config_info.raw.end() && pos3->second == "yes") { - do_cleanup_empty_pre_post(*conn, config_info.config_name); + do_cleanup_empty_pre_post(*conn, config_info.config_name, false); } } } -- 2.47.3