From a6bfa00ee83b2f9ea267e44503911cc3714c0ab0 Mon Sep 17 00:00:00 2001 From: Mathieu Leduc-Hamel <mlhamel@arak4.(none)> Date: Wed, 9 Dec 2009 17:49:16 -0500 Subject: [PATCH] [#2566] Correcting the flow of the KApplication loading --- sflphone-client-kde/src/CallList.cpp | 4 ++-- sflphone-client-kde/src/SFLPhone.cpp | 6 ++---- sflphone-client-kde/src/SFLPhoneView.cpp | 1 - .../src/SFLPhoneapplication.cpp | 20 ++++++++++--------- sflphone-client-kde/src/main.cpp | 16 ++++++++++----- 5 files changed, 26 insertions(+), 21 deletions(-) diff --git a/sflphone-client-kde/src/CallList.cpp b/sflphone-client-kde/src/CallList.cpp index 615662de35..6894ae2f7c 100644 --- a/sflphone-client-kde/src/CallList.cpp +++ b/sflphone-client-kde/src/CallList.cpp @@ -37,7 +37,7 @@ CallList::CallList(QObject * parent) { calls->append(Call::buildExistingCall(callList[i])); } - MapStringString historyMap = configurationManager.getHistory().value(); + MapStringString historyMap = configurationManager.getHistory().value(); qDebug() << "Call History = " << historyMap; QMapIterator<QString, QString> i(historyMap); while (i.hasNext()) { @@ -50,7 +50,7 @@ CallList::CallList(QObject * parent) uint stopTimeStamp = param[3].toUInt(); QString account = param[4]; calls->insert(0, Call::buildHistoryCall(generateCallId(), startTimeStamp, stopTimeStamp, account, name, number, type)); - } + } } MapStringString CallList::getHistoryMap() diff --git a/sflphone-client-kde/src/SFLPhone.cpp b/sflphone-client-kde/src/SFLPhone.cpp index 7bfcf145cf..8ad4922bc9 100644 --- a/sflphone-client-kde/src/SFLPhone.cpp +++ b/sflphone-client-kde/src/SFLPhone.cpp @@ -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"); } diff --git a/sflphone-client-kde/src/SFLPhoneView.cpp b/sflphone-client-kde/src/SFLPhoneView.cpp index 978c0feb6a..89dbf65b0b 100644 --- a/sflphone-client-kde/src/SFLPhoneView.cpp +++ b/sflphone-client-kde/src/SFLPhoneView.cpp @@ -59,7 +59,6 @@ SFLPhoneView::SFLPhoneView(QWidget *parent) { setupUi(this); - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); diff --git a/sflphone-client-kde/src/SFLPhoneapplication.cpp b/sflphone-client-kde/src/SFLPhoneapplication.cpp index 43b555dc97..cdf3a1af33 100644 --- a/sflphone-client-kde/src/SFLPhoneapplication.cpp +++ b/sflphone-client-kde/src/SFLPhoneapplication.cpp @@ -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 -// test notif + // 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() ) { diff --git a/sflphone-client-kde/src/main.cpp b/sflphone-client-kde/src/main.cpp index 3010809d98..a5665460ea 100644 --- a/sflphone-client-kde/src/main.cpp +++ b/sflphone-client-kde/src/main.cpp @@ -7,6 +7,7 @@ #include <kcmdlineargs.h> #include <kaboutdata.h> #include <klocale.h> +#include <KNotification> #include "AccountWizard.h" #include "instance_interface_singleton.h" @@ -48,14 +49,19 @@ int main(int argc, char **argv) //options.add("+[URL]", ki18n( "Document to open" )); KCmdLineArgs::addCmdLineOptions(options); - SFLPhoneApplication app; - return app.exec(); - - //configuration dbus - registerCommTypes(); + //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) -- GitLab