-rw-r--r-- | kaddressbook/kabcore.cpp | 28 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 4 | ||||
-rw-r--r-- | kaddressbook/kaddressbookmain.cpp | 4 | ||||
-rw-r--r-- | kaddressbook/mainembedded.cpp | 5 |
4 files changed, 33 insertions, 8 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index b9830b1..c670b1f 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -404,7 +404,30 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const mMainWindow->toolBar()->show(); // we have a toolbar repainting error on the Zaurus when starting KA/Pi - QTimer::singleShot( 10, this , SLOT ( updateToolBar())); + //QTimer::singleShot( 10, this , SLOT ( updateToolBar())); + QTimer::singleShot( 100, this, SLOT ( loadDataAfterStart() )); +} +void KABCore::receiveStart( const QCString& cmsg, const QByteArray& data ) +{ + qDebug("KO: QCOP start message received: %s ", cmsg.data() ); + mCStringMess = cmsg; + mByteData = data; } +void KABCore::loadDataAfterStart() +{ + qDebug("KABCore::loadDataAfterStart() "); + ((StdAddressBook*)mAddressBook)->init( true ); + mViewManager->refreshView(); + +#ifndef DESKTOP_VERSION + disconnect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT (receiveStart ( const QCString &, const QByteArray & ))); + + QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); + if ( !mCStringMess.isEmpty() ) + ExternalAppHandler::instance()->appMessage( mCStringMess, mByteData ); +#endif + QTimer::singleShot( 10, this , SLOT ( updateToolBar())); + setCaptionBack(); +} void KABCore::updateToolBar() { @@ -2446,5 +2469,4 @@ void KABCore::removeVoice() } message(i18n("Refreshing view...") ); - qApp->processEvents(); mViewManager->refreshView( "" ); Addressee add; @@ -2478,5 +2500,4 @@ void KABCore::setFormattedName() if ( count %10 == 0 ) message(i18n("Changing contact #%1").arg( count ) ); - qApp->processEvents(); QString fName; if ( setpref.simple->isChecked() ) @@ -2498,5 +2519,4 @@ void KABCore::setFormattedName() } message(i18n("Refreshing view...") ); - qApp->processEvents(); if ( modified ) setModified( true ); diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index ceeeda7..42b7709 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -355,4 +355,5 @@ class KABCore : public QWidget, public KSyncInterface void contactSelected( const QPixmap &pixmap ); public slots: + void loadDataAfterStart(); void recieve(QString cmsg ); void getFile( bool success ); @@ -367,4 +368,5 @@ class KABCore : public QWidget, public KSyncInterface void updateMainWindow(); void receive( const QCString& cmsg, const QByteArray& data ); + void receiveStart( const QCString& cmsg, const QByteArray& data ); void toggleBeamReceive( ); void disableBR(bool); @@ -393,4 +395,6 @@ class KABCore : public QWidget, public KSyncInterface private: + QCString mCStringMess; + QByteArray mByteData; QString mEmailSourceChannel; QString mEmailSourceUID; diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp index 519dc92..8fe3ee0 100644 --- a/kaddressbook/kaddressbookmain.cpp +++ b/kaddressbook/kaddressbookmain.cpp @@ -84,6 +84,8 @@ KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainW #endif //KAB_EMBEDDED setAutoSaveSettings(); - qApp->processEvents(); mCore->restoreSettings(); +#ifndef DESKTOP_VERSION + QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), mCore, SLOT (receiveStart ( const QCString &, const QByteArray & ))); +#endif } diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index 93ba53c..2f3531d 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp @@ -80,7 +80,5 @@ int main( int argc, char **argv ) KAddressBookMain m ; //US MainWindow m; -#ifndef DESKTOP_VERSION - QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); -#endif + @@ -92,4 +90,5 @@ int main( int argc, char **argv ) m.show(); #endif + m.setCaption(i18n("Loading addressbook data ... please wait" )); a.exec(); #ifdef DESKTOP_VERSION |