Subject: [akonadi] /: Build with QT_NO_KEYWORDS Git commit 5c349d3577c15315cf3a3f1d08995b86ccaef460 by Christophe Giboudeaux. Committed on 22/02/2012 at 16:31. Pushed by cgiboudeaux into branch 'master'. Build with QT_NO_KEYWORDS M +1 -0 CMakeLists.txt M +1 -1 agentserver/agentserver.cpp M +1 -1 libs/imapset.cpp M +2 -2 libs/notificationmessage.cpp M +1 -1 libs/tests/imapparserbenchmark.cpp M +1 -1 libs/tests/notificationmessagetest.h M +7 -7 libs/xdgbasedirs.cpp M +2 -2 qsqlite/src/qsql_sqlite.cpp M +7 -7 server/control/agentinstance.cpp M +1 -1 server/control/agentinstance.h M +18 -18 server/control/agentmanager.cpp M +1 -1 server/control/agentprocessinstance.h M +1 -1 server/control/agenttype.cpp M +6 -6 server/control/processcontrol.cpp M +2 -2 server/src/cachecleaner.cpp M +1 -1 server/src/cachecleaner.h M +7 -7 server/src/dbustracer.cpp M +1 -1 server/src/debuginterface.h M +3 -3 server/src/handler.cpp M +4 -4 server/src/handler/akappend.cpp M +3 -3 server/src/handler/append.cpp M +2 -2 server/src/handler/capability.cpp M +4 -4 server/src/handler/colcopy.cpp M +3 -3 server/src/handler/copy.cpp M +5 -5 server/src/handler/create.cpp M +2 -2 server/src/handler/delete.cpp M +5 -5 server/src/handler/expunge.cpp M +3 -3 server/src/handler/fetchhelper.cpp M +1 -1 server/src/handler/link.cpp M +5 -5 server/src/handler/list.cpp M +1 -1 server/src/handler/login.cpp M +3 -3 server/src/handler/logout.cpp M +3 -3 server/src/handler/modify.cpp M +1 -1 server/src/handler/move.cpp M +1 -1 server/src/handler/remove.cpp M +1 -1 server/src/handler/search.cpp M +2 -2 server/src/handler/searchpersistent.cpp M +4 -4 server/src/handler/select.cpp M +2 -2 server/src/handler/status.cpp M +3 -3 server/src/handler/store.cpp M +4 -4 server/src/handlerhelper.cpp M +1 -1 server/src/intervalcheck.h M +1 -1 server/src/nepomuk/dbusoperators.cpp M +1 -1 server/src/nepomuk/queryserviceclient.cpp M +3 -3 server/src/notificationmanager.cpp M +1 -1 server/src/notificationsource.h M +7 -7 server/src/preprocessormanager.cpp M +1 -1 server/src/resourcemanager.cpp M +4 -4 server/src/search/searchmanager.cpp M +1 -1 server/src/search/searchmanager.h M +2 -2 server/src/search/xesamsearchengine.cpp M +1 -1 server/src/storage/collectionqueryhelper.cpp M +10 -10 server/src/storage/datastore.cpp M +3 -3 server/src/storage/dbinitializer.cpp M +4 -4 server/src/storage/dbinitializer_p.cpp M +1 -1 server/src/storage/dbupdater.cpp M +5 -5 server/src/storage/itemretrievaljob.cpp M +2 -2 server/src/storage/itemretrievaljob.h M +3 -3 server/src/storage/itemretrievalmanager.cpp M +2 -2 server/src/storage/itemretrievalmanager.h M +3 -3 server/src/storage/itemretriever.cpp M +2 -2 server/src/storage/notificationcollector.cpp M +7 -7 server/src/storage/querybuilder.cpp M +1 -1 server/src/storage/queryhelper.cpp M +6 -6 server/src/storagejanitor.cpp M +2 -2 server/src/storagejanitor.h M +1 -1 server/src/xesamsearch.cpp M +1 -1 server/tests/unittest/akdbustest.cpp M +1 -1 server/tests/unittest/akstandarddirstest.cpp M +1 -1 server/tests/unittest/dbconfigtest.cpp M +1 -1 server/tests/unittest/handlerhelpertest.cpp M +1 -1 server/tests/unittest/handlertest.cpp M +1 -1 server/tests/unittest/querybuildertest.h M +1 -1 server/tests/unittest/scopetest.cpp M +1 -1 shared/akapplication.h http://commits.kde.org/akonadi/5c349d3577c15315cf3a3f1d08995b86ccaef460 diff --git a/CMakeLists.txt b/CMakeLists.txt index 57721d0..120b3a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,6 +243,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER MATCHES "icc" OR (CMAKE_CXX_COMP endif() add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII) +add_definitions(-DQT_NO_KEYWORDS) add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) diff --git a/agentserver/agentserver.cpp b/agentserver/agentserver.cpp index 604f59b..50b2f27 100644 --- a/agentserver/agentserver.cpp +++ b/agentserver/agentserver.cpp @@ -66,7 +66,7 @@ void AgentServer::startAgent( const QString &identifier, const QString &typeIden akDebug() << Q_FUNC_INFO << identifier << typeIdentifier << fileName; //First try to load it staticly - foreach ( QObject *plugin, QPluginLoader::staticInstances() ) { + Q_FOREACH ( QObject *plugin, QPluginLoader::staticInstances() ) { if ( plugin->objectName() == fileName ) { AgentThread* thread = new AgentThread( identifier, plugin, this ); m_agents.insert( identifier, thread ); diff --git a/libs/imapset.cpp b/libs/imapset.cpp index f06231c..d55e0ca 100644 --- a/libs/imapset.cpp +++ b/libs/imapset.cpp @@ -223,7 +223,7 @@ void ImapSet::add( const ImapInterval &interval ) QByteArray ImapSet::toImapSequenceSet() const { QList<QByteArray> rv; - foreach ( const ImapInterval &interval, d->intervals ) + Q_FOREACH ( const ImapInterval &interval, d->intervals ) rv << interval.toImapSequence(); return ImapParser::join( rv, "," ); diff --git a/libs/notificationmessage.cpp b/libs/notificationmessage.cpp index 75207ad..af5cfe7 100644 --- a/libs/notificationmessage.cpp +++ b/libs/notificationmessage.cpp @@ -350,7 +350,7 @@ QDBusArgument& operator<<( QDBusArgument &arg, const NotificationMessage &msg ) // encode destination resource in parts, as a backward compat hack itemParts.push_back( QString::fromLatin1( msg.destinationResource() ) ); } else { - foreach ( const QByteArray &itemPart, msg.itemParts() ) + Q_FOREACH ( const QByteArray &itemPart, msg.itemParts() ) itemParts.append( QString::fromLatin1( itemPart ) ); } @@ -392,7 +392,7 @@ const QDBusArgument& operator>>( const QDBusArgument &arg, NotificationMessage & // decode destination resource, which is stored in parts as a backward compat hack msg.setDestinationResource( l.first().toLatin1() ); } else { - foreach ( const QString &itemPart, l ) + Q_FOREACH ( const QString &itemPart, l ) itemParts.insert( itemPart.toLatin1() ); } diff --git a/libs/tests/imapparserbenchmark.cpp b/libs/tests/imapparserbenchmark.cpp index 3a72748..0507150 100644 --- a/libs/tests/imapparserbenchmark.cpp +++ b/libs/tests/imapparserbenchmark.cpp @@ -27,7 +27,7 @@ Q_DECLARE_METATYPE( QList<QByteArray> ) class ImapParserBenchmark : public QObject { Q_OBJECT - private slots: + private Q_SLOTS: void quote_data() { QTest::addColumn<QByteArray>( "input" ); diff --git a/libs/tests/notificationmessagetest.h b/libs/tests/notificationmessagetest.h index c25c743..39de17c 100644 --- a/libs/tests/notificationmessagetest.h +++ b/libs/tests/notificationmessagetest.h @@ -25,7 +25,7 @@ class NotificationMessageTest : public QObject { Q_OBJECT - private slots: + private Q_SLOTS: void testCompress(); void testCompress2(); void testCompress3(); diff --git a/libs/xdgbasedirs.cpp b/libs/xdgbasedirs.cpp index 6307b70..acc316b 100644 --- a/libs/xdgbasedirs.cpp +++ b/libs/xdgbasedirs.cpp @@ -162,7 +162,7 @@ QStringList XdgBaseDirs::systemPathList( const char *resource ) proc.start( QLatin1String( "kde4-config" ), args ); if ( proc.waitForStarted() && proc.waitForFinished() && proc.exitCode() == 0 ) { proc.setReadChannel( QProcess::StandardOutput ); - foreach ( const QString &basePath, splitPathList( QString::fromLocal8Bit( proc.readLine().trimmed() ) ) ) { + Q_FOREACH ( const QString &basePath, splitPathList( QString::fromLocal8Bit( proc.readLine().trimmed() ) ) ) { const QString path = basePath + QDir::separator() + QLatin1String( "share" ); if ( !dataDirs.contains( path ) ) dataDirs << path; @@ -229,7 +229,7 @@ QString XdgBaseDirs::findResourceFile( const char *resource, const QString &relP const QStringList pathList = systemPathList( resource ); - foreach ( const QString &path, pathList ) { + Q_FOREACH ( const QString &path, pathList ) { fileInfo = QFileInfo( path + QLatin1Char('/' ) + relPath ); if ( fileInfo.exists() && fileInfo.isFile() && fileInfo.isReadable() ) { return fileInfo.absoluteFilePath(); @@ -316,7 +316,7 @@ QString XdgBaseDirs::findPluginFile( const QString &relPath, const QStringList & QStringList pluginDirs = instance()->systemPathList( "QT_PLUGIN_PATH", AKONADILIB ":" AKONADILIB "/qt4/plugins/:" AKONADILIB "/kde4/:" AKONADILIB "/kde4/plugins/:/usr/lib/qt4/plugins/" ); if ( QCoreApplication::instance() != 0 ) { - foreach ( const QString &libraryPath, QCoreApplication::instance()->libraryPaths() ) { + Q_FOREACH ( const QString &libraryPath, QCoreApplication::instance()->libraryPaths() ) { if ( !pluginDirs.contains( libraryPath ) ) { pluginDirs << libraryPath; } @@ -332,7 +332,7 @@ QString XdgBaseDirs::findPluginFile( const QString &relPath, const QStringList & proc.start( QLatin1String( "kde4-config" ), args ); if ( proc.waitForStarted() && proc.waitForFinished() && proc.exitCode() == 0 ) { proc.setReadChannel( QProcess::StandardOutput ); - foreach ( const QString &path, splitPathList( QString::fromLocal8Bit( proc.readLine().trimmed() ) ) ) { + Q_FOREACH ( const QString &path, splitPathList( QString::fromLocal8Bit( proc.readLine().trimmed() ) ) ) { if ( !pluginDirs.contains( path ) ) pluginDirs.append( path ); } @@ -348,7 +348,7 @@ QString XdgBaseDirs::findPluginFile( const QString &relPath, const QStringList & const QString pluginName = relPath + QLatin1String( ".so" ); #endif - foreach ( const QString &path, instance()->mPluginDirs ) { + Q_FOREACH ( const QString &path, instance()->mPluginDirs ) { const QFileInfo fileInfo( path + QDir::separator() + pluginName ); // resolve symlinks, happens eg. with Maemo optify @@ -373,7 +373,7 @@ QString XdgBaseDirs::findResourceDir( const char *resource, const QString &relPa return fullPath; } - foreach ( const QString &path, systemPathList( resource ) ) { + Q_FOREACH ( const QString &path, systemPathList( resource ) ) { fileInfo = QFileInfo( path + QLatin1Char( '/' ) + relPath ); if ( fileInfo.exists() && fileInfo.isDir() && fileInfo.isReadable() ) { return fileInfo.absoluteFilePath(); @@ -394,7 +394,7 @@ QStringList XdgBaseDirs::findAllResourceDirs( const char *resource, const QStrin resultList << fileInfo.absoluteFilePath(); } - foreach ( const QString &path, systemPathList( resource ) ) { + Q_FOREACH ( const QString &path, systemPathList( resource ) ) { fileInfo = QFileInfo( path + QLatin1Char( '/' ) + relPath ); if ( fileInfo.exists() && fileInfo.isDir() && fileInfo.isReadable() ) { const QString absPath = fileInfo.absoluteFilePath(); diff --git a/qsqlite/src/qsql_sqlite.cpp b/qsqlite/src/qsql_sqlite.cpp index 072fa81..c1e9508 100644 --- a/qsqlite/src/qsql_sqlite.cpp +++ b/qsqlite/src/qsql_sqlite.cpp @@ -509,7 +509,7 @@ static int qGetSqliteTimeout(QString opts) enum { DefaultTimeout = 5000 }; opts.remove(QLatin1Char(' ')); - foreach(const QString &option, opts.split(QLatin1Char(';'))) { + Q_FOREACH(const QString &option, opts.split(QLatin1Char(';'))) { if (option.startsWith(QLatin1String("QSQLITE_BUSY_TIMEOUT="))) { bool ok; int nt = option.mid(21).toInt(&ok); @@ -523,7 +523,7 @@ static int qGetSqliteTimeout(QString opts) static int qGetSqliteOpenMode(QString opts) { opts.remove(QLatin1Char(' ')); - foreach(const QString &option, opts.split(QLatin1Char(';'))) { + Q_FOREACH(const QString &option, opts.split(QLatin1Char(';'))) { if (option == QLatin1String("QSQLITE_OPEN_READONLY")) return SQLITE_OPEN_READONLY; } diff --git a/server/control/agentinstance.cpp b/server/control/agentinstance.cpp index 2069f0b..7eb4a1f 100644 --- a/server/control/agentinstance.cpp +++ b/server/control/agentinstance.cpp @@ -106,12 +106,12 @@ void AgentInstance::statusChanged(int status, const QString & statusMsg) return; mStatus = status; mStatusMessage = statusMsg; - emit mManager->agentInstanceStatusChanged( mIdentifier, mStatus, mStatusMessage ); + Q_EMIT mManager->agentInstanceStatusChanged( mIdentifier, mStatus, mStatusMessage ); } void AgentInstance::advancedStatusChanged( const QVariantMap &status ) { - emit mManager->agentInstanceAdvancedStatusChanged( mIdentifier, status ); + Q_EMIT mManager->agentInstanceAdvancedStatusChanged( mIdentifier, status ); } void AgentInstance::statusStateChanged(int status) @@ -129,17 +129,17 @@ void AgentInstance::percentChanged(int percent) if ( mPercent == percent ) return; mPercent = percent; - emit mManager->agentInstanceProgressChanged( mIdentifier, mPercent, QString() ); + Q_EMIT mManager->agentInstanceProgressChanged( mIdentifier, mPercent, QString() ); } void AgentInstance::warning(const QString & msg) { - emit mManager->agentInstanceWarning( mIdentifier, msg ); + Q_EMIT mManager->agentInstanceWarning( mIdentifier, msg ); } void AgentInstance::error(const QString & msg) { - emit mManager->agentInstanceError( mIdentifier, msg ); + Q_EMIT mManager->agentInstanceError( mIdentifier, msg ); } void AgentInstance::onlineChanged(bool state) @@ -147,7 +147,7 @@ void AgentInstance::onlineChanged(bool state) if ( mOnline == state ) return; mOnline = state; - emit mManager->agentInstanceOnlineChanged( mIdentifier, state ); + Q_EMIT mManager->agentInstanceOnlineChanged( mIdentifier, state ); } void AgentInstance::resourceNameChanged(const QString & name) @@ -155,7 +155,7 @@ void AgentInstance::resourceNameChanged(const QString & name) if ( name == mResourceName ) return; mResourceName = name; - emit mManager->agentInstanceNameChanged( mIdentifier, name ); + Q_EMIT mManager->agentInstanceNameChanged( mIdentifier, name ); } void AgentInstance::refreshAgentStatus() diff --git a/server/control/agentinstance.h b/server/control/agentinstance.h index 196e13f..837627b 100644 --- a/server/control/agentinstance.h +++ b/server/control/agentinstance.h @@ -85,7 +85,7 @@ class AgentInstance : public QObject bool obtainResourceInterface(); bool obtainPreprocessorInterface(); - protected slots: + protected Q_SLOTS: void statusChanged( int status, const QString &statusMsg ); void advancedStatusChanged( const QVariantMap &status ); void statusStateChanged( int status ); diff --git a/server/control/agentmanager.cpp b/server/control/agentmanager.cpp index 7df1d8c..4579cd5 100644 --- a/server/control/agentmanager.cpp +++ b/server/control/agentmanager.cpp @@ -106,13 +106,13 @@ void AgentManager::continueStartup() first = false; readPluginInfos(); - foreach ( const AgentType &info, mAgents ) - emit agentTypeAdded( info.identifier ); + Q_FOREACH ( const AgentType &info, mAgents ) + Q_EMIT agentTypeAdded( info.identifier ); const QStringList pathList = pluginInfoPathList(); #ifndef QT_NO_DEBUG - foreach ( const QString &path, pathList ) { + Q_FOREACH ( const QString &path, pathList ) { QFileSystemWatcher *watcher = new QFileSystemWatcher( this ); watcher->addPath( path ); @@ -122,7 +122,7 @@ void AgentManager::continueStartup() #endif load(); - foreach ( const AgentType &info, mAgents ) + Q_FOREACH ( const AgentType &info, mAgents ) ensureAutoStart( info ); // register the real service name once everything is up an running @@ -141,7 +141,7 @@ AgentManager::~AgentManager() void AgentManager::cleanup() { - foreach ( const AgentInstance::Ptr &instance, mAgentInstances ) + Q_FOREACH ( const AgentInstance::Ptr &instance, mAgentInstances ) instance->quit(); mAgentInstances.clear(); @@ -304,7 +304,7 @@ void AgentManager::removeAgentInstance( const QString &identifier ) akError() << Q_FUNC_INFO << "Agent instance" << identifier << "has no interface!"; } - emit agentInstanceRemoved( identifier ); + Q_EMIT agentInstanceRemoved( identifier ); } QString AgentManager::agentInstanceType( const QString &identifier ) @@ -444,14 +444,14 @@ void AgentManager::updatePluginInfos() const QHash<QString, AgentType> oldInfos = mAgents; readPluginInfos(); - foreach ( const AgentType &oldInfo, oldInfos ) { + Q_FOREACH ( const AgentType &oldInfo, oldInfos ) { if ( !mAgents.contains( oldInfo.identifier ) ) - emit agentTypeRemoved( oldInfo.identifier ); + Q_EMIT agentTypeRemoved( oldInfo.identifier ); } - foreach ( const AgentType &newInfo, mAgents ) { + Q_FOREACH ( const AgentType &newInfo, mAgents ) { if ( !oldInfos.contains( newInfo.identifier ) ) { - emit agentTypeAdded( newInfo.identifier ); + Q_EMIT agentTypeAdded( newInfo.identifier ); ensureAutoStart( newInfo ); } } @@ -467,7 +467,7 @@ void AgentManager::readPluginInfos() const QStringList pathList = pluginInfoPathList(); - foreach ( const QString &path, pathList ) { + Q_FOREACH ( const QString &path, pathList ) { const QDir directory( path, QLatin1String("*.desktop") ); readPluginInfos( directory ); } @@ -567,12 +567,12 @@ void AgentManager::save() { QSettings file( AkStandardDirs::agentConfigFile( Akonadi::XdgBaseDirs::WriteOnly ), QSettings::IniFormat ); - foreach ( const AgentType &info, mAgents ) + Q_FOREACH ( const AgentType &info, mAgents ) info.save( &file ); file.beginGroup( QLatin1String("Instances") ); file.remove( QString() ); - foreach ( const AgentInstance::Ptr &instance, mAgentInstances ) { + Q_FOREACH ( const AgentInstance::Ptr &instance, mAgentInstances ) { file.beginGroup( instance->identifier() ); file.setValue( QLatin1String("AgentType"), instance->agentType() ); file.endGroup(); @@ -617,7 +617,7 @@ void AgentManager::serviceOwnerChanged( const QString &name, const QString&, con return; if ( !restarting ) - emit agentInstanceAdded( agentIdentifier ); + Q_EMIT agentInstanceAdded( agentIdentifier ); break; } @@ -774,9 +774,9 @@ void AgentManager::agentExeChanged( const QString &fileName ) if ( !QFile::exists( fileName ) ) return; - foreach ( const AgentType &type, mAgents ) { + Q_FOREACH ( const AgentType &type, mAgents ) { if ( fileName.endsWith( type.exec ) ) { - foreach ( const AgentInstance::Ptr &instance, mAgentInstances ) { + Q_FOREACH ( const AgentInstance::Ptr &instance, mAgentInstances ) { if ( instance->agentType() == type.identifier ) instance->restartWhenIdle(); } @@ -799,7 +799,7 @@ void AgentManager::registerAgentAtServer( const QString &agentIdentifier, const void AgentManager::addSearch( const QString &query, const QString &queryLanguage, qint64 resultCollectionId ) { akDebug() << "AgentManager::addSearch" << query << queryLanguage << resultCollectionId; - foreach ( const AgentInstance::Ptr &instance, mAgentInstances ) { + Q_FOREACH ( const AgentInstance::Ptr &instance, mAgentInstances ) { const AgentType type = mAgents.value( instance->agentType() ); if ( type.capabilities.contains( AgentType::CapabilitySearch ) && instance->searchInterface() ) instance->searchInterface()->addSearch( query, queryLanguage, resultCollectionId ); @@ -809,7 +809,7 @@ void AgentManager::addSearch( const QString &query, const QString &queryLanguage void AgentManager::removeSearch( quint64 resultCollectionId ) { akDebug() << "AgentManager::removeSearch" << resultCollectionId; - foreach ( const AgentInstance::Ptr &instance, mAgentInstances ) { + Q_FOREACH ( const AgentInstance::Ptr &instance, mAgentInstances ) { const AgentType type = mAgents.value( instance->agentType() ); if ( type.capabilities.contains( AgentType::CapabilitySearch ) && instance->searchInterface() ) instance->searchInterface()->removeSearch( resultCollectionId ); diff --git a/server/control/agentprocessinstance.h b/server/control/agentprocessinstance.h index 615bf08..3ea381e 100644 --- a/server/control/agentprocessinstance.h +++ b/server/control/agentprocessinstance.h @@ -40,7 +40,7 @@ class AgentProcessInstance : public AgentInstance virtual void restartWhenIdle(); virtual void configure(qlonglong windowId); - private slots: + private Q_SLOTS: void failedToStart(); private: diff --git a/server/control/agenttype.cpp b/server/control/agenttype.cpp index ab8e6ab..08d4e1a 100644 --- a/server/control/agenttype.cpp +++ b/server/control/agenttype.cpp @@ -44,7 +44,7 @@ bool AgentType::load(const QString & fileName, AgentManager * manager) QSettings file( fileName, QSettings::IniFormat ); file.beginGroup( QLatin1String("Desktop Entry") ); - foreach(const QString& key, file.allKeys() ) { + Q_FOREACH(const QString& key, file.allKeys() ) { if ( key.startsWith( QLatin1String("Name[") ) ) { QString lang = key.mid( 5, key.length()-6); name.insert( lang, QString::fromUtf8( file.value( key ).toByteArray() ) ); diff --git a/server/control/processcontrol.cpp b/server/control/processcontrol.cpp index fc3d974..efbb308 100644 --- a/server/control/processcontrol.cpp +++ b/server/control/processcontrol.cpp @@ -111,7 +111,7 @@ void ProcessControl::slotFinished( int exitCode, QProcess::ExitStatus exitStatus if ( !mFailedToStart && mCrashCount <= s_maxCrashCount ) { qWarning( "Application '%s' crashed! %d restarts left.", qPrintable( mApplication ), s_maxCrashCount - mCrashCount ); start(); - emit restarted(); + Q_EMIT restarted(); } else { if ( mFailedToStart ) { qWarning( "Application '%s' failed to start!", qPrintable( mApplication ) ); @@ -119,7 +119,7 @@ void ProcessControl::slotFinished( int exitCode, QProcess::ExitStatus exitStatus qWarning( "Application '%s' crashed too often. Giving up!", qPrintable( mApplication ) ); } mPolicy = StopOnCrash; - emit unableToStart(); + Q_EMIT unableToStart(); return; } } else { @@ -152,14 +152,14 @@ void ProcessControl::slotFinished( int exitCode, QProcess::ExitStatus exitStatus if ( mCrashCount > s_maxCrashCount ) { qWarning() << mApplication << "crashed too often and will not be restarted!"; mPolicy = StopOnCrash; - emit unableToStart(); + Q_EMIT unableToStart(); return; } ++mCrashCount; QTimer::singleShot( 60000, this, SLOT(resetCrashCount()) ); if ( !mFailedToStart ) { // don't try to start an unstartable application start(); - emit restarted(); + Q_EMIT restarted(); } } } else { @@ -176,7 +176,7 @@ void ProcessControl::slotFinished( int exitCode, QProcess::ExitStatus exitStatus static bool listContains( const QStringList &list, const QString &pattern ) { - foreach ( const QString &s, list ) { + Q_FOREACH ( const QString &s, list ) { if ( s.contains( pattern ) ) return true; } @@ -216,7 +216,7 @@ void ProcessControl::start() if ( !mProcess.waitForStarted( ) ) { qWarning( "ProcessControl: Unable to start application '%s' (%s)", qPrintable( mApplication ), qPrintable( mProcess.errorString() ) ); - emit unableToStart(); + Q_EMIT unableToStart(); return; } diff --git a/server/src/cachecleaner.cpp b/server/src/cachecleaner.cpp index 315af75..ee79045 100644 --- a/server/src/cachecleaner.cpp +++ b/server/src/cachecleaner.cpp @@ -71,7 +71,7 @@ void CacheCleaner::cleanCache() qb.addValueCondition( QString::fromLatin1( "substr( %1, 1, 4 )" ).arg( Part::nameFullColumnName() ), Query::Equals, QLatin1String( "PLD:" ) ); qb.addValueCondition( PimItem::dirtyFullColumnName(), Query::Equals, false ); QStringList localParts; - foreach ( const QString &partName, collection.cachePolicyLocalParts().split( QLatin1String( " " ) ) ) { + Q_FOREACH ( const QString &partName, collection.cachePolicyLocalParts().split( QLatin1String( " " ) ) ) { if ( partName.startsWith( QLatin1String( "PLD:" ) ) ) localParts.append( partName ); else @@ -87,7 +87,7 @@ void CacheCleaner::cleanCache() akDebug() << "found" << parts.count() << "item parts to expire in collection" << collection.name(); // clear data field - foreach ( Part part, parts ) { + Q_FOREACH ( Part part, parts ) { if ( !PartHelper::truncate( part ) ) akDebug() << "failed to update item part" << part.id(); } diff --git a/server/src/cachecleaner.h b/server/src/cachecleaner.h index efd8432..4c1d22a 100644 --- a/server/src/cachecleaner.h +++ b/server/src/cachecleaner.h @@ -43,7 +43,7 @@ class CacheCleaner : public QThread protected: virtual void run(); - private slots: + private Q_SLOTS: void cleanCache(); private: diff --git a/server/src/dbustracer.cpp b/server/src/dbustracer.cpp index 439ed71..44a2879 100644 --- a/server/src/dbustracer.cpp +++ b/server/src/dbustracer.cpp @@ -36,37 +36,37 @@ DBusTracer::~DBusTracer() void DBusTracer::beginConnection( const QString &identifier, const QString &msg ) { - emit connectionStarted( identifier, msg ); + Q_EMIT connectionStarted( identifier, msg ); } void DBusTracer::endConnection( const QString &identifier, const QString &msg ) { - emit connectionEnded( identifier, msg ); + Q_EMIT connectionEnded( identifier, msg ); } void DBusTracer::connectionInput( const QString &identifier, const QByteArray &msg ) { - emit connectionDataInput( identifier, QString::fromUtf8( msg ) ); + Q_EMIT connectionDataInput( identifier, QString::fromUtf8( msg ) ); } void DBusTracer::connectionOutput( const QString &identifier, const QByteArray &msg ) { - emit connectionDataOutput( identifier, QString::fromUtf8( msg ) ); + Q_EMIT connectionDataOutput( identifier, QString::fromUtf8( msg ) ); } void DBusTracer::signal( const QString &signalName, const QString &msg ) { - emit signalEmitted( signalName, msg ); + Q_EMIT signalEmitted( signalName, msg ); } void DBusTracer::warning( const QString &componentName, const QString &msg ) { - emit warningEmitted( componentName, msg ); + Q_EMIT warningEmitted( componentName, msg ); } void DBusTracer::error( const QString &componentName, const QString &msg ) { - emit errorEmitted( componentName, msg ); + Q_EMIT errorEmitted( componentName, msg ); } #include "dbustracer.moc" diff --git a/server/src/debuginterface.h b/server/src/debuginterface.h index a1070ab..1106cf7 100644 --- a/server/src/debuginterface.h +++ b/server/src/debuginterface.h @@ -33,7 +33,7 @@ class DebugInterface : public QObject public: explicit DebugInterface( QObject *parent = 0 ); - public slots: + public Q_SLOTS: Q_SCRIPTABLE QString tracer() const; Q_SCRIPTABLE void setTracer( const QString &tracer ); diff --git a/server/src/handler.cpp b/server/src/handler.cpp index 105f859..88a6439 100644 --- a/server/src/handler.cpp +++ b/server/src/handler.cpp @@ -187,7 +187,7 @@ bool Akonadi::Handler::failureResponse( const QByteArray &failureMessage ) response.setTag( tag() ); response.setFailure(); response.setString( failureMessage ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return false; } @@ -202,7 +202,7 @@ bool Handler::successResponse(const QByteArray &successMessage) response.setTag( tag() ); response.setSuccess(); response.setString( successMessage ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } @@ -233,7 +233,7 @@ bool UnknownCommandHandler::parseStream() response.setString( "Unrecognized command: " + mCommand ); m_streamParser->readUntilCommandEnd(); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } diff --git a/server/src/handler/akappend.cpp b/server/src/handler/akappend.cpp index ed598c3..5ee1984 100644 --- a/server/src/handler/akappend.cpp +++ b/server/src/handler/akappend.cpp @@ -61,7 +61,7 @@ bool Akonadi::AkAppend::commit() QString remote_id; QString remote_revision; QList<QByteArray> flags; - foreach( const QByteArray &flag, m_flags ) { + Q_FOREACH( const QByteArray &flag, m_flags ) { if ( flag.startsWith( "\\MimeType" ) ) { int pos1 = flag.indexOf( '[' ); int pos2 = flag.indexOf( ']', pos1 ); @@ -135,11 +135,11 @@ bool Akonadi::AkAppend::commit() response.setTag( tag() ); response.setUserDefined(); response.setString( "[UIDNEXT " + QByteArray::number( item.id() ) + ']' ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); response.setSuccess(); response.setString( "Append completed" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } @@ -218,7 +218,7 @@ bool AkAppend::parseStream() // chop up literal data in parts int pos = 0; // traverse through part data now QPair<QByteArray, QPair<qint64, int> > partSpec; - foreach( partSpec, partSpecs ) { + Q_FOREACH( partSpec, partSpecs ) { // wrap data into a part Part part; part.setName( QLatin1String( partSpec.first ) ); diff --git a/server/src/handler/append.cpp b/server/src/handler/append.cpp index 2d89595..127cbfa 100644 --- a/server/src/handler/append.cpp +++ b/server/src/handler/append.cpp @@ -97,7 +97,7 @@ bool Append::commit() QString remote_id; QString remote_revision; QList<QByteArray> flags; - foreach( const QByteArray &flag, m_flags ) { + Q_FOREACH( const QByteArray &flag, m_flags ) { if ( flag.startsWith( "\\MimeType" ) ) { int pos1 = flag.indexOf( '[' ); int pos2 = flag.indexOf( ']', pos1 ); @@ -200,11 +200,11 @@ bool Append::commit() response.setTag( tag() ); response.setUserDefined(); response.setString( res ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); response.setSuccess(); response.setString( "Append completed" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } diff --git a/server/src/handler/capability.cpp b/server/src/handler/capability.cpp index 196c367..0ddd359 100644 --- a/server/src/handler/capability.cpp +++ b/server/src/handler/capability.cpp @@ -38,12 +38,12 @@ bool Capability::parseStream() Response response; response.setString( "CAPABILITY IMAP4 IMAP4rev1" ); response.setUntagged(); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); response.setSuccess(); response.setTag( tag() ); response.setString( "CAPABILITY completed" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } diff --git a/server/src/handler/colcopy.cpp b/server/src/handler/colcopy.cpp index ef08586..417df4c 100644 --- a/server/src/handler/colcopy.cpp +++ b/server/src/handler/colcopy.cpp @@ -50,12 +50,12 @@ bool ColCopy::copyCollection(const Collection & source, const Collection & targe if ( !db->appendCollection( col ) ) return false; - foreach ( const MimeType &mt, source.mimeTypes() ) { + Q_FOREACH ( const MimeType &mt, source.mimeTypes() ) { if ( !col.addMimeType( mt ) ) return false; } - foreach ( const CollectionAttribute &attr, source.attributes() ) { + Q_FOREACH ( const CollectionAttribute &attr, source.attributes() ) { CollectionAttribute newAttr = attr; newAttr.setId( -1 ); newAttr.setCollectionId( col.id() ); @@ -64,13 +64,13 @@ bool ColCopy::copyCollection(const Collection & source, const Collection & targe } // copy sub-collections - foreach ( const Collection &child, source.children() ) { + Q_FOREACH ( const Collection &child, source.children() ) { if ( !copyCollection( child, col ) ) return false; } // copy items - foreach ( const PimItem &item, source.items() ) { + Q_FOREACH ( const PimItem &item, source.items() ) { if ( !copyItem( item, col ) ) return false; } diff --git a/server/src/handler/copy.cpp b/server/src/handler/copy.cpp index 85233a9..b67e4d3 100644 --- a/server/src/handler/copy.cpp +++ b/server/src/handler/copy.cpp @@ -47,7 +47,7 @@ bool Copy::copyItem(const PimItem & item, const Collection & target) newItem.setRemoteRevision( QString() ); newItem.setCollectionId( target.id() ); Part::List parts; - foreach ( const Part &part, item.parts() ) { + Q_FOREACH ( const Part &part, item.parts() ) { Part newPart( part ); newPart.setData(PartHelper::translateData( newPart.data(), part.external() ) ); newPart.setPimItemId( -1 ); @@ -57,7 +57,7 @@ bool Copy::copyItem(const PimItem & item, const Collection & target) DataStore *store = connection()->storageBackend(); if ( !store->appendPimItem( parts, item.mimeType(), target, QDateTime::currentDateTime(), QString(), QString(), newItem ) ) return false; - foreach ( const Flag &flag, item.flags() ) { + Q_FOREACH ( const Flag &flag, item.flags() ) { if ( !newItem.addFlag( flag ) ) return false; } @@ -90,7 +90,7 @@ bool Copy::parseStream() DataStore *store = connection()->storageBackend(); Transaction transaction( store ); - foreach ( const PimItem &item, items ) { + Q_FOREACH ( const PimItem &item, items ) { if ( !copyItem( item, targetCollection ) ) return failureResponse( "Unable to copy item" ); } diff --git a/server/src/handler/create.cpp b/server/src/handler/create.cpp index a011b37..1a8be48 100644 --- a/server/src/handler/create.cpp +++ b/server/src/handler/create.cpp @@ -93,7 +93,7 @@ bool Create::parseStream() // check if parent can contain a sub-folder parentContentTypes = parent.mimeTypes(); bool found = false; - foreach ( const MimeType &mt, parentContentTypes ) { + Q_FOREACH ( const MimeType &mt, parentContentTypes ) { if ( mt.name() == QLatin1String( "inode/directory" ) ) { found = true; break; @@ -150,10 +150,10 @@ bool Create::parseStream() QStringList effectiveMimeTypes; if ( mimeTypesSet ) { - foreach ( const QByteArray &b, mimeTypes ) + Q_FOREACH ( const QByteArray &b, mimeTypes ) effectiveMimeTypes << QString::fromUtf8( b ); } else { - foreach ( const MimeType &mt, parentContentTypes ) + Q_FOREACH ( const MimeType &mt, parentContentTypes ) effectiveMimeTypes << mt.name(); } if ( !db->appendMimeTypeForCollection( collection.id(), effectiveMimeTypes ) ) @@ -161,7 +161,7 @@ bool Create::parseStream() // store user defined attributes typedef QPair<QByteArray,QByteArray> QByteArrayPair; - foreach ( const QByteArrayPair &attr, userDefAttrs ) { + Q_FOREACH ( const QByteArrayPair &attr, userDefAttrs ) { if ( !db->addCollectionAttribute( collection, attr.first, attr.second ) ) return failureResponse( "Unable to add collection attribute." ); } @@ -173,7 +173,7 @@ bool Create::parseStream() db->activeCachePolicy( collection ); const QByteArray b = HandlerHelper::collectionToByteArray( collection ); response.setString( b ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); if ( !transaction.commit() ) return failureResponse( "Unable to commit transaction." ); diff --git a/server/src/handler/delete.cpp b/server/src/handler/delete.cpp index faf84d0..f239a70 100644 --- a/server/src/handler/delete.cpp +++ b/server/src/handler/delete.cpp @@ -45,7 +45,7 @@ Delete::Delete( Scope scope ) : bool Delete::deleteRecursive(Collection & col) { Collection::List children = col.children(); - foreach ( Collection child, children ) { + Q_FOREACH ( Collection child, children ) { if ( !deleteRecursive( child ) ) return false; } @@ -93,7 +93,7 @@ bool Delete::parseStream() Response response; response.setTag( tag() ); response.setString( "DELETE completed" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } diff --git a/server/src/handler/expunge.cpp b/server/src/handler/expunge.cpp index 1f7e0f6..d3c4a2a 100644 --- a/server/src/handler/expunge.cpp +++ b/server/src/handler/expunge.cpp @@ -50,7 +50,7 @@ bool Expunge::parseStream() response.setError(); response.setString( "\\DELETED flag unknown" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } @@ -61,19 +61,19 @@ bool Expunge::parseStream() if ( qb.exec() ) { const QVector<PimItem> items = qb.result(); - foreach ( const PimItem &item, items ) { + Q_FOREACH ( const PimItem &item, items ) { if ( store->cleanupPimItem( item ) ) { response.setUntagged(); // IMAP protocol violation: should actually be the sequence number response.setString( QByteArray::number( item.id() ) + " EXPUNGE" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); } else { response.setTag( tag() ); response.setError(); response.setString( "internal error" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } } @@ -88,7 +88,7 @@ bool Expunge::parseStream() response.setSuccess(); response.setString( "EXPUNGE completed" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } diff --git a/server/src/handler/fetchhelper.cpp b/server/src/handler/fetchhelper.cpp index 4389a01..56cd9fa 100644 --- a/server/src/handler/fetchhelper.cpp +++ b/server/src/handler/fetchhelper.cpp @@ -196,7 +196,7 @@ bool FetchHelper::parseStream( const QByteArray &responseIdentifier ) // retrieve missing parts QStringList partList, payloadList; - foreach( const QByteArray &b, mRequestedParts ) { + Q_FOREACH( const QByteArray &b, mRequestedParts ) { // filter out non-part attributes if ( b == "REV" || b == "FLAGS" || b == "UID" || b == "REMOTEID" ) continue; @@ -347,7 +347,7 @@ bool FetchHelper::parseStream( const QByteArray &responseIdentifier ) attr += ImapParser::join( attributes, " " ) + ')'; response.setUntagged(); response.setString( attr ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); itemQuery.next(); } @@ -393,7 +393,7 @@ void FetchHelper::triggerOnDemandFetch() void FetchHelper::parseCommandStream() { // macro vs. attribute list - forever { + Q_FOREVER { if ( mStreamParser->atCommandEnd() ) break; if ( mStreamParser->hasList() ) { diff --git a/server/src/handler/link.cpp b/server/src/handler/link.cpp index a64b523..5cf6573 100644 --- a/server/src/handler/link.cpp +++ b/server/src/handler/link.cpp @@ -58,7 +58,7 @@ bool Link::parseStream() DataStore *store = connection()->storageBackend(); Transaction transaction( store ); - foreach ( const PimItem &item, items ) { + Q_FOREACH ( const PimItem &item, items ) { const bool alreadyLinked = collection.relatesToPimItem( item ); bool result = true; if ( mCreateLinks && !alreadyLinked ) { diff --git a/server/src/handler/list.cpp b/server/src/handler/list.cpp index c575581..efc379a 100644 --- a/server/src/handler/list.cpp +++ b/server/src/handler/list.cpp @@ -38,7 +38,7 @@ using namespace Akonadi; template <typename T> static bool intersect( const QVector<typename T::Id> &l1, const QVector<T> &l2 ) { - foreach ( const T& e2, l2 ) { + Q_FOREACH ( const T& e2, l2 ) { if ( l1.contains( e2.id() ) ) return true; } @@ -76,7 +76,7 @@ bool List::listCollection(const Collection & root, int depth, const QStack<Colle Collection::List children = root.children(); QStack<Collection> ancestorsAndMe( ancestors ); ancestorsAndMe.push( root ); - foreach ( const Collection &col, children ) { + Q_FOREACH ( const Collection &col, children ) { if ( listCollection( col, depth - 1, ancestorsAndMe ) ) childrenFound = true; } @@ -101,7 +101,7 @@ bool List::listCollection(const Collection & root, int depth, const QStack<Colle Response response; response.setUntagged(); response.setString( b ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } @@ -217,14 +217,14 @@ bool List::parseStream() --depth; } - foreach ( const Collection &col, collections ) + Q_FOREACH ( const Collection &col, collections ) listCollection( col, depth, ancestors ); Response response; response.setSuccess(); response.setTag( tag() ); response.setString( "List completed" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } diff --git a/server/src/handler/login.cpp b/server/src/handler/login.cpp index 886b7bb..5b0a752 100644 --- a/server/src/handler/login.cpp +++ b/server/src/handler/login.cpp @@ -39,7 +39,7 @@ bool Login::parseStream() m_streamParser->readUntilCommandEnd(); successResponse( "User logged in" ); - emit connectionStateChange( Authenticated ); + Q_EMIT connectionStateChange( Authenticated ); return true; } diff --git a/server/src/handler/logout.cpp b/server/src/handler/logout.cpp index dedfaca..7dfc771 100644 --- a/server/src/handler/logout.cpp +++ b/server/src/handler/logout.cpp @@ -39,13 +39,13 @@ bool Logout::parseStream() response.setBye(); response.setString( "Akonadi server logging out" ); response.setUntagged(); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); response.setSuccess(); response.setTag( tag() ); response.setString( "Logout completed" ); - emit responseAvailable( response ); - emit connectionStateChange( LoggingOut ); + Q_EMIT responseAvailable( response ); + Q_EMIT connectionStateChange( LoggingOut ); return true; } diff --git a/server/src/handler/modify.cpp b/server/src/handler/modify.cpp index 0975152..52a5b86 100644 --- a/server/src/handler/modify.cpp +++ b/server/src/handler/modify.cpp @@ -86,11 +86,11 @@ bool Modify::parseStream() QList<QByteArray> mimeTypes; pos = ImapParser::parseParenthesizedList( line, mimeTypes, pos ); QStringList mts; - foreach ( const QByteArray &ba, mimeTypes ) + Q_FOREACH ( const QByteArray &ba, mimeTypes ) mts << QString::fromLatin1(ba); MimeType::List currentMts = collection.mimeTypes(); bool equal = true; - foreach ( const MimeType ¤tMt, currentMts ) { + Q_FOREACH ( const MimeType ¤tMt, currentMts ) { if ( mts.contains( currentMt.name() ) ) { mts.removeAll( currentMt.name() ); continue; @@ -219,7 +219,7 @@ bool Modify::parseStream() Response response; response.setTag( tag() ); response.setString( "MODIFY done" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } diff --git a/server/src/handler/move.cpp b/server/src/handler/move.cpp index 798b777..37fc8d6 100644 --- a/server/src/handler/move.cpp +++ b/server/src/handler/move.cpp @@ -65,7 +65,7 @@ bool Move::parseStream() const QVector<PimItem> items = qb.result(); if ( items.isEmpty() ) throw HandlerException( "No items found" ); - foreach ( /*sic!*/ PimItem item, items ) { + Q_FOREACH ( /*sic!*/ PimItem item, items ) { if ( !item.isValid() ) throw HandlerException( "Invalid item in result set!?" ); Q_ASSERT( item.collectionId() != destination.id() ); diff --git a/server/src/handler/remove.cpp b/server/src/handler/remove.cpp index 743545e..deff75e 100644 --- a/server/src/handler/remove.cpp +++ b/server/src/handler/remove.cpp @@ -48,7 +48,7 @@ bool Remove::parseStream() const QVector<PimItem> items = qb.result(); if ( items.isEmpty() ) throw HandlerException( "No items found" ); - foreach ( const PimItem &item, items ) { + Q_FOREACH ( const PimItem &item, items ) { if ( !store->cleanupPimItem( item ) ) throw HandlerException( "Deletion failed" ); } diff --git a/server/src/handler/search.cpp b/server/src/handler/search.cpp index 2b00bac..345df83 100644 --- a/server/src/handler/search.cpp +++ b/server/src/handler/search.cpp @@ -64,7 +64,7 @@ bool Search::parseStream() // create imap query QVector<ImapSet::Id> imapIds; - foreach ( const QString &uid, uids ) + Q_FOREACH ( const QString &uid, uids ) imapIds.append( uid.toULongLong() ); ImapSet itemSet; diff --git a/server/src/handler/searchpersistent.cpp b/server/src/handler/searchpersistent.cpp index 350a793..5b78f54 100644 --- a/server/src/handler/searchpersistent.cpp +++ b/server/src/handler/searchpersistent.cpp @@ -92,7 +92,7 @@ bool SearchPersistent::parseStream() // work around the fact that we have no clue what might be in there MimeType::List mts = MimeType::retrieveAll(); - foreach ( const MimeType &mt, mts ) { + Q_FOREACH ( const MimeType &mt, mts ) { if ( mt.name() == QLatin1String( "inode/directory" ) ) continue; col.addMimeType( mt ); @@ -109,7 +109,7 @@ bool SearchPersistent::parseStream() Response colResponse; colResponse.setUntagged(); colResponse.setString( b ); - emit responseAvailable( colResponse ); + Q_EMIT responseAvailable( colResponse ); return successResponse( "SEARCH_STORE completed" ); } diff --git a/server/src/handler/select.cpp b/server/src/handler/select.cpp index 415948f..65848d1 100644 --- a/server/src/handler/select.cpp +++ b/server/src/handler/select.cpp @@ -87,25 +87,25 @@ bool Select::parseStream() if ( !silent ) { response.setUntagged(); response.setString( "FLAGS (" + Flag::joinByName( Flag::retrieveAll(), QLatin1String(" ") ).toLatin1() + ")" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); const int itemCount = HandlerHelper::itemCount( col ); if ( itemCount < 0 ) return failureResponse( "Unable to determine item count" ); response.setString( QByteArray::number( itemCount ) + " EXISTS" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); int readCount = HandlerHelper::itemWithFlagsCount( col, QStringList() << QLatin1String( "\\SEEN" ) << QLatin1String( "$IGNORED" ) ); if ( readCount < 0 || itemCount < readCount ) return failureResponse( "Unable to retrieve unseen count" ); response.setString( "OK [UNSEEN " + QByteArray::number( itemCount - readCount ) + "] Message 0 is first unseen" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); } response.setSuccess(); response.setTag( tag() ); response.setString( "Completed" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); connection()->setSelectedCollection( col.id() ); return true; diff --git a/server/src/handler/status.cpp b/server/src/handler/status.cpp index fd65fd6..d7c047a 100644 --- a/server/src/handler/status.cpp +++ b/server/src/handler/status.cpp @@ -95,12 +95,12 @@ bool Status::parseStream() Response response; response.setUntagged(); response.setString( "STATUS \"" + HandlerHelper::pathForCollection( col ).toUtf8() + "\" (" + statusResponse + ')' ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); response.setSuccess(); response.setTag( tag() ); response.setString( "STATUS completed" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } diff --git a/server/src/handler/store.cpp b/server/src/handler/store.cpp index e196ad1..9291566 100644 --- a/server/src/handler/store.cpp +++ b/server/src/handler/store.cpp @@ -48,7 +48,7 @@ using namespace Akonadi; static bool payloadChanged( const QSet<QByteArray> &changes ) { - foreach ( const QByteArray &change, changes ) { + Q_FOREACH ( const QByteArray &change, changes ) { if ( change.startsWith( "PLD:" ) ) return true; } @@ -401,7 +401,7 @@ bool Store::parseStream() response.setSuccess(); response.setString( "DATETIME " + ImapParser::quote( datetime.toUtf8() ) + " STORE completed" ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); return true; } @@ -438,7 +438,7 @@ void Store::sendPimItemResponse( const PimItem &pimItem ) Response response; response.setUntagged(); response.setString( result ); - emit responseAvailable( response ); + Q_EMIT responseAvailable( response ); } #include "store.moc" diff --git a/server/src/handlerhelper.cpp b/server/src/handlerhelper.cpp index ce33fed..6767587 100644 --- a/server/src/handlerhelper.cpp +++ b/server/src/handlerhelper.cpp @@ -43,7 +43,7 @@ Collection HandlerHelper::collectionFromIdOrName(const QByteArray & id) const QStringList pathParts = path.split( QLatin1Char('/'), QString::SkipEmptyParts ); Collection col; - foreach ( const QString &part, pathParts ) { + Q_FOREACH ( const QString &part, pathParts ) { SelectQueryBuilder<Collection> qb; qb.addValueCondition( Collection::nameColumn(), Query::Equals, part ); if ( col.isValid() ) @@ -105,7 +105,7 @@ int HandlerHelper::itemWithFlagsCount(const Akonadi::Collection& col, const QStr Flag::idFullColumnName(), PimItemFlagRelation::rightFullColumnName() ); qb.addValueCondition( PimItem::collectionIdFullColumnName(), Query::Equals, col.id() ); Query::Condition cond( Query::Or ); - foreach ( const QString &flag, flags ) + Q_FOREACH ( const QString &flag, flags ) cond.addValueCondition( Flag::nameFullColumnName(), Query::Equals, flag ); qb.addCondition( cond ); if ( !qb.exec() ) @@ -153,7 +153,7 @@ int HandlerHelper::parseCachePolicy(const QByteArray & data, Collection & col, i QList<QByteArray> tmp; QStringList partsList; Akonadi::ImapParser::parseParenthesizedList( value, tmp ); - foreach ( const QByteArray &ba, tmp ) + Q_FOREACH ( const QByteArray &ba, tmp ) partsList << QString::fromLatin1( ba ); const QString parts = partsList.join( QLatin1String( " " ) ); somethingElseChanged = somethingElseChanged || col.cachePolicyLocalParts() != parts; @@ -271,7 +271,7 @@ int HandlerHelper::parseDepth( const QByteArray &depth ) Akonadi::Flag::List Akonadi::HandlerHelper::resolveFlags(const QList< QByteArray >& flagNames) { Flag::List flagList; - foreach ( const QByteArray &flagName, flagNames ) { + Q_FOREACH ( const QByteArray &flagName, flagNames ) { Flag flag = Flag::retrieveByName( QString::fromUtf8( flagName ) ); if ( !flag.isValid() ) { flag = Flag( QString::fromUtf8( flagName ) ); diff --git a/server/src/intervalcheck.h b/server/src/intervalcheck.h index d5a578a..0bdca49 100644 --- a/server/src/intervalcheck.h +++ b/server/src/intervalcheck.h @@ -53,7 +53,7 @@ class IntervalCheck : public QThread protected: void run(); - private slots: + private Q_SLOTS: void doIntervalCheck(); private: diff --git a/server/src/nepomuk/dbusoperators.cpp b/server/src/nepomuk/dbusoperators.cpp index c125805..ec6029f 100644 --- a/server/src/nepomuk/dbusoperators.cpp +++ b/server/src/nepomuk/dbusoperators.cpp @@ -59,7 +59,7 @@ QDBusArgument& operator<<( QDBusArgument& arg, const Nepomuk::Query::Result& res // additional bindings arg.beginMap( QVariant::String, qMetaTypeId<Soprano::Node>() ); const Soprano::BindingSet additionalBindings; // = result.additionalBindings(); - foreach( const QString& binding, additionalBindings.bindingNames() ) { + Q_FOREACH( const QString& binding, additionalBindings.bindingNames() ) { arg.beginMapEntry(); arg << binding << additionalBindings[binding]; arg.endMapEntry(); diff --git a/server/src/nepomuk/queryserviceclient.cpp b/server/src/nepomuk/queryserviceclient.cpp index 3db7b36..12c7b5c 100644 --- a/server/src/nepomuk/queryserviceclient.cpp +++ b/server/src/nepomuk/queryserviceclient.cpp @@ -98,7 +98,7 @@ public: void Nepomuk::Query::QueryServiceClient::Private::_k_finishedListing() { - emit q->finishedListing(); + Q_EMIT q->finishedListing(); if( loop ) { q->close(); } diff --git a/server/src/notificationmanager.cpp b/server/src/notificationmanager.cpp index 1db71d1..22512f1 100644 --- a/server/src/notificationmanager.cpp +++ b/server/src/notificationmanager.cpp @@ -76,7 +76,7 @@ void NotificationManager::connectNotificationCollector(NotificationCollector* co void NotificationManager::slotNotify(const Akonadi::NotificationMessage::List &msgs) { - foreach ( const NotificationMessage &msg, msgs ) + Q_FOREACH ( const NotificationMessage &msg, msgs ) NotificationMessage::appendAndCompress( mNotifications, msg ); if ( !mTimer.isActive() ) mTimer.start(); @@ -86,7 +86,7 @@ void NotificationManager::emitPendingNotifications() { if ( mNotifications.isEmpty() ) return; - foreach ( const NotificationMessage &msg, mNotifications ) { + Q_FOREACH ( const NotificationMessage &msg, mNotifications ) { Tracer::self()->signal( "NotificationManager::notify", msg.toString() ); } @@ -95,7 +95,7 @@ void NotificationManager::emitPendingNotifications() } // backward compatibility with the old non-subcription interface - emit notify( mNotifications ); + Q_EMIT notify( mNotifications ); mNotifications.clear(); } diff --git a/server/src/notificationsource.h b/server/src/notificationsource.h index 4f631b0..9df5ef4 100644 --- a/server/src/notificationsource.h +++ b/server/src/notificationsource.h @@ -91,7 +91,7 @@ class NotificationSource : public QObject Q_SCRIPTABLE void notify( const Akonadi::NotificationMessage::List &msgs ); - private slots: + private Q_SLOTS: void serviceUnregistered( const QString &serviceName ); private: diff --git a/server/src/preprocessormanager.cpp b/server/src/preprocessormanager.cpp index f5735aa..9f83cc6 100644 --- a/server/src/preprocessormanager.cpp +++ b/server/src/preprocessormanager.cpp @@ -123,7 +123,7 @@ bool PreprocessorManager::isActive() PreprocessorInstance * PreprocessorManager::lockedFindInstance( const QString &id ) { - foreach( PreprocessorInstance * instance, mPreprocessorChain ) + Q_FOREACH( PreprocessorInstance * instance, mPreprocessorChain ) { if( instance->id() == id ) return instance; @@ -193,11 +193,11 @@ void PreprocessorManager::lockedUnregisterInstance( const QString &id ) Q_ASSERT( nextPreprocessor ); Q_ASSERT( nextPreprocessor != instance ); - foreach( qint64 itemId, *itemList ) + Q_FOREACH( qint64 itemId, *itemList ) nextPreprocessor->enqueueItem( itemId ); } else { // This was the last preprocessor: end handling the items - foreach( qint64 itemId, *itemList ) + Q_FOREACH( qint64 itemId, *itemList ) lockedEndHandleItem( itemId ); } @@ -346,10 +346,10 @@ void PreprocessorManager::dataStoreTransactionCommitted() if( !mEnabled || mPreprocessorChain.isEmpty() ) { // Preprocessing has been disabled in the meantime or all the preprocessors died - foreach( qint64 id, *waitQueue ) + Q_FOREACH( qint64 id, *waitQueue ) lockedEndHandleItem( id ); } else { - foreach( qint64 id, *waitQueue ) + Q_FOREACH( qint64 id, *waitQueue ) lockedActivateFirstPreprocessor( id ); } @@ -437,7 +437,7 @@ void PreprocessorManager::heartbeat() PreprocessorInstance * instance; - foreach( instance, mPreprocessorChain ) + Q_FOREACH( instance, mPreprocessorChain ) { // In this loop we check for "stuck" preprocessors. @@ -498,7 +498,7 @@ void PreprocessorManager::heartbeat() } // Kill the fired preprocessors, if any. - foreach( instance, firedPreprocessors ) + Q_FOREACH( instance, firedPreprocessors ) lockedUnregisterInstance( instance->id() ); } diff --git a/server/src/resourcemanager.cpp b/server/src/resourcemanager.cpp index efe173b..b6027fb 100644 --- a/server/src/resourcemanager.cpp +++ b/server/src/resourcemanager.cpp @@ -73,7 +73,7 @@ void Akonadi::ResourceManager::removeResourceInstance(const QString & name) QStringList ResourceManager::resourceInstances() const { QStringList result; - foreach ( const Resource &res, Resource::retrieveAll() ) + Q_FOREACH ( const Resource &res, Resource::retrieveAll() ) result.append( res.name() ); return result; } diff --git a/server/src/search/searchmanager.cpp b/server/src/search/searchmanager.cpp index 334edf5..a3fe0b1 100644 --- a/server/src/search/searchmanager.cpp +++ b/server/src/search/searchmanager.cpp @@ -41,7 +41,7 @@ SearchManager::SearchManager( const QStringList &searchEngines, QObject *parent qRegisterMetaType<Collection>(); m_engines.reserve( searchEngines.size() ); - foreach ( const QString &engineName, searchEngines ) { + Q_FOREACH ( const QString &engineName, searchEngines ) { if ( engineName == QLatin1String( "Nepomuk" ) ) { #ifdef HAVE_SOPRANO m_engines.append( new NepomukSearchEngine ); @@ -81,7 +81,7 @@ bool SearchManager::addSearch(const Collection& collection) void SearchManager::addSearchInternal(const Collection& collection) { - foreach ( AbstractSearchEngine* engine, m_engines ) + Q_FOREACH ( AbstractSearchEngine* engine, m_engines ) engine->addSearch( collection ); } @@ -94,14 +94,14 @@ bool SearchManager::removeSearch(qint64 id) void SearchManager::removeSearchInternal(qint64 id) { - foreach ( AbstractSearchEngine* engine, m_engines ) + Q_FOREACH ( AbstractSearchEngine* engine, m_engines ) engine->removeSearch( id ); } void SearchManager::updateSearch(const Akonadi::Collection& collection, NotificationCollector* collector) { removeSearch( collection.id() ); - foreach ( const PimItem &item, collection.pimItems() ) + Q_FOREACH ( const PimItem &item, collection.pimItems() ) collector->itemUnlinked( item, collection ); collection.clearPimItems(); addSearch( collection ); diff --git a/server/src/search/searchmanager.h b/server/src/search/searchmanager.h index aafa4de..26e0bd7 100644 --- a/server/src/search/searchmanager.h +++ b/server/src/search/searchmanager.h @@ -68,7 +68,7 @@ class SearchManager : public QObject */ void updateSearch( const Collection &collection, NotificationCollector* collector ); - private slots: + private Q_SLOTS: void addSearchInternal( const Collection &collection ); void removeSearchInternal( qint64 id ); diff --git a/server/src/search/xesamsearchengine.cpp b/server/src/search/xesamsearchengine.cpp index fd63443..4c3f45f 100644 --- a/server/src/search/xesamsearchengine.cpp +++ b/server/src/search/xesamsearchengine.cpp @@ -125,7 +125,7 @@ void XesamSearchEngine::slotHitsAdded( const QString &search, uint count ) akDebug() << "GetHits returned:" << results.count(); typedef QList<QVariant> VariantList; - foreach ( const VariantList &list, results ) { + Q_FOREACH ( const VariantList &list, results ) { if ( list.isEmpty() ) continue; @@ -158,7 +158,7 @@ void XesamSearchEngine::slotHitsRemoved( const QString &search, const QList<uint const QVector<QList<QVariant> > results = mInterface->GetHitData( search, hits, QStringList( QLatin1String( "uri" ) ) ); typedef QList<QVariant> VariantList; - foreach ( const VariantList &list, results ) { + Q_FOREACH ( const VariantList &list, results ) { if ( list.isEmpty() ) continue; diff --git a/server/src/storage/collectionqueryhelper.cpp b/server/src/storage/collectionqueryhelper.cpp index 35dbc9c..e6edf6d 100644 --- a/server/src/storage/collectionqueryhelper.cpp +++ b/server/src/storage/collectionqueryhelper.cpp @@ -83,7 +83,7 @@ bool CollectionQueryHelper::canBeMovedTo ( const Collection &collection, const C { if ( _parent.isValid() ) { Collection parent = _parent; - forever { + Q_FOREVER { if ( parent.id() == collection.id() ) return false; // target is child of source if ( parent.parentId() == 0 ) diff --git a/server/src/storage/datastore.cpp b/server/src/storage/datastore.cpp index f6511e7..5655e01 100644 --- a/server/src/storage/datastore.cpp +++ b/server/src/storage/datastore.cpp @@ -211,7 +211,7 @@ bool DataStore::removeItemFlags( const PimItem &item, const QVector<Flag> &flags bool DataStore::removeItemParts( const PimItem &item, const QList<QByteArray> &parts ) { Part::List existingParts = item.parts(); - foreach ( Part part, existingParts ) { + Q_FOREACH ( Part part, existingParts ) { if( parts.contains( part.name().toLatin1() ) ) { if ( !PartHelper::remove(&part) ) return false; @@ -237,7 +237,7 @@ bool DataStore::invalidateItemCache( const PimItem &item ) const Part::List parts = qb.result(); // clear data field - foreach ( Part part, parts ) { + Q_FOREACH ( Part part, parts ) { if ( !PartHelper::truncate( part ) ) return false; } @@ -262,7 +262,7 @@ bool Akonadi::DataStore::cleanupCollection(Collection &collection) // delete the content const PimItem::List items = collection.items(); const QByteArray resource = collection.resource().name().toLatin1(); - foreach ( const PimItem &item, items ) { + Q_FOREACH ( const PimItem &item, items ) { // generate the notification before actually removing the data mNotificationCollector->itemRemoved( item, collection, QString(), resource ); // TODO: make mimetype available as part as an item bulk query @@ -283,7 +283,7 @@ bool Akonadi::DataStore::cleanupCollection(Collection &collection) Collection::clearPimItems( collection.id() ); // delete attributes - foreach ( CollectionAttribute attr, collection.attributes() ) + Q_FOREACH ( CollectionAttribute attr, collection.attributes() ) if ( !attr.remove() ) return false; @@ -304,7 +304,7 @@ static bool recursiveSetResourceId( const Collection & collection, qint64 resour transaction.commit(); - foreach ( const Collection &col, collection.children() ) { + Q_FOREACH ( const Collection &col, collection.children() ) { if ( !recursiveSetResourceId( col, resourceId ) ) return false; } @@ -353,7 +353,7 @@ bool DataStore::appendMimeTypeForCollection( qint64 collectionId, const QStringL return false; QStringList missingMimeTypes = mimeTypes; - foreach ( const MimeType &mt, qb.result() ) { + Q_FOREACH ( const MimeType &mt, qb.result() ) { // unique index on n:m relation prevents duplicates, ie. this will fail // if this mimetype is already set if ( !Collection::addMimeType( collectionId, mt.id() ) ) @@ -362,7 +362,7 @@ bool DataStore::appendMimeTypeForCollection( qint64 collectionId, const QStringL } // the MIME type doesn't exist, so we have to add it to the db - foreach ( const QString &mtName, missingMimeTypes ) { + Q_FOREACH ( const QString &mtName, missingMimeTypes ) { qint64 mimeTypeId; if ( !appendMimeType( mtName, &mimeTypeId ) ) return false; @@ -540,7 +540,7 @@ bool Akonadi::DataStore::removeCollectionAttribute(const Collection & col, const throw HandlerException( "Unable to query for collection attribute" ); const QVector<CollectionAttribute> result = qb.result(); - foreach ( CollectionAttribute attr, result ) { + Q_FOREACH ( CollectionAttribute attr, result ) { if ( !attr.remove() ) throw HandlerException( "Unable to remove collection attribute" ); } @@ -631,7 +631,7 @@ bool Akonadi::DataStore::rollbackTransaction() if ( m_transactionLevel == 0 ) { QSqlDriver *driver = m_database.driver(); - emit transactionRolledBack(); + Q_EMIT transactionRolledBack(); if ( !driver->rollbackTransaction() ) { TRANSACTION_MUTEX_UNLOCK; debugLastDbError( "DataStore::rollbackTransaction" ); @@ -662,7 +662,7 @@ bool Akonadi::DataStore::commitTransaction() return false; } else { TRANSACTION_MUTEX_UNLOCK; - emit transactionCommitted(); + Q_EMIT transactionCommitted(); } } diff --git a/server/src/storage/dbinitializer.cpp b/server/src/storage/dbinitializer.cpp index 7190c0a..5c01d27 100644 --- a/server/src/storage/dbinitializer.cpp +++ b/server/src/storage/dbinitializer.cpp @@ -227,7 +227,7 @@ bool DbInitializer::checkTable( const QDomElement &element ) // Check for every column whether it exists. const QSqlRecord table = mDatabase.record( tableName ); - foreach ( const ColumnDescription &columnDescription, tableDescription.columns ) { + Q_FOREACH ( const ColumnDescription &columnDescription, tableDescription.columns ) { bool found = false; for ( int i = 0; i < table.count(); ++i ) { const QSqlField column = table.field( i ); @@ -257,7 +257,7 @@ bool DbInitializer::checkTable( const QDomElement &element ) } // Add indices - foreach ( const IndexDescription &indexDescription, tableDescription.indexes ) { + Q_FOREACH ( const IndexDescription &indexDescription, tableDescription.indexes ) { // sqlite3 needs unique index identifiers per db const QString indexName = QString::fromLatin1( "%1_%2" ).arg( tableName ).arg( indexDescription.name ); if ( !hasIndex( tableName, indexName ) ) { @@ -286,7 +286,7 @@ bool DbInitializer::checkTable( const QDomElement &element ) query = queryBuilder.query(); if ( query.size() == 0 || !query.first() ) { // table is empty - foreach ( const DataDescription &dataDescription, tableDescription.data ) { + Q_FOREACH ( const DataDescription &dataDescription, tableDescription.data ) { // Get the INSERT VALUES statement for the specific SQL dialect const QString statement = buildInsertValuesStatement( tableDescription, dataDescription ); akDebug() << statement; diff --git a/server/src/storage/dbinitializer_p.cpp b/server/src/storage/dbinitializer_p.cpp index 0b8e2cb..2eb824c 100644 --- a/server/src/storage/dbinitializer_p.cpp +++ b/server/src/storage/dbinitializer_p.cpp @@ -46,7 +46,7 @@ QString DbInitializerMySql::buildCreateTableStatement( const TableDescription &t QStringList columns; QStringList references; - foreach ( const ColumnDescription &columnDescription, tableDescription.columns ) { + Q_FOREACH ( const ColumnDescription &columnDescription, tableDescription.columns ) { columns.append( buildColumnStatement( columnDescription ) ); if ( !columnDescription.refTable.isEmpty() && !columnDescription.refColumn.isEmpty() ) { @@ -127,7 +127,7 @@ QString DbInitializerSqlite::buildCreateTableStatement( const TableDescription & { QStringList columns; - foreach ( const ColumnDescription &columnDescription, tableDescription.columns ) + Q_FOREACH ( const ColumnDescription &columnDescription, tableDescription.columns ) columns.append( buildColumnStatement( columnDescription ) ); return QString::fromLatin1( "CREATE TABLE %1 (%2)" ).arg( tableDescription.name, columns.join( QLatin1String( ", " ) ) ); @@ -213,7 +213,7 @@ QString DbInitializerPostgreSql::buildCreateTableStatement( const TableDescripti { QStringList columns; - foreach ( const ColumnDescription &columnDescription, tableDescription.columns ) + Q_FOREACH ( const ColumnDescription &columnDescription, tableDescription.columns ) columns.append( buildColumnStatement( columnDescription ) ); return QString::fromLatin1( "CREATE TABLE %1 (%2)" ).arg( tableDescription.name, columns.join( QLatin1String( ", " ) ) ); @@ -337,7 +337,7 @@ QString DbInitializerVirtuoso::buildCreateTableStatement( const TableDescription { QStringList columns; - foreach ( const ColumnDescription &columnDescription, tableDescription.columns ) + Q_FOREACH ( const ColumnDescription &columnDescription, tableDescription.columns ) columns.append( buildColumnStatement( columnDescription ) ); return QString::fromLatin1( "CREATE TABLE %1 (%2)" ).arg( tableDescription.name, columns.join( QLatin1String( ", " ) ) ); diff --git a/server/src/storage/dbupdater.cpp b/server/src/storage/dbupdater.cpp index 551ae36..3cd63d9 100644 --- a/server/src/storage/dbupdater.cpp +++ b/server/src/storage/dbupdater.cpp @@ -50,7 +50,7 @@ bool DbUpdater::run() bool success = m_database.transaction(); if ( success ) { - foreach ( const QString &statement, it.value().statements ) { + Q_FOREACH ( const QString &statement, it.value().statements ) { QSqlQuery query( m_database ); success = query.exec( statement ); if ( !success ) { diff --git a/server/src/storage/itemretrievaljob.cpp b/server/src/storage/itemretrievaljob.cpp index a3a31f8..c6f1ac6 100644 --- a/server/src/storage/itemretrievaljob.cpp +++ b/server/src/storage/itemretrievaljob.cpp @@ -46,7 +46,7 @@ void ItemRetrievalJob::start(QDBusAbstractInterface* interface) << m_request->parts; interface->callWithCallback( QLatin1String( "requestItemDelivery" ), arguments, this, SLOT(callFinished(bool)), SLOT(callFailed(QDBusError)) ); } else { - emit requestCompleted( m_request, QString::fromLatin1( "Unable to contact resource" ) ); + Q_EMIT requestCompleted( m_request, QString::fromLatin1( "Unable to contact resource" ) ); deleteLater(); } } @@ -54,7 +54,7 @@ void ItemRetrievalJob::start(QDBusAbstractInterface* interface) void ItemRetrievalJob::kill() { m_active = false; - emit requestCompleted( m_request, QLatin1String( "Request cancelled" ) ); + Q_EMIT requestCompleted( m_request, QLatin1String( "Request cancelled" ) ); } void ItemRetrievalJob::callFinished(bool returnValue) @@ -62,9 +62,9 @@ void ItemRetrievalJob::callFinished(bool returnValue) if ( m_active ) { m_active = false; if ( !returnValue ) - emit requestCompleted( m_request, QString::fromLatin1( "Resource was unable to deliver item" ) ); + Q_EMIT requestCompleted( m_request, QString::fromLatin1( "Resource was unable to deliver item" ) ); else - emit requestCompleted( m_request, QString() ); + Q_EMIT requestCompleted( m_request, QString() ); } deleteLater(); } @@ -73,7 +73,7 @@ void ItemRetrievalJob::callFailed(const QDBusError& error) { if ( m_active ) { m_active = false; - emit requestCompleted( m_request, QString::fromLatin1( "Unable to retrieve item from resource: %1" ).arg( error.message() ) ); + Q_EMIT requestCompleted( m_request, QString::fromLatin1( "Unable to retrieve item from resource: %1" ).arg( error.message() ) ); } deleteLater(); } diff --git a/server/src/storage/itemretrievaljob.h b/server/src/storage/itemretrievaljob.h index f04b823..baafbf0 100644 --- a/server/src/storage/itemretrievaljob.h +++ b/server/src/storage/itemretrievaljob.h @@ -36,10 +36,10 @@ class ItemRetrievalJob : public QObject void start( QDBusAbstractInterface* interface ); void kill(); - signals: + Q_SIGNALS: void requestCompleted( ItemRetrievalRequest *req, const QString &errorMsg ); - private slots: + private Q_SLOTS: void callFinished( bool returnValue ); void callFailed( const QDBusError &error ); diff --git a/server/src/storage/itemretrievalmanager.cpp b/server/src/storage/itemretrievalmanager.cpp index 2eb94dd..974acc5 100644 --- a/server/src/storage/itemretrievalmanager.cpp +++ b/server/src/storage/itemretrievalmanager.cpp @@ -129,10 +129,10 @@ void ItemRetrievalManager::requestItemDelivery( ItemRetrievalRequest *req ) mPendingRequests[ req->resourceId ].append( req ); mLock->unlock(); - emit requestAdded(); + Q_EMIT requestAdded(); mLock->lockForRead(); - forever { + Q_FOREVER { //akDebug() << "checking if request for item" << req->id << "has been processed..."; if ( req->processed ) { boost::scoped_ptr<ItemRetrievalRequest> reqDeleter( req ); @@ -213,7 +213,7 @@ void ItemRetrievalManager::retrievalJobFinished(ItemRetrievalRequest* request, c } mWaitCondition->wakeAll(); mLock->unlock(); - emit requestAdded(); // trigger processRequest() again, in case there is more in the queues + Q_EMIT requestAdded(); // trigger processRequest() again, in case there is more in the queues } void ItemRetrievalManager::triggerCollectionSync(const QString& resource, qint64 colId) diff --git a/server/src/storage/itemretrievalmanager.h b/server/src/storage/itemretrievalmanager.h index 48eaa9b..b07ff1e 100644 --- a/server/src/storage/itemretrievalmanager.h +++ b/server/src/storage/itemretrievalmanager.h @@ -56,13 +56,13 @@ class ItemRetrievalManager : public QObject static ItemRetrievalManager* instance(); - signals: + Q_SIGNALS: void requestAdded(); private: OrgFreedesktopAkonadiResourceInterface* resourceInterface( const QString &id ); - private slots: + private Q_SLOTS: void serviceOwnerChanged( const QString &serviceName, const QString &oldOwner, const QString &newOwner ); void processRequest(); void triggerCollectionSync( const QString &resource, qint64 colId ); diff --git a/server/src/storage/itemretriever.cpp b/server/src/storage/itemretriever.cpp index 9c84a07..4823a1c 100644 --- a/server/src/storage/itemretriever.cpp +++ b/server/src/storage/itemretriever.cpp @@ -179,7 +179,7 @@ bool ItemRetriever::exec() QList<ItemRetrievalRequest*> requests; QStringList parts; - foreach ( const QString &part, mParts ) { + Q_FOREACH ( const QString &part, mParts ) { if ( part.startsWith( QLatin1String( "PLD:" ) ) ) { parts << part.mid(4); } @@ -226,7 +226,7 @@ bool ItemRetriever::exec() query.finish(); - foreach ( ItemRetrievalRequest* request, requests ) { + Q_FOREACH ( ItemRetrievalRequest* request, requests ) { Q_ASSERT( !request->parts.isEmpty() ); // TODO: how should we handle retrieval errors here? so far they have been ignored, // which makes sense in some cases, do we need a command parameter for this? @@ -240,7 +240,7 @@ bool ItemRetriever::exec() // retrieve items in child collections if requested if ( mRecursive && mCollection.isValid() ) { - foreach ( const Collection &col, mCollection.children() ) { + Q_FOREACH ( const Collection &col, mCollection.children() ) { ItemRetriever retriever( mConnection ); retriever.setCollection( col, mRecursive ); retriever.setRetrieveParts( mParts ); diff --git a/server/src/storage/notificationcollector.cpp b/server/src/storage/notificationcollector.cpp index e51baf9..79d1dd0 100644 --- a/server/src/storage/notificationcollector.cpp +++ b/server/src/storage/notificationcollector.cpp @@ -227,13 +227,13 @@ void NotificationCollector::dispatchNotification(const NotificationMessage & msg } else { NotificationMessage::List l; l << msg; - emit notify( l ); + Q_EMIT notify( l ); } } void NotificationCollector::dispatchNotifications() { - emit notify( mNotifications ); + Q_EMIT notify( mNotifications ); clear(); } diff --git a/server/src/storage/querybuilder.cpp b/server/src/storage/querybuilder.cpp index ee320a4..339c951 100644 --- a/server/src/storage/querybuilder.cpp +++ b/server/src/storage/querybuilder.cpp @@ -158,7 +158,7 @@ bool QueryBuilder::exec() statement += mColumns.join( QLatin1String( ", " ) ); statement += QLatin1String(" FROM "); statement += mTable; - foreach ( const QString& joinedTable, mJoinedTables ) { + Q_FOREACH ( const QString& joinedTable, mJoinedTables ) { const QPair< JoinType, Query::Condition >& join = mJoins.value( joinedTable ); switch ( join.first ) { case LeftJoin: @@ -180,7 +180,7 @@ bool QueryBuilder::exec() statement += QLatin1String(" ("); typedef QPair<QString,QVariant> StringVariantPair; QStringList cols, vals; - foreach ( const StringVariantPair &p, mColumnValues ) { + Q_FOREACH ( const StringVariantPair &p, mColumnValues ) { cols.append( p.first ); vals.append( bindValue( p.second ) ); } @@ -196,7 +196,7 @@ bool QueryBuilder::exec() { ///TODO: fix joined Update tables for SQLite by using subqueries // put the ON condition into the WHERE part of the UPDATE query - foreach ( const QString& table, mJoinedTables ) { + Q_FOREACH ( const QString& table, mJoinedTables ) { QPair< JoinType, Query::Condition > join = mJoins.value( table ); Q_ASSERT( join.first == InnerJoin ); whereCondition.addCondition( join.second ); @@ -215,7 +215,7 @@ bool QueryBuilder::exec() Q_ASSERT_X( mColumnValues.count() >= 1, "QueryBuilder::exec()", "At least one column needs to be changed" ); typedef QPair<QString,QVariant> StringVariantPair; QStringList updStmts; - foreach ( const StringVariantPair &p, mColumnValues ) { + Q_FOREACH ( const StringVariantPair &p, mColumnValues ) { QString updStmt = p.first; updStmt += QLatin1String( " = " ); updStmt += bindValue( p.second ); @@ -259,7 +259,7 @@ bool QueryBuilder::exec() Q_ASSERT_X( mType == Select, "QueryBuilder::exec()", "Order statements are only valid for SELECT queries" ); QStringList orderStmts; typedef QPair<QString, Query::SortOrder> SortColumnInfo; - foreach ( const SortColumnInfo &order, mSortColumns ) { + Q_FOREACH ( const SortColumnInfo &order, mSortColumns ) { QString orderStmt; orderStmt += order.first; orderStmt += sortOrderToString( order.second ); @@ -321,7 +321,7 @@ QString QueryBuilder::buildWhereCondition(const Query::Condition & cond) { if ( !cond.isEmpty() ) { QStringList conds; - foreach ( const Query::Condition &c, cond.subConditions() ) { + Q_FOREACH ( const Query::Condition &c, cond.subConditions() ) { conds << buildWhereCondition( c ); } return QLatin1String( "( " ) + conds.join( logicOperatorToString( cond.mCombineOp ) ) + QLatin1String( " )" ); @@ -335,7 +335,7 @@ QString QueryBuilder::buildWhereCondition(const Query::Condition & cond) QStringList entries; Q_ASSERT_X( !cond.mComparedValue.toStringList().isEmpty(), "QueryBuilder::buildWhereCondition()", "No values given for IN condition." ); - foreach ( const QString &entry, cond.mComparedValue.toStringList() ) { + Q_FOREACH ( const QString &entry, cond.mComparedValue.toStringList() ) { entries << bindValue( entry ); } stmt += entries.join( QLatin1String( ", " ) ); diff --git a/server/src/storage/queryhelper.cpp b/server/src/storage/queryhelper.cpp index 4e7d1ea..dbf0e87 100644 --- a/server/src/storage/queryhelper.cpp +++ b/server/src/storage/queryhelper.cpp @@ -27,7 +27,7 @@ using namespace Akonadi; void QueryHelper::setToQuery(const ImapSet& set, const QString &column, QueryBuilder& qb ) { Query::Condition cond( Query::Or ); - foreach ( const ImapInterval &i, set.intervals() ) { + Q_FOREACH ( const ImapInterval &i, set.intervals() ) { if ( i.hasDefinedBegin() && i.hasDefinedEnd() ) { if ( i.size() == 1 ) { cond.addValueCondition( column, Query::Equals, i.begin() ); diff --git a/server/src/storagejanitor.cpp b/server/src/storagejanitor.cpp index f215424..ea520a8 100644 --- a/server/src/storagejanitor.cpp +++ b/server/src/storagejanitor.cpp @@ -226,7 +226,7 @@ void StorageJanitor::verifyExternalParts() const QSet<QString> unreferencedFiles = existingFiles - usedFiles; if ( !unreferencedFiles.isEmpty() ) { const QString lfDir = AkStandardDirs::saveDir( "data", QLatin1String( "file_lost+found" ) ); - foreach ( const QString &file, unreferencedFiles ) { + Q_FOREACH ( const QString &file, unreferencedFiles ) { inform( QLatin1Literal( "Found unreferenced external file: " ) + file ); const QFileInfo f( file ); QFile::rename( file, lfDir + QDir::separator() + f.fileName() ); @@ -245,7 +245,7 @@ void StorageJanitor::findDirtyObjects() cqb.addValueCondition( Collection::remoteIdColumn(), Query::Equals, QString() ); cqb.exec(); const Collection::List ridLessCols = cqb.result(); - foreach ( const Collection &col, ridLessCols ) + Q_FOREACH ( const Collection &col, ridLessCols ) inform( QLatin1Literal( "Collection \"" ) + col.name() + QLatin1Literal( "\" (id: " ) + QString::number( col.id() ) + QLatin1Literal( ") has no RID." ) ); inform( QLatin1Literal( "Found " ) + QString::number( ridLessCols.size() ) + QLatin1Literal( " collections without RID." ) ); @@ -256,7 +256,7 @@ void StorageJanitor::findDirtyObjects() iqb1.addValueCondition( PimItem::remoteIdColumn(), Query::Equals, QString() ); iqb1.exec(); const PimItem::List ridLessItems = iqb1.result(); - foreach ( const PimItem &item, ridLessItems ) + Q_FOREACH ( const PimItem &item, ridLessItems ) inform( QLatin1Literal( "Item \"" ) + QString::number( item.id() ) + QLatin1Literal( "\" has no RID." ) ); inform( QLatin1Literal( "Found " ) + QString::number( ridLessItems.size() ) + QLatin1Literal( " items without RID." ) ); @@ -266,7 +266,7 @@ void StorageJanitor::findDirtyObjects() iqb2.addSortColumn( PimItem::idFullColumnName() ); iqb2.exec(); const PimItem::List dirtyItems = iqb2.result(); - foreach ( const PimItem &item, dirtyItems ) + Q_FOREACH ( const PimItem &item, dirtyItems ) inform( QLatin1Literal( "Item \"" ) + QString::number( item.id() ) + QLatin1Literal( "\" has RID and is dirty." ) ); inform( QLatin1Literal( "Found " ) + QString::number( dirtyItems.size() ) + QLatin1Literal( " dirty items." ) ); } @@ -276,7 +276,7 @@ void StorageJanitor::vacuum() const QString driverName = DataStore::self()->database().driverName(); if( ( driverName == QLatin1String( "QMYSQL" ) ) || ( driverName == QLatin1String( "QPSQL" ) ) ) { inform( "vacuuming database, that'll take some time and require a lot of temporary disk space..." ); - foreach ( const QString &table, Akonadi::allDatabaseTables() ) { + Q_FOREACH ( const QString &table, Akonadi::allDatabaseTables() ) { inform( QString::fromLatin1( "optimizing table %1..." ).arg( table ) ); QString queryStr; @@ -304,6 +304,6 @@ void StorageJanitor::inform(const char* msg) void StorageJanitor::inform(const QString& msg) { akDebug() << msg; - emit information( msg ); + Q_EMIT information( msg ); } diff --git a/server/src/storagejanitor.h b/server/src/storagejanitor.h index d67507c..afc79c6 100644 --- a/server/src/storagejanitor.h +++ b/server/src/storagejanitor.h @@ -48,13 +48,13 @@ class StorageJanitor : public QObject explicit StorageJanitor(QObject* parent = 0); ~StorageJanitor(); - public slots: + public Q_SLOTS: /** Triggers a consistency check of the internal storage. */ Q_SCRIPTABLE Q_NOREPLY void check(); /** Triggers a vacuuming of the database, that is compacting of unused space. */ Q_SCRIPTABLE Q_NOREPLY void vacuum(); - signals: + Q_SIGNALS: /** Sends informational messages to a possible UI for this. */ Q_SCRIPTABLE void information( const QString &msg ); diff --git a/server/src/xesamsearch.cpp b/server/src/xesamsearch.cpp index e99c243..d7f335e 100644 --- a/server/src/xesamsearch.cpp +++ b/server/src/xesamsearch.cpp @@ -91,7 +91,7 @@ void XesamSearch::hitsAdded( const QString &search, uint count ) const QVector<QList<QVariant> > results = mInterface->GetHits( search, count ); typedef QList<QVariant> VariantList; - foreach ( const VariantList &list, results ) { + Q_FOREACH ( const VariantList &list, results ) { if ( list.isEmpty() ) continue; diff --git a/server/tests/unittest/akdbustest.cpp b/server/tests/unittest/akdbustest.cpp index 1482945..a31107e 100644 --- a/server/tests/unittest/akdbustest.cpp +++ b/server/tests/unittest/akdbustest.cpp @@ -28,7 +28,7 @@ Q_DECLARE_METATYPE( AkDBus::AgentType ) class AkDBusTest : public QObject { Q_OBJECT - private slots: + private Q_SLOTS: void testServiceName() { akTestSetInstanceIdentifier( QString() ); diff --git a/server/tests/unittest/akstandarddirstest.cpp b/server/tests/unittest/akstandarddirstest.cpp index 13be443..569512b 100644 --- a/server/tests/unittest/akstandarddirstest.cpp +++ b/server/tests/unittest/akstandarddirstest.cpp @@ -29,7 +29,7 @@ class AkStandardDirsTest : public QObject { Q_OBJECT - private slots: + private Q_SLOTS: void testCondigFile() { akTestSetInstanceIdentifier( QString() ); diff --git a/server/tests/unittest/dbconfigtest.cpp b/server/tests/unittest/dbconfigtest.cpp index f2cd91f..b8b76ac 100644 --- a/server/tests/unittest/dbconfigtest.cpp +++ b/server/tests/unittest/dbconfigtest.cpp @@ -33,7 +33,7 @@ using namespace Akonadi; class DbConfigTest : public QObject { Q_OBJECT - private slots: + private Q_SLOTS: void testDbConfig() { // doesn't work, DbConfig has an internal singleton-like cache... diff --git a/server/tests/unittest/handlerhelpertest.cpp b/server/tests/unittest/handlerhelpertest.cpp index 4387eab..39dcbec 100644 --- a/server/tests/unittest/handlerhelpertest.cpp +++ b/server/tests/unittest/handlerhelpertest.cpp @@ -30,7 +30,7 @@ Q_DECLARE_METATYPE( QStack<Akonadi::Collection> ) class HandlerHelperTest : public QObject { Q_OBJECT - private slots: + private Q_SLOTS: void testCachePolicyToByteArray_data() { QTest::addColumn<Collection>( "collection" ); diff --git a/server/tests/unittest/handlertest.cpp b/server/tests/unittest/handlertest.cpp index 047f309..bbbf4b9 100644 --- a/server/tests/unittest/handlertest.cpp +++ b/server/tests/unittest/handlertest.cpp @@ -84,7 +84,7 @@ class HandlerTest : public QObject { MAKE_CMD_ROW(UNKNOWN, UnknownCommandHandler) } - private slots: + private Q_SLOTS: void testFindAuthenticatedCommand_data() { setupTestData(); diff --git a/server/tests/unittest/querybuildertest.h b/server/tests/unittest/querybuildertest.h index c835f5d..244095a 100644 --- a/server/tests/unittest/querybuildertest.h +++ b/server/tests/unittest/querybuildertest.h @@ -31,7 +31,7 @@ class QueryBuilder; class QueryBuilderTest : public QObject { Q_OBJECT - private slots: + private Q_SLOTS: void testQueryBuilder_data(); void testQueryBuilder(); diff --git a/server/tests/unittest/scopetest.cpp b/server/tests/unittest/scopetest.cpp index e47fd5b..c6c720c 100644 --- a/server/tests/unittest/scopetest.cpp +++ b/server/tests/unittest/scopetest.cpp @@ -31,7 +31,7 @@ Q_DECLARE_METATYPE( Scope::SelectionScope ) class ScopeTest : public QObject { Q_OBJECT - private slots: + private Q_SLOTS: void testUidSet() { Scope scope( Scope::Uid ); diff --git a/shared/akapplication.h b/shared/akapplication.h index 90dafb7..27920fb 100644 --- a/shared/akapplication.h +++ b/shared/akapplication.h @@ -65,7 +65,7 @@ class AkApplication : public QObject static void setInstanceIdentifier( const QString& instanceId ); friend void akTestSetInstanceIdentifier(const QString&); - private slots: + private Q_SLOTS: void pollSessionBus() const; private: |