Skip to content
Snippets Groups Projects
Commit 029a6c9c authored by Pierre-Luc Beaudoin's avatar Pierre-Luc Beaudoin
Browse files

Fix crasher when adding a new account

parent d1e2e047
No related branches found
No related tags found
No related merge requests found
...@@ -258,10 +258,6 @@ show_account_window (account_t * a) ...@@ -258,10 +258,6 @@ show_account_window (account_t * a)
{ {
gchar* proto = (gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(entryProtocol)); gchar* proto = (gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(entryProtocol));
g_hash_table_replace(currentAccount->properties,
g_strdup("AccountID"),
g_strdup(curAccountID));
g_hash_table_replace(currentAccount->properties, g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_ENABLED), g_strdup(ACCOUNT_ENABLED),
g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(entryEnabled)) ? "TRUE": "FALSE")); g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(entryEnabled)) ? "TRUE": "FALSE"));
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <global.h> #include <global.h>
#include <configurationmanager.h> #include <configurationmanager.h>
#include <sstream>
#include "../manager.h" #include "../manager.h"
const char* ConfigurationManager::SERVER_PATH = "/org/sflphone/SFLphone/ConfigurationManager"; const char* ConfigurationManager::SERVER_PATH = "/org/sflphone/SFLphone/ConfigurationManager";
...@@ -49,8 +50,9 @@ void ...@@ -49,8 +50,9 @@ void
ConfigurationManager::addAccount( const std::map< ::DBus::String, ::DBus::String >& details ) ConfigurationManager::addAccount( const std::map< ::DBus::String, ::DBus::String >& details )
{ {
_debug("ConfigurationManager::addAccount received\n"); _debug("ConfigurationManager::addAccount received\n");
std::string accountID = (*details.find("AccountID")).second; std::stringstream accountID;
Manager::instance().setAccountDetails(accountID, details); accountID << "Account:" << time(NULL);
Manager::instance().setAccountDetails(accountID.str(), details);
} }
......
...@@ -1698,10 +1698,10 @@ ManagerImpl::setAccountDetails( const ::DBus::String& accountID, ...@@ -1698,10 +1698,10 @@ ManagerImpl::setAccountDetails( const ::DBus::String& accountID,
setConfig(accountID, SIP_AUTH_NAME, (*details.find(SIP_AUTH_NAME)).second); setConfig(accountID, SIP_AUTH_NAME, (*details.find(SIP_AUTH_NAME)).second);
setConfig(accountID, SIP_PASSWORD, (*details.find(SIP_PASSWORD)).second); setConfig(accountID, SIP_PASSWORD, (*details.find(SIP_PASSWORD)).second);
setConfig(accountID, SIP_HOST_PART, (*details.find(SIP_HOST_PART)).second); setConfig(accountID, SIP_HOST_PART, (*details.find(SIP_HOST_PART)).second);
setConfig(accountID, SIP_PROXY, (*details.find(SIP_PROXY)).second); //setConfig(accountID, SIP_PROXY, (*details.find(SIP_PROXY)).second);
setConfig(accountID, SIP_STUN_SERVER,(*details.find(SIP_STUN_SERVER)).second); //setConfig(accountID, SIP_STUN_SERVER,(*details.find(SIP_STUN_SERVER)).second);
setConfig(accountID, SIP_USE_STUN, //setConfig(accountID, SIP_USE_STUN,
(*details.find(SIP_USE_STUN)).second == "TRUE" ? "1" : "0"); // (*details.find(SIP_USE_STUN)).second == "TRUE" ? "1" : "0");
} }
else if (accountType == "IAX") { else if (accountType == "IAX") {
setConfig(accountID, IAX_FULL_NAME, (*details.find(IAX_FULL_NAME)).second); setConfig(accountID, IAX_FULL_NAME, (*details.find(IAX_FULL_NAME)).second);
...@@ -1715,7 +1715,7 @@ ManagerImpl::setAccountDetails( const ::DBus::String& accountID, ...@@ -1715,7 +1715,7 @@ ManagerImpl::setAccountDetails( const ::DBus::String& accountID,
saveConfig(); saveConfig();
unloadAccountMap(); unloadAccountMap();
loadAccountMap(); loadAccountMap();
/** @todo Then, reset the VoIP link with the new information */ if (_dbus) _dbus->getConfigurationManager()->accountsChanged();
} }
void void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment