Skip to content
Snippets Groups Projects
Commit a6bfa00e authored by Mathieu Leduc-Hamel's avatar Mathieu Leduc-Hamel
Browse files

[#2566] Correcting the flow of the KApplication loading

parent 07233388
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,6 @@
#include <QtGui/QStatusBar>
#include <QtGui/QCursor>
#include <KActionCollection>
#include <KNotification>
#include "sflphone_const.h"
#include "instance_interface_singleton.h"
......@@ -43,9 +42,7 @@ SFLPhone::SFLPhone(QWidget *parent)
initialized_(false),
view(new SFLPhoneView(this))
{
KNotification *notification = new KNotification( "contact online" );
notification->setText( "text" );
notification->sendEvent();
setupActions();
}
SFLPhone::~SFLPhone()
......@@ -187,6 +184,7 @@ void SFLPhone::setupActions()
{
QDir dir;
dir.cdUp();
dir.cdUp();
dir.cd("data");
rcFilePath = dir.filePath("sflphone-client-kdeui.rc");
}
......
......@@ -59,7 +59,6 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
{
setupUi(this);
ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance();
......
......@@ -23,14 +23,14 @@ SFLPhoneApplication::SFLPhoneApplication()
// Install a message handler, so KMESS_ASSERT won't do a exit(1) or abort()
// It makes debugging output on Windows disappear, so don't use it there
// Start remaining initialisation
initializePaths();
initializeMainWindow();
// test notif
KNotification *notification = new KNotification( "contact online" );
notification->setText( "text" );
notification->sendEvent();
// Start remaining initialisation
// initializePaths();
// initializeMainWindow();
}
......@@ -90,9 +90,10 @@ void SFLPhoneApplication::initializeMainWindow()
// Initialize KApplication
//setTopWidget( sflphoneWindow_ );
sflphoneWindow_->show();
// We found session data for the Contact List, to restore it
if( kapp->isSessionRestored() && restoredWindow != -1 )
/*if( kapp->isSessionRestored() && restoredWindow != -1 )
{
sflphoneWindow_->restore( restoredWindow, false );
}
......@@ -102,7 +103,7 @@ void SFLPhoneApplication::initializeMainWindow()
{
sflphoneWindow_->show();
}
}
}*/
}
......@@ -113,9 +114,10 @@ void SFLPhoneApplication::initializeMainWindow()
void SFLPhoneApplication::initializePaths()
{
// Add compile time paths as fallback
//KGlobal::dirs() -> addPrefix( SFLPHONE_PREFIX );
//KIconLoader::global() -> addAppDir( SFLPHONE_PREFIX "/share" );
KGlobal::dirs() -> addPrefix( QString("/home/mlhamel/Documents/sflphone/sflphone-client-kde/data/") );
KIconLoader::global() -> addAppDir( QString("/home/mlhamel/Documents/sflphone/sflphone-client-kde/data/") );
qDebug() << "KGlobal::dirs" << QString(DATA_INSTALL_DIR);
// Test whether the prefix is correct.
if( KGlobal::dirs()->findResource( "appdata", "icons/hi128-apps-sflphone-client-kde.png" ).isNull() )
{
......
......@@ -7,6 +7,7 @@
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <klocale.h>
#include <KNotification>
#include "AccountWizard.h"
#include "instance_interface_singleton.h"
......@@ -48,15 +49,20 @@ int main(int argc, char **argv)
//options.add("+[URL]", ki18n( "Document to open" ));
KCmdLineArgs::addCmdLineOptions(options);
SFLPhoneApplication app;
return app.exec();
//configuration dbus
registerCommTypes();
InstanceInterface & instance = InstanceInterfaceSingleton::getInstance();
instance.Register(getpid(), APP_NAME);
SFLPhoneApplication app;
KNotification *notification = new KNotification( "contact online" );
notification->setText( "text" );
notification->sendEvent();
return app.exec();
}
catch(const char * msg)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment