diff --git a/daemon/src/dbus/configurationmanager-introspec.xml b/daemon/src/dbus/configurationmanager-introspec.xml index 1934dc3f72d731ba900764faf7ac4d10bcf0833d..d86ffc2b6f1faa1ff91dddb168079237b0e2f048 100644 --- a/daemon/src/dbus/configurationmanager-introspec.xml +++ b/daemon/src/dbus/configurationmanager-introspec.xml @@ -607,6 +607,9 @@ <arg type="aa{ss}" name="entries" direction="out"/> </method> + <method name="clearHistory" tp:name-for-bindings="clearHistory"> + </method> + <signal name="accountsChanged" tp:name-for-bindings="accountsChanged"> </signal> diff --git a/daemon/src/dbus/configurationmanager.cpp b/daemon/src/dbus/configurationmanager.cpp index e8a494e1d427a1c7214174618ad2f497021c7545..09be098ff36b1b001e19391312e4a10e6006d2e9 100644 --- a/daemon/src/dbus/configurationmanager.cpp +++ b/daemon/src/dbus/configurationmanager.cpp @@ -336,6 +336,11 @@ int32_t ConfigurationManager::getHistoryLimit() return Manager::instance().getHistoryLimit(); } +void ConfigurationManager::clearHistory() +{ + return Manager::instance().clearHistory(); +} + void ConfigurationManager::setHistoryLimit(const int32_t& days) { Manager::instance().setHistoryLimit(days); diff --git a/daemon/src/dbus/configurationmanager.h b/daemon/src/dbus/configurationmanager.h index 2f77eca68025c80d7561d3fa98d06bfd0d6d585a..486421d43bd0a480b4e19870548424ddb2abc4b5 100644 --- a/daemon/src/dbus/configurationmanager.h +++ b/daemon/src/dbus/configurationmanager.h @@ -108,6 +108,7 @@ class ConfigurationManager : void setHistoryLimit(const int32_t& days); int32_t getHistoryLimit(); + void clearHistory(); int32_t getMailNotify(); void setMailNotify(); diff --git a/daemon/src/history/history.cpp b/daemon/src/history/history.cpp index 08964fcd95aa0b5869f1b9f71233728fee488606..a84b2128c0bd1d39df126a3c43ef41de7574dc5f 100644 --- a/daemon/src/history/history.cpp +++ b/daemon/src/history/history.cpp @@ -146,3 +146,8 @@ void History::addCall(Call *call, int limit) HistoryItem item(call->createHistoryEntry()); addEntry(item, limit); } + +void History::clear() +{ + items_.clear(); +} diff --git a/daemon/src/history/history.h b/daemon/src/history/history.h index 99827a849ae664caea20d85639403c39471b48d6..c4d9628e4ca1a9734009636df2e006a3e796374b 100644 --- a/daemon/src/history/history.h +++ b/daemon/src/history/history.h @@ -65,6 +65,7 @@ class History { std::vector<std::map<std::string, std::string> > getSerialized() const; void addCall(Call *call, int limit); + void clear(); private: void setPath(const std::string &path); /* If no path has been set, this will initialize path to a diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index b62560d3986a30ed539ce1e9937f40012051fae5..aa6d23e2f45731e3fd402f779c973070a1faddcf 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -2957,3 +2957,8 @@ void ManagerImpl::saveHistory() if (!history_->save()) ERROR("Manager: could not save history!"); } + +void ManagerImpl::clearHistory() +{ + history_->clear(); +} diff --git a/daemon/src/managerimpl.h b/daemon/src/managerimpl.h index 8d12afe0a0d0cc250b7e0afff3d25c0efee7bac8..222c62b36e77264c8951d4f00be811d5fc0ada25 100644 --- a/daemon/src/managerimpl.h +++ b/daemon/src/managerimpl.h @@ -1142,12 +1142,8 @@ class ManagerImpl { bool accountExists(const std::string& accountID); std::vector<std::map<std::string, std::string> > getHistory() const; + void clearHistory(); - /** - * Set a list of serialized history entries - * @param Vector of history entries - */ - void setHistorySerialized(const std::vector<std::map<std::string, std::string> > &history); /** * Get an account pointer * @param accountID account ID to get diff --git a/gnome/src/dbus/configurationmanager-introspec.xml b/gnome/src/dbus/configurationmanager-introspec.xml index 1934dc3f72d731ba900764faf7ac4d10bcf0833d..d86ffc2b6f1faa1ff91dddb168079237b0e2f048 100644 --- a/gnome/src/dbus/configurationmanager-introspec.xml +++ b/gnome/src/dbus/configurationmanager-introspec.xml @@ -607,6 +607,9 @@ <arg type="aa{ss}" name="entries" direction="out"/> </method> + <method name="clearHistory" tp:name-for-bindings="clearHistory"> + </method> + <signal name="accountsChanged" tp:name-for-bindings="accountsChanged"> </signal> diff --git a/gnome/src/dbus/dbus.c b/gnome/src/dbus/dbus.c index 9363ea42f7f8dabb101f476faa2941e6d4603fbf..cbf8537ddffa088a0432ab879dd7a2eef8eeb17f 100644 --- a/gnome/src/dbus/dbus.c +++ b/gnome/src/dbus/dbus.c @@ -1716,6 +1716,17 @@ dbus_get_history_limit(void) return (guint) days; } +void +dbus_clear_history(void) +{ + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_clear_history( + configurationManagerProxy, &error); + + if (error) + g_error_free(error); +} + void dbus_set_audio_manager(const gchar *api) { diff --git a/gnome/src/dbus/dbus.h b/gnome/src/dbus/dbus.h index a9b266f9e53061b6842555cecbc2726194986903..7a2574a1202006b239c50defc7dc60918089d723 100644 --- a/gnome/src/dbus/dbus.h +++ b/gnome/src/dbus/dbus.h @@ -477,6 +477,8 @@ void dbus_set_accounts_order (const gchar* order); */ GPtrArray *dbus_get_history(void); +void dbus_clear_history(void); + void sflphone_display_transfer_status (const gchar* message); /** diff --git a/gnome/src/uimanager.c b/gnome/src/uimanager.c index 2431e911d7deb935c4e4b07a454f03224c7059d9..3145a55ca6d2c1ec5e250e13747d5ea181557459 100644 --- a/gnome/src/uimanager.c +++ b/gnome/src/uimanager.c @@ -924,6 +924,7 @@ static void clear_history(void) { calllist_clean_history(); + dbus_clear_history(); } /** diff --git a/kde/src/dbus/configurationmanager-introspec.xml b/kde/src/dbus/configurationmanager-introspec.xml index 1934dc3f72d731ba900764faf7ac4d10bcf0833d..d86ffc2b6f1faa1ff91dddb168079237b0e2f048 100755 --- a/kde/src/dbus/configurationmanager-introspec.xml +++ b/kde/src/dbus/configurationmanager-introspec.xml @@ -607,6 +607,9 @@ <arg type="aa{ss}" name="entries" direction="out"/> </method> + <method name="clearHistory" tp:name-for-bindings="clearHistory"> + </method> + <signal name="accountsChanged" tp:name-for-bindings="accountsChanged"> </signal>