Skip to content
Snippets Groups Projects
Commit 4887e811 authored by Jérémy Quentin's avatar Jérémy Quentin
Browse files

Better handling of registration to the daemon.

parent a722da3c
Branches
Tags
No related merge requests found
......@@ -10,6 +10,7 @@
#include <KActionCollection>
#include "sflphone_const.h"
#include "instance_interface_singleton.h"
......@@ -100,13 +101,15 @@ void SFLPhone::setupActions()
bool SFLPhone::queryClose()
{
InstanceInterface & instance = InstanceInterfaceSingleton::getInstance();
qDebug() << "queryClose : " << view->listWidget_callList->count() << " calls open.";
if(view->listWidget_callList->count() > 0)
if(view->listWidget_callList->count() > 0 && instance.getRegistrationCount() <= 1)
{
qDebug() << "Attempting to quit when still having some calls open.";
view->getErrorWindow()->showMessage(tr2i18n("You still have some calls open. Please close all calls before quitting.", 0));
return false;
}
instance.Unregister(getpid());
return true;
}
......
......@@ -89,8 +89,8 @@ sflphone_kdeView::~sflphone_kdeView()
delete wizard;
delete callList;
delete errorWindow;
InstanceInterface & instance = InstanceInterfaceSingleton::getInstance();
instance.Unregister(getpid());
// InstanceInterface & instance = InstanceInterfaceSingleton::getInstance();
// instance.Unregister(getpid());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment