From: David Sterba Date: Thu, 2 Oct 2014 00:03:22 +0000 (+0200) Subject: client: cleanup, reuse enum_configs in command_list_configs X-Git-Tag: v0.2.5~8^2^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F123%2Fhead;p=thirdparty%2Fsnapper.git client: cleanup, reuse enum_configs in command_list_configs --- diff --git a/client/snapper.cc b/client/snapper.cc index 9be54576..d1c9f0fa 100644 --- a/client/snapper.cc +++ b/client/snapper.cc @@ -184,27 +184,14 @@ command_list_configs(DBus::Connection* conn, Snapper* snapper) header.add(_("Subvolume")); table.setHeader(header); - if (no_dbus) - { - list config_infos = Snapper::getConfigs(); - for (list::const_iterator it = config_infos.begin(); it != config_infos.end(); ++it) - { - TableRow row; - row.add(it->getConfigName()); - row.add(it->getSubvolume()); - table.add(row); - } - } - else + list > configs = enum_configs(conn); + + for (list >::iterator it = configs.begin(); it != configs.end(); ++it) { - list config_infos = command_list_xconfigs(*conn); - for (list::const_iterator it = config_infos.begin(); it != config_infos.end(); ++it) - { - TableRow row; - row.add(it->config_name); - row.add(it->subvolume); - table.add(row); - } + TableRow row; + row.add(it->first); + row.add(it->second); + table.add(row); } cout << table;