summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-01-17 19:49:42 (UTC)
committer zautrix <zautrix>2005-01-17 19:49:42 (UTC)
commit522486966ecf041a6e49913b6e420d58d4284837 (patch) (side-by-side diff)
treed15da3e6ef9ec4638eba4aaf9f14ef0c5eaecd04 /kaddressbook
parent32479683283fc9f20d369ac9671ba0f8a33d3381 (diff)
downloadkdepimpi-522486966ecf041a6e49913b6e420d58d4284837.zip
kdepimpi-522486966ecf041a6e49913b6e420d58d4284837.tar.gz
kdepimpi-522486966ecf041a6e49913b6e420d58d4284837.tar.bz2
const fixes
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp33
-rw-r--r--kaddressbook/kabcore.h2
2 files changed, 28 insertions, 7 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index d393660..42e147f 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1374,8 +1374,8 @@ void KABCore::save()
QString text = i18n( "There was an error while attempting to save\n the "
"address book. Please check that some \nother application is "
"not using it. " );
- message(i18n("Saving ... please wait! "));
- qApp->processEvents();
+ message(i18n("Saving ... please wait! "), false);
+ //qApp->processEvents();
#ifndef KAB_EMBEDDED
KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook );
if ( !b || !b->save() ) {
@@ -2297,11 +2297,15 @@ void KABCore::manageCategories( )
return;
}
int count = 0;
+ int cc = 0;
message( i18n("Please wait, processing categories..."));
if ( cp->addCat() ) {
KABC::AddressBook::Iterator it;
QStringList catList = KABPrefs::instance()->mCustomCategories;
for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
+ ++cc;
+ if ( cc %10 == 0)
+ message(i18n("Processing contact #%1").arg(cc));
QStringList catIncList = (*it).categories();
int i;
for( i = 0; i< catIncList.count(); ++i ) {
@@ -2322,6 +2326,9 @@ void KABCore::manageCategories( )
QStringList newCatList;
KABC::AddressBook::Iterator it;
for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
+ ++cc;
+ if ( cc %10 == 0)
+ message(i18n("Processing contact #%1").arg(cc));
QStringList catIncList = (*it).categories();
int i;
if ( catIncList.count() ) {
@@ -2374,7 +2381,9 @@ void KABCore::setFormattedName()
KABC::AddressBook::Iterator it;
for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
if ( (*it).tagged() ) {
- message(i18n("Changing contact #%1").arg( ++count ) );
+ ++count;
+ if ( count %10 == 0 )
+ message(i18n("Changing contact #%1").arg( count ) );
qApp->processEvents();
QString fName;
if ( setpref.simple->isChecked() )
@@ -2392,6 +2401,7 @@ void KABCore::setFormattedName()
}
}
message(i18n("Refreshing view...") );
+ qApp->processEvents();
mViewManager->refreshView( "" );
Addressee add;
mDetails->setAddressee( add );
@@ -3189,15 +3199,20 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource)
AddressBook abLocal( resource,"syncContact");
bool syncOK = false;
+ message(i18n("Loading DTM address data..."), false);
if ( abLocal.load() ) {
qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1());
mGlobalSyncMode = SYNC_MODE_EXTERNAL;
+ message(i18n("Sync preprocessing..."),false);
abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false );
+ message(i18n("Synchronizing..."),false);
syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
if ( syncOK ) {
if ( syncManager->mWriteBackFile ) {
abLocal.removeSyncAddressees( false );
+ message(i18n("Saving DTM address data..."),false);
abLocal.saveAB();
+ message(i18n("Sync postprocessing..."),false);
abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
}
} else
@@ -3205,16 +3220,22 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource)
setModified();
}
abLocal.removeResources();
- if ( syncOK )
+ if ( syncOK ) {
mViewManager->refreshView();
+ message(i18n("DTM syncing finished."));
+ }
disableBR( false );
return syncOK;
}
-void KABCore::message( QString m )
+void KABCore::message( QString m, bool startTimer)
{
topLevelWidget()->setCaption( m );
- mMessageTimer->start( 20000, true );
+ qApp->processEvents();
+ if ( startTimer )
+ mMessageTimer->start( 15000, true );
+ else
+ mMessageTimer->stop();
}
bool KABCore::syncPhone()
{
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index ecfe6e9..786549a 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -500,7 +500,7 @@ class KABCore : public QWidget, public KSyncInterface
virtual bool syncExternal(KSyncManager* manager, QString resource);
virtual void removeSyncInfo( QString syncProfile);
bool syncPhone();
- void message( QString m );
+ void message( QString m , bool startTimer = true);
// LR *******************************
// sync stuff!