summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index b9830b1..c670b1f 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -400,15 +400,38 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
#ifndef DESKTOP_VERSION
infrared = 0;
#endif
//toggleBeamReceive( );
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()
{
static int iii = 0;
++iii;
mMainWindow->toolBar()->repaintMe();
if ( iii < 4 )
@@ -2442,13 +2465,12 @@ void KABCore::removeVoice()
for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
if ( (*it).tagged() ) {
(*it).removeVoice();
}
}
message(i18n("Refreshing view...") );
- qApp->processEvents();
mViewManager->refreshView( "" );
Addressee add;
mDetails->setAddressee( add );
message(i18n("Remove voice completed!") );
@@ -2474,13 +2496,12 @@ void KABCore::setFormattedName()
if ( (*it).uid().left( 2 ) == "la" )
if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") )
continue;
++count;
if ( count %10 == 0 )
message(i18n("Changing contact #%1").arg( count ) );
- qApp->processEvents();
QString fName;
if ( setpref.simple->isChecked() )
fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName );
else if ( setpref.full->isChecked() )
fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName );
else if ( setpref.reverse->isChecked() )
@@ -2494,13 +2515,12 @@ void KABCore::setFormattedName()
(*it).setChanged( true );
modified = true;
(*it).setRevision( QDateTime::currentDateTime() );
}
}
message(i18n("Refreshing view...") );
- qApp->processEvents();
if ( modified )
setModified( true );
Addressee add;
mDetails->setAddressee( add );
if ( count == 0 )
message(i18n("No contact changed!") );