Commit 029a6c9c authored by Pierre-Luc Beaudoin's avatar Pierre-Luc Beaudoin

Fix crasher when adding a new account

parent d1e2e047
......@@ -258,10 +258,6 @@ show_account_window (account_t * a)
{
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_strdup(ACCOUNT_ENABLED),
g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(entryEnabled)) ? "TRUE": "FALSE"));
......
......@@ -19,6 +19,7 @@
#include <global.h>
#include <configurationmanager.h>
#include <sstream>
#include "../manager.h"
const char* ConfigurationManager::SERVER_PATH = "/org/sflphone/SFLphone/ConfigurationManager";
......@@ -49,8 +50,9 @@ void
ConfigurationManager::addAccount( const std::map< ::DBus::String, ::DBus::String >& details )
{
_debug("ConfigurationManager::addAccount received\n");
std::string accountID = (*details.find("AccountID")).second;
Manager::instance().setAccountDetails(accountID, details);
std::stringstream accountID;
accountID << "Account:" << time(NULL);
Manager::instance().setAccountDetails(accountID.str(), details);
}
......
......@@ -1698,10 +1698,10 @@ ManagerImpl::setAccountDetails( const ::DBus::String& accountID,
setConfig(accountID, SIP_AUTH_NAME, (*details.find(SIP_AUTH_NAME)).second);
setConfig(accountID, SIP_PASSWORD, (*details.find(SIP_PASSWORD)).second);
setConfig(accountID, SIP_HOST_PART, (*details.find(SIP_HOST_PART)).second);
setConfig(accountID, SIP_PROXY, (*details.find(SIP_PROXY)).second);
setConfig(accountID, SIP_STUN_SERVER,(*details.find(SIP_STUN_SERVER)).second);
setConfig(accountID, SIP_USE_STUN,
(*details.find(SIP_USE_STUN)).second == "TRUE" ? "1" : "0");
//setConfig(accountID, SIP_PROXY, (*details.find(SIP_PROXY)).second);
//setConfig(accountID, SIP_STUN_SERVER,(*details.find(SIP_STUN_SERVER)).second);
//setConfig(accountID, SIP_USE_STUN,
// (*details.find(SIP_USE_STUN)).second == "TRUE" ? "1" : "0");
}
else if (accountType == "IAX") {
setConfig(accountID, IAX_FULL_NAME, (*details.find(IAX_FULL_NAME)).second);
......@@ -1715,7 +1715,7 @@ ManagerImpl::setAccountDetails( const ::DBus::String& accountID,
saveConfig();
unloadAccountMap();
loadAccountMap();
/** @todo Then, reset the VoIP link with the new information */
if (_dbus) _dbus->getConfigurationManager()->accountsChanged();
}
void
......
Markdown is supported
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