Commit ae6afcdc authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #7264: clear history over dbus

parent 8f9fd2fb
......@@ -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>
......
......@@ -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);
......
......@@ -108,6 +108,7 @@ class ConfigurationManager :
void setHistoryLimit(const int32_t& days);
int32_t getHistoryLimit();
void clearHistory();
int32_t getMailNotify();
void setMailNotify();
......
......@@ -146,3 +146,8 @@ void History::addCall(Call *call, int limit)
HistoryItem item(call->createHistoryEntry());
addEntry(item, limit);
}
void History::clear()
{
items_.clear();
}
......@@ -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
......
......@@ -2957,3 +2957,8 @@ void ManagerImpl::saveHistory()
if (!history_->save())
ERROR("Manager: could not save history!");
}
void ManagerImpl::clearHistory()
{
history_->clear();
}
......@@ -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
......
......@@ -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>
......
......@@ -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)
{
......
......@@ -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);
/**
......
......@@ -924,6 +924,7 @@ static void
clear_history(void)
{
calllist_clean_history();
dbus_clear_history();
}
/**
......
......@@ -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>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment