Skip to content
Snippets Groups Projects
Commit 456fd3ac authored by Emmanuel Lepage's avatar Emmanuel Lepage
Browse files

[ #11798 ] Implement basic signal handling, it does not seem to be enough, but it help

parent 244fed54
No related branches found
No related tags found
No related merge requests found
...@@ -68,8 +68,6 @@ SFLPhoneApplication::~SFLPhoneApplication() ...@@ -68,8 +68,6 @@ SFLPhoneApplication::~SFLPhoneApplication()
instance.connection().disconnectFromBus(instance.connection().baseService()); instance.connection().disconnectFromBus(instance.connection().baseService());
} }
/** /**
* Return the sflphone window * Return the sflphone window
*/ */
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
//System //System
#include <unistd.h> #include <unistd.h>
#include <signal.h>
//Qt //Qt
#include <QtGui/QAction> #include <QtGui/QAction>
...@@ -54,6 +55,13 @@ static const char description[] = "A KDE 4 Client for SFLphone"; ...@@ -54,6 +55,13 @@ static const char description[] = "A KDE 4 Client for SFLphone";
static const char version[] = "1.1.0"; static const char version[] = "1.1.0";
SFLPhoneApplication* app;
void quitOnSignal(int signal)
{
Q_UNUSED(signal);
app->quit();
}
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
try try
...@@ -81,20 +89,25 @@ int main(int argc, char **argv) ...@@ -81,20 +89,25 @@ int main(int argc, char **argv)
//configuration dbus //configuration dbus
TreeWidgetCallModel::init(); TreeWidgetCallModel::init();
SFLPhoneApplication app; app = new SFLPhoneApplication();
SFLPhone* sflphoneWindow_ = new SFLPhone(); SFLPhone* sflphoneWindow_ = new SFLPhone();
if( ! sflphoneWindow_->initialize() ) { if( ! sflphoneWindow_->initialize() ) {
exit(1); exit(1);
return 1; return 1;
}; };
signal(SIGINT , quitOnSignal);
signal(SIGTERM , quitOnSignal);
sflphoneWindow_->show(); sflphoneWindow_->show();
int retVal = app.exec(); int retVal = app->exec();
ConfigurationSkeleton* conf = ConfigurationSkeleton::self(); ConfigurationSkeleton* conf = ConfigurationSkeleton::self();
conf->writeConfig(); conf->writeConfig();
delete sflphoneWindow_; delete sflphoneWindow_;
delete app;
return retVal; return retVal;
} }
catch(const char * msg) catch(const char * msg)
......
...@@ -244,6 +244,7 @@ void HistoryTreeItem::callAgain() ...@@ -244,6 +244,7 @@ void HistoryTreeItem::callAgain()
} }
Call* call = SFLPhone::model()->addDialingCall(m_Name, SFLPhone::app()->model()->getCurrentAccountId()); Call* call = SFLPhone::model()->addDialingCall(m_Name, SFLPhone::app()->model()->getCurrentAccountId());
call->setCallNumber(m_PhoneNumber); call->setCallNumber(m_PhoneNumber);
call->setPeerName(m_pPeerNameL->text());
call->actionPerformed(CALL_ACTION_ACCEPT); call->actionPerformed(CALL_ACTION_ACCEPT);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment