author | zautrix <zautrix> | 2005-01-17 19:49:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-17 19:49:42 (UTC) |
commit | 522486966ecf041a6e49913b6e420d58d4284837 (patch) (side-by-side diff) | |
tree | d15da3e6ef9ec4638eba4aaf9f14ef0c5eaecd04 | |
parent | 32479683283fc9f20d369ac9671ba0f8a33d3381 (diff) | |
download | kdepimpi-522486966ecf041a6e49913b6e420d58d4284837.zip kdepimpi-522486966ecf041a6e49913b6e420d58d4284837.tar.gz kdepimpi-522486966ecf041a6e49913b6e420d58d4284837.tar.bz2 |
const fixes
-rw-r--r-- | kabc/addressbook.cpp | 4 | ||||
-rw-r--r-- | kabc/addressbook.h | 2 | ||||
-rw-r--r-- | kabc/addressee.cpp | 10 | ||||
-rw-r--r-- | kabc/addressee.h | 10 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 33 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 2 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 5 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 2 | ||||
-rw-r--r-- | microkde/kidmanager.cpp | 10 | ||||
-rw-r--r-- | microkde/kidmanager.h | 10 |
10 files changed, 55 insertions, 33 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 4de7da2..9e61261 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -960,9 +960,9 @@ bool AddressBook::containsExternalUid( const QString& uid ) } return false; } -Addressee AddressBook::findByExternUid( const QString& uid , const QString& profile ) +const Addressee AddressBook::findByExternUid( const QString& uid , const QString& profile ) const { - Iterator it; + ConstIterator it; for ( it = begin(); it != end(); ++it ) { if ( uid == (*it).getID( profile ) ) return (*it); diff --git a/kabc/addressbook.h b/kabc/addressbook.h index 2351add..18c03b5 100644 --- a/kabc/addressbook.h +++ b/kabc/addressbook.h @@ -304,7 +304,7 @@ class AddressBook : public QObject QStringList uidList(); void removeSyncAddressees( bool removeDeleted = false ); void mergeAB( AddressBook *aBook, const QString& profile, bool isSubset ); - Addressee findByExternUid( const QString& uid , const QString& profile ); + const Addressee findByExternUid( const QString& uid , const QString& profile ) const; bool containsExternalUid( const QString& uid ); void preExternSync( AddressBook* aBook, const QString& csd, bool isSubset ); diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index d60cd6b..3b238f5 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -589,7 +589,7 @@ int Addressee::tempSyncStat() const return mData->mTempSyncStat; } -QString Addressee::getID( const QString & prof) +const QString Addressee::getID( const QString & prof) const { return KIdManager::getId ( mData->mExternalId, prof ); } @@ -602,7 +602,7 @@ void Addressee::setCsum( const QString & prof , const QString & id ) //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); } -QString Addressee::getCsum( const QString & prof) +const QString Addressee::getCsum( const QString & prof) const { return KIdManager::getCsum ( mData->mExternalId, prof ); } @@ -613,7 +613,7 @@ void Addressee::setIDStr( const QString & s ) mData->mExternalId = s; } -QString Addressee::IDStr() const +const QString Addressee::IDStr() const { return mData->mExternalId; } @@ -626,7 +626,7 @@ void Addressee::setExternalUID( const QString &id ) mData->externalUID = id; } -QString Addressee::externalUID() const +const QString Addressee::externalUID() const { return mData->externalUID; } @@ -653,7 +653,7 @@ void Addressee::setUid( const QString &id ) mData->uid = id; } -QString Addressee::uid() const +const QString Addressee::uid() const { if ( mData->uid.isEmpty() ) mData->uid = KApplication::randomString( 10 ); diff --git a/kabc/addressee.h b/kabc/addressee.h index 08d2f56..8051fec 100644 --- a/kabc/addressee.h +++ b/kabc/addressee.h @@ -100,11 +100,11 @@ class Addressee void setTempSyncStat(int id); int tempSyncStat() const; void setIDStr( const QString & ); - QString IDStr() const; + const QString IDStr() const; void setID( const QString &, const QString & ); - QString getID( const QString & ); + const QString getID( const QString & ) const; void setCsum( const QString &, const QString & ); - QString getCsum( const QString & ); + const QString getCsum( const QString & ) const ; void removeID(const QString &); void computeCsum(const QString &dev); ulong getCsum4List( const QStringList & attList); @@ -113,7 +113,7 @@ class Addressee */ bool isEmpty() const; void setExternalUID( const QString &id ); - QString externalUID() const; + const QString externalUID() const; void setOriginalExternalUID( const QString &id ); QString originalExternalUID() const; void mergeContact( const Addressee& ad, bool isSubSet ); @@ -131,7 +131,7 @@ class Addressee /** Return unique identifier. */ - QString uid() const; + const QString uid() const; /** Return translated label for uid field. */ 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! diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 6c1f444..f488a07 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -994,16 +994,17 @@ void KSyncManager::showProgressBar(int percentage, QString caption, int total) { bar->setCaption (caption); bar->setTotalSteps ( total ) ; - bar->show(); } - + bar->raise(); bar->setProgress( percentage ); + qApp->processEvents(); } void KSyncManager::hideProgressBar() { bar->hide(); + qApp->processEvents(); } bool KSyncManager::isProgressBarCanceled() diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 2101bbb..3db58ec 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp @@ -185,7 +185,7 @@ void KSyncPrefsDialog::setupSyncAlgTab() new QLabel ( i18n("Incoming calendar filter:"), fibo2 ); mFilterInCal = new QComboBox( fibo2 ); fibo2 = new QVBox ( gb5 ); - new QLabel ( i18n("Incoming adressbook filter:"), fibo2 ); + new QLabel ( i18n("Incoming addressbook filter:"), fibo2 ); mFilterInAB = new QComboBox( fibo2 ); mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); diff --git a/microkde/kidmanager.cpp b/microkde/kidmanager.cpp index e687e5d..d712771 100644 --- a/microkde/kidmanager.cpp +++ b/microkde/kidmanager.cpp @@ -6,7 +6,7 @@ KIdManager::KIdManager() } // :profilename;12;id_withLen12;123456: // 123456 is the csum -QString KIdManager::setId (const QString& idString,const QString& prof,const QString& idvalue ) +const QString KIdManager::setId (const QString& idString,const QString& prof,const QString& idvalue ) { int startProf; int startIDnum; @@ -25,7 +25,7 @@ QString KIdManager::setId (const QString& idString,const QString& prof,const QSt //qDebug("setID:profile:%s*retval:%s*idvalue:%s* ", prof.latin1(), newIDString.latin1() ,idvalue.latin1() ); return newIDString; } -QString KIdManager::getId (const QString& idString,const QString& prof ) +const QString KIdManager::getId (const QString& idString,const QString& prof ) { int startProf; int startIDnum; @@ -44,7 +44,7 @@ QString KIdManager::getId (const QString& idString,const QString& prof ) } -QString KIdManager::removeId (const QString& idString,const QString& prof ) +const QString KIdManager::removeId (const QString& idString,const QString& prof ) { int startProf; int startIDnum; @@ -64,7 +64,7 @@ QString KIdManager::removeId (const QString& idString,const QString& prof ) return newIDString; } -QString KIdManager::setCsum (const QString& idString,const QString& prof,const QString& idCsum ) +const QString KIdManager::setCsum (const QString& idString,const QString& prof,const QString& idCsum ) { int startProf; int startIDnum; @@ -83,7 +83,7 @@ QString KIdManager::setCsum (const QString& idString,const QString& prof,const Q //qDebug("setCsum:profile:%s*retval:%s*idCsum:%s* ", prof.latin1(), newIDString.latin1() ,idCsum.latin1() ); return newIDString; } -QString KIdManager::getCsum (const QString& idString,const QString& prof ) +const QString KIdManager::getCsum (const QString& idString,const QString& prof ) { int startProf; int startIDnum; diff --git a/microkde/kidmanager.h b/microkde/kidmanager.h index 00580a0..9786c9f 100644 --- a/microkde/kidmanager.h +++ b/microkde/kidmanager.h @@ -9,11 +9,11 @@ class KIdManager : public QObject Q_OBJECT public: KIdManager( ); - static QString setId (const QString& idString,const QString& id,const QString& idvalue ) ; - static QString getId (const QString& idString,const QString& id ) ; - static QString removeId (const QString& idString,const QString& id ) ; - static QString setCsum (const QString& idString,const QString& id,const QString& idvalue ) ; - static QString getCsum (const QString& idString,const QString& id ) ; + static const QString setId (const QString& idString,const QString& id,const QString& idvalue ) ; + static const QString getId (const QString& idString,const QString& id ) ; + static const QString removeId (const QString& idString,const QString& id ) ; + static const QString setCsum (const QString& idString,const QString& id,const QString& idvalue ) ; + static const QString getCsum (const QString& idString,const QString& id ) ; static bool getNumbers (const QString& idString,const QString& id, int &startProf, int &startIDnum, int &startIDnumlen,int &startID, int& lenID, int &startCsum, int &lenCsum, int & endall) ; private: |