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