Commit 43050385 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Pedantic

parent c9aa2c41
Pipeline #42045 passed with stage
in 12 minutes and 35 seconds
......@@ -101,8 +101,8 @@ public Q_SLOTS:
void updatePluralLabel(int type, int count)
{
Q_UNUSED(type);
Q_UNUSED(count);
Q_UNUSED(type)
Q_UNUSED(count)
}
bool isFavoriteCollection(const Akonadi::Collection &collection)
......@@ -112,7 +112,7 @@ public Q_SLOTS:
void updateAlternatingAction(int action)
{
Q_UNUSED(action);
Q_UNUSED(action)
}
private Q_SLOTS:
......
......@@ -128,7 +128,7 @@ private:
public Q_SLOTS:
void syncBenchmarkProgress(KJob *job, ulong percent)
{
Q_UNUSED(job);
Q_UNUSED(job)
qDebug() << "CollectionSync progress:" << percent << "%";
}
......
......@@ -274,7 +274,7 @@ void FakeJobResponse::parseEntityString(QList<FakeJobResponse *> &collectionResp
} else {
type = entityString;
}
Q_UNUSED(order);
Q_UNUSED(order)
item.setMimeType(type);
item.setId(fakeServerData->nextItemId());
......
......@@ -104,7 +104,7 @@ public Q_SLOTS:
void setSession(const QByteArray &session)
{
Q_UNUSED(session);
Q_UNUSED(session)
}
};
......@@ -150,7 +150,7 @@ public:
}
void destroyNotificationConnection(Akonadi::Session *parent, Akonadi::Connection *connection) override {
Q_UNUSED(parent);
Q_UNUSED(parent)
delete connection;
}
......
......@@ -28,7 +28,7 @@ bool TestSerializer::deserialize(Akonadi::Item &item, const QByteArray &label, Q
if (label != Akonadi::Item::FullPayload) {
return false;
}
Q_UNUSED(version);
Q_UNUSED(version)
item.setPayload(data.readAll());
return true;
......@@ -38,8 +38,8 @@ void TestSerializer::serialize(const Akonadi::Item &item, const QByteArray &labe
{
qDebug();
Q_ASSERT(label == Akonadi::Item::FullPayload);
Q_UNUSED(label);
Q_UNUSED(version);
Q_UNUSED(label)
Q_UNUSED(version)
data.write(item.payload<QByteArray>());
}
......
......@@ -99,7 +99,7 @@ void KnutResource::configure(WId windowId)
}
// TODO: Use windowId
Q_UNUSED(windowId);
Q_UNUSED(windowId)
const QString newFile = QFileDialog::getSaveFileName(
nullptr, i18n("Select Data File"), QString(),
QStringLiteral("*.xml |") + i18nc("Filedialog filter for Akonadi data file", "Akonadi Knut Data File"));
......@@ -140,7 +140,7 @@ void KnutResource::retrieveItems(const Akonadi::Collection &collection)
#ifdef DO_IT_THE_OLD_WAY
bool KnutResource::retrieveItem(const Item &item, const QSet<QByteArray> &parts)
{
Q_UNUSED(parts);
Q_UNUSED(parts)
const QDomElement itemElem = mDocument.itemElementByRemoteId(item.remoteId());
if (itemElem.isNull()) {
......@@ -157,7 +157,7 @@ bool KnutResource::retrieveItem(const Item &item, const QSet<QByteArray> &parts)
bool KnutResource::retrieveItems(const Item::List &items, const QSet<QByteArray> &parts)
{
Q_UNUSED(parts);
Q_UNUSED(parts)
Item::List results;
results.reserve(items.size());
......@@ -264,7 +264,7 @@ void KnutResource::itemAdded(const Akonadi::Item &item, const Akonadi::Collectio
void KnutResource::itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &parts)
{
Q_UNUSED(parts);
Q_UNUSED(parts)
const QDomElement oldElem = mDocument.itemElementByRemoteId(item.remoteId());
if (oldElem.isNull()) {
......@@ -345,7 +345,7 @@ QSet<qint64> KnutResource::parseQuery(const QString &queryString)
void KnutResource::search(const QString &query, const Collection &collection)
{
Q_UNUSED(collection);
Q_UNUSED(collection)
const QVector<qint64> result = parseQuery(query).values().toVector();
qCDebug(KNUTRESOURCE_LOG) << "KNUT QUERY:" << query;
qCDebug(KNUTRESOURCE_LOG) << "KNUT RESOURCE:" << result;
......@@ -354,16 +354,16 @@ void KnutResource::search(const QString &query, const Collection &collection)
void KnutResource::addSearch(const QString &query, const QString &queryLanguage, const Collection &resultCollection)
{
Q_UNUSED(query);
Q_UNUSED(queryLanguage);
Q_UNUSED(resultCollection);
Q_UNUSED(query)
Q_UNUSED(queryLanguage)
Q_UNUSED(resultCollection)
qCDebug(KNUTRESOURCE_LOG) << "addSearch: query=" << query << ", queryLanguage="
<< queryLanguage << ", resultCollection=" << resultCollection.id();
}
void KnutResource::removeSearch(const Collection &resultCollection)
{
Q_UNUSED(resultCollection);
Q_UNUSED(resultCollection)
qCDebug(KNUTRESOURCE_LOG) << "removeSearch:" << resultCollection.id();
}
......
......@@ -11,8 +11,8 @@
QSet<qint64> TestSearchPlugin::search(const QString &query, const QVector<qint64> &collections, const QStringList &mimeTypes)
{
Q_UNUSED(collections);
Q_UNUSED(mimeTypes);
Q_UNUSED(collections)
Q_UNUSED(mimeTypes)
const QSet<qint64> result = parseQuery(query);
qDebug() << "PLUGIN QUERY:" << query;
qDebug() << "PLUGIN RESULT:" << result;
......
......@@ -28,7 +28,7 @@ Resource DbInitializer::createResource(const char *name)
res.setName(QLatin1String(name));
const bool ret = res.insert(&id);
Q_ASSERT(ret);
Q_UNUSED(ret);
Q_UNUSED(ret)
mResource = res;
return res;
}
......@@ -44,7 +44,7 @@ Collection DbInitializer::createCollection(const char *name, const Collection &p
col.setResource(mResource);
const bool ret = col.insert();
Q_ASSERT(ret);
Q_UNUSED(ret);
Q_UNUSED(ret)
return col;
}
......@@ -63,7 +63,7 @@ PimItem DbInitializer::createItem(const char *name, const Collection &parent)
item.setRemoteId(QLatin1String(name));
const bool ret = item.insert() ;
Q_ASSERT(ret);
Q_UNUSED(ret);
Q_UNUSED(ret)
return item;
}
......@@ -79,7 +79,7 @@ Part DbInitializer::createPart(qint64 pimItem, const QByteArray &partName, const
part.setDatasize(partData.size());
const bool ret = part.insert();
Q_ASSERT(ret);
Q_UNUSED(ret);
Q_UNUSED(ret)
return part;
}
......
......@@ -45,29 +45,29 @@ public:
bool hasTable(const QString &tableName) override
{
Q_UNUSED(tableName);
Q_UNUSED(tableName)
return m_hasTable;
}
bool hasIndex(const QString &tableName, const QString &indexName) override
{
Q_UNUSED(tableName);
Q_UNUSED(indexName);
Q_UNUSED(tableName)
Q_UNUSED(indexName)
return m_hasIndex;
}
bool hasColumn(const QString &tableName, const QString &columnName) override
{
Q_UNUSED(tableName);
Q_UNUSED(columnName);
Q_UNUSED(tableName)
Q_UNUSED(columnName)
return false;
}
bool isTableEmpty(const QString &tableName) override
{
Q_UNUSED(tableName);
Q_UNUSED(tableName)
return m_tableEmpty;
}
QVector< ForeignKey > foreignKeyConstraints(const QString &tableName) override
{
Q_UNUSED(tableName);
Q_UNUSED(tableName)
return m_foreignKeys;
}
......
......@@ -42,6 +42,6 @@ int FakeIntervalCheck::collectionScheduleInterval(const Collection &collection)
void FakeIntervalCheck::collectionExpired(const Collection &collection)
{
Q_UNUSED(collection);
Q_UNUSED(collection)
// Nothing here. The granularity is in whole minutes, we don't have time to wait for that in a unittest.
}
......@@ -22,22 +22,22 @@ FakeSearchManager::~FakeSearchManager()
void FakeSearchManager::registerInstance(const QString &id)
{
Q_UNUSED(id);
Q_UNUSED(id)
}
void FakeSearchManager::unregisterInstance(const QString &id)
{
Q_UNUSED(id);
Q_UNUSED(id)
}
void FakeSearchManager::updateSearch(const Collection &collection)
{
Q_UNUSED(collection);
Q_UNUSED(collection)
}
void FakeSearchManager::updateSearchAsync(const Collection &collection)
{
Q_UNUSED(collection);
Q_UNUSED(collection)
}
QVector<Akonadi::AbstractSearchPlugin *> FakeSearchManager::searchPlugins() const
......
......@@ -66,8 +66,8 @@ AgentBase::Observer::~Observer()
void AgentBase::Observer::itemAdded(const Item &item, const Collection &collection)
{
Q_UNUSED(item);
Q_UNUSED(collection);
Q_UNUSED(item)
Q_UNUSED(collection)
if (sAgentBase) {
sAgentBase->d_ptr->changeProcessed();
}
......@@ -75,8 +75,8 @@ void AgentBase::Observer::itemAdded(const Item &item, const Collection &collecti
void AgentBase::Observer::itemChanged(const Item &item, const QSet<QByteArray> &partIdentifiers)
{
Q_UNUSED(item);
Q_UNUSED(partIdentifiers);
Q_UNUSED(item)
Q_UNUSED(partIdentifiers)
if (sAgentBase) {
sAgentBase->d_ptr->changeProcessed();
}
......@@ -84,7 +84,7 @@ void AgentBase::Observer::itemChanged(const Item &item, const QSet<QByteArray> &
void AgentBase::Observer::itemRemoved(const Item &item)
{
Q_UNUSED(item);
Q_UNUSED(item)
if (sAgentBase) {
sAgentBase->d_ptr->changeProcessed();
}
......@@ -92,8 +92,8 @@ void AgentBase::Observer::itemRemoved(const Item &item)
void AgentBase::Observer::collectionAdded(const Akonadi::Collection &collection, const Akonadi::Collection &parent)
{
Q_UNUSED(collection);
Q_UNUSED(parent);
Q_UNUSED(collection)
Q_UNUSED(parent)
if (sAgentBase) {
sAgentBase->d_ptr->changeProcessed();
}
......@@ -101,7 +101,7 @@ void AgentBase::Observer::collectionAdded(const Akonadi::Collection &collection,
void AgentBase::Observer::collectionChanged(const Collection &collection)
{
Q_UNUSED(collection);
Q_UNUSED(collection)
if (sAgentBase) {
sAgentBase->d_ptr->changeProcessed();
}
......@@ -109,7 +109,7 @@ void AgentBase::Observer::collectionChanged(const Collection &collection)
void AgentBase::Observer::collectionRemoved(const Collection &collection)
{
Q_UNUSED(collection);
Q_UNUSED(collection)
if (sAgentBase) {
sAgentBase->d_ptr->changeProcessed();
}
......@@ -117,9 +117,9 @@ void AgentBase::Observer::collectionRemoved(const Collection &collection)
void AgentBase::ObserverV2::itemMoved(const Akonadi::Item &item, const Akonadi::Collection &source, const Akonadi::Collection &dest)
{
Q_UNUSED(item);
Q_UNUSED(source);
Q_UNUSED(dest);
Q_UNUSED(item)
Q_UNUSED(source)
Q_UNUSED(dest)
if (sAgentBase) {
sAgentBase->d_ptr->changeProcessed();
}
......@@ -127,8 +127,8 @@ void AgentBase::ObserverV2::itemMoved(const Akonadi::Item &item, const Akonadi::
void AgentBase::ObserverV2::itemLinked(const Akonadi::Item &item, const Akonadi::Collection &collection)
{
Q_UNUSED(item);
Q_UNUSED(collection);
Q_UNUSED(item)
Q_UNUSED(collection)
if (sAgentBase) {
// not implementation, let's disconnect the signal to enable optimizations in Monitor
QObject::disconnect(sAgentBase->changeRecorder(), &Monitor::itemLinked,
......@@ -139,8 +139,8 @@ void AgentBase::ObserverV2::itemLinked(const Akonadi::Item &item, const Akonadi:
void AgentBase::ObserverV2::itemUnlinked(const Akonadi::Item &item, const Akonadi::Collection &collection)
{
Q_UNUSED(item);
Q_UNUSED(collection);
Q_UNUSED(item)
Q_UNUSED(collection)
if (sAgentBase) {
// not implementation, let's disconnect the signal to enable optimizations in Monitor
QObject::disconnect(sAgentBase->changeRecorder(), &Monitor::itemUnlinked,
......@@ -151,9 +151,9 @@ void AgentBase::ObserverV2::itemUnlinked(const Akonadi::Item &item, const Akonad
void AgentBase::ObserverV2::collectionMoved(const Akonadi::Collection &collection, const Akonadi::Collection &source, const Akonadi::Collection &dest)
{
Q_UNUSED(collection);
Q_UNUSED(source);
Q_UNUSED(dest);
Q_UNUSED(collection)
Q_UNUSED(source)
Q_UNUSED(dest)
if (sAgentBase) {
sAgentBase->d_ptr->changeProcessed();
}
......@@ -161,15 +161,15 @@ void AgentBase::ObserverV2::collectionMoved(const Akonadi::Collection &collectio
void AgentBase::ObserverV2::collectionChanged(const Akonadi::Collection &collection, const QSet<QByteArray> &changedAttributes)
{
Q_UNUSED(changedAttributes);
Q_UNUSED(changedAttributes)
collectionChanged(collection);
}
void AgentBase::ObserverV3::itemsFlagsChanged(const Akonadi::Item::List &items, const QSet<QByteArray> &addedFlags, const QSet<QByteArray> &removedFlags)
{
Q_UNUSED(items);
Q_UNUSED(addedFlags);
Q_UNUSED(removedFlags);
Q_UNUSED(items)
Q_UNUSED(addedFlags)
Q_UNUSED(removedFlags)
if (sAgentBase) {
// not implementation, let's disconnect the signal to enable optimizations in Monitor
......@@ -181,9 +181,9 @@ void AgentBase::ObserverV3::itemsFlagsChanged(const Akonadi::Item::List &items,
void AgentBase::ObserverV3::itemsMoved(const Akonadi::Item::List &items, const Collection &sourceCollection, const Collection &destinationCollection)
{
Q_UNUSED(items);
Q_UNUSED(sourceCollection);
Q_UNUSED(destinationCollection);
Q_UNUSED(items)
Q_UNUSED(sourceCollection)
Q_UNUSED(destinationCollection)
if (sAgentBase) {
// not implementation, let's disconnect the signal to enable optimizations in Monitor
......@@ -195,7 +195,7 @@ void AgentBase::ObserverV3::itemsMoved(const Akonadi::Item::List &items, const C
void AgentBase::ObserverV3::itemsRemoved(const Akonadi::Item::List &items)
{
Q_UNUSED(items);
Q_UNUSED(items)
if (sAgentBase) {
// not implementation, let's disconnect the signal to enable optimizations in Monitor
......@@ -207,8 +207,8 @@ void AgentBase::ObserverV3::itemsRemoved(const Akonadi::Item::List &items)
void AgentBase::ObserverV3::itemsLinked(const Akonadi::Item::List &items, const Collection &collection)
{
Q_UNUSED(items);
Q_UNUSED(collection);
Q_UNUSED(items)
Q_UNUSED(collection)
if (sAgentBase) {
// not implementation, let's disconnect the signal to enable optimizations in Monitor
......@@ -220,7 +220,7 @@ void AgentBase::ObserverV3::itemsLinked(const Akonadi::Item::List &items, const
void AgentBase::ObserverV3::itemsUnlinked(const Akonadi::Item::List &items, const Collection &collection)
{
Q_UNUSED(items);
Q_UNUSED(items)
Q_UNUSED(collection)
if (sAgentBase) {
......@@ -233,7 +233,7 @@ void AgentBase::ObserverV3::itemsUnlinked(const Akonadi::Item::List &items, cons
void AgentBase::ObserverV4::tagAdded(const Tag &tag)
{
Q_UNUSED(tag);
Q_UNUSED(tag)
if (sAgentBase) {
// not implementation, let's disconnect the signal to enable optimization in Monitor
......@@ -245,7 +245,7 @@ void AgentBase::ObserverV4::tagAdded(const Tag &tag)
void AgentBase::ObserverV4::tagChanged(const Tag &tag)
{
Q_UNUSED(tag);
Q_UNUSED(tag)
if (sAgentBase) {
// not implementation, let's disconnect the signal to enable optimization in Monitor
......@@ -257,7 +257,7 @@ void AgentBase::ObserverV4::tagChanged(const Tag &tag)
void AgentBase::ObserverV4::tagRemoved(const Tag &tag)
{
Q_UNUSED(tag);
Q_UNUSED(tag)
if (sAgentBase) {
// not implementation, let's disconnect the signal to enable optimization in Monitor
......@@ -269,9 +269,9 @@ void AgentBase::ObserverV4::tagRemoved(const Tag &tag)
void AgentBase::ObserverV4::itemsTagsChanged(const Item::List &items, const QSet<Tag> &addedTags, const QSet<Tag> &removedTags)
{
Q_UNUSED(items);
Q_UNUSED(addedTags);
Q_UNUSED(removedTags);
Q_UNUSED(items)
Q_UNUSED(addedTags)
Q_UNUSED(removedTags)
if (sAgentBase) {
// not implementation, let's disconnect the signal to enable optimization in Monitor
......@@ -727,14 +727,14 @@ void AgentBasePrivate::collectionRemoved(const Akonadi::Collection &collection)
void AgentBasePrivate::collectionSubscribed(const Akonadi::Collection &collection, const Akonadi::Collection &parent)
{
Q_UNUSED(collection);
Q_UNUSED(parent);
Q_UNUSED(collection)
Q_UNUSED(parent)
changeProcessed();
}
void AgentBasePrivate::collectionUnsubscribed(const Akonadi::Collection &collection)
{
Q_UNUSED(collection);
Q_UNUSED(collection)
changeProcessed();
}
......@@ -803,7 +803,7 @@ void AgentBasePrivate::slotError(const QString &message)
void AgentBasePrivate::slotNetworkStatusChange(bool isOnline)
{
Q_UNUSED(isOnline);
Q_UNUSED(isOnline)
Q_Q(AgentBase);
q->setOnlineInternal(mDesiredOnlineState);
}
......@@ -883,7 +883,7 @@ AgentBase::~AgentBase()
void AgentBase::debugAgent(int argc, char **argv)
{
Q_UNUSED(argc);
Q_UNUSED(argc)
#ifdef Q_OS_WIN
if (qEnvironmentVariableIsSet("AKONADI_DEBUG_WAIT")) {
if (QByteArray(argv[0]).endsWith(qgetenv("AKONADI_DEBUG_WAIT") + ".exe")) {
......@@ -894,13 +894,13 @@ void AgentBase::debugAgent(int argc, char **argv)
}
}
#else
Q_UNUSED(argv);
Q_UNUSED(argv)
#endif
}
QString AgentBase::parseArguments(int argc, char **argv)
{
Q_UNUSED(argc);
Q_UNUSED(argc)
QCommandLineOption identifierOption(QStringLiteral("identifier"), i18n("Agent identifier"),
QStringLiteral("argument"));
......@@ -1060,7 +1060,7 @@ void AgentBase::setOnlineInternal(bool state)
void AgentBase::doSetOnline(bool online)
{
Q_UNUSED(online);
Q_UNUSED(online)
}
KAboutData AgentBase::aboutData() const
......@@ -1070,7 +1070,7 @@ KAboutData AgentBase::aboutData() const
void AgentBase::configure(WId windowId)
{
Q_UNUSED(windowId);
Q_UNUSED(windowId)
// Fallback if the agent implements the new plugin-based configuration,
// but someone calls the deprecated configure() method
......
......@@ -29,7 +29,7 @@ void PreprocessorBase::finishProcessing(ProcessingResult result)
Q_ASSERT_X(result != ProcessingDelayed, "PreprocessorBase::terminateProcessing", "You should never pass ProcessingDelayed to this function");
Q_ASSERT_X(d->mInDelayedProcessing, "PreprocessorBase::terminateProcessing", "terminateProcessing() called while not in delayed processing mode");
Q_UNUSED(result);
Q_UNUSED(result)
d->mInDelayedProcessing = false;
Q_EMIT d->itemProcessed(d->mDelayedProcessingItemId);
......
......@@ -515,7 +515,7 @@ QString ResourceBase::name() const
QString ResourceBase::parseArguments(int argc, char **argv)
{
Q_UNUSED(argc);
Q_UNUSED(argc)
QCommandLineOption identifierOption(QStringLiteral("identifier"),
i18nc("@label command line option", "Resource identifier"),
......@@ -1449,8 +1449,8 @@ void ResourceBase::retrieveRelations()
bool ResourceBase::retrieveItem(const Akonadi::Item &item, const QSet<QByteArray> &parts)
{
Q_UNUSED(item);
Q_UNUSED(parts);
Q_UNUSED(item)
Q_UNUSED(parts)
// retrieveItem() can no longer be pure virtual, because then we could not mark
// it as deprecated (i.e. implementations would still be forced to implement it),
// so instead we assert here.
......
......@@ -365,7 +365,7 @@ uint AgentManager::agentInstanceProgress(const QString &identifier) const
QString AgentManager::agentInstanceProgressMessage(const QString &identifier) const
{
Q_UNUSED(identifier);
Q_UNUSED(identifier)
return QString();
}
......@@ -636,7 +636,7 @@ void AgentManager::save()
void AgentManager::serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner)
{
Q_UNUSED(oldOwner);
Q_UNUSED(oldOwner)
// This is called by the D-Bus server when a service comes up, goes down or changes ownership for some reason
// and this is where we "hook up" our different Agent interfaces.
......
......@@ -28,7 +28,7 @@ AgentType::AgentType()
bool AgentType::load(const QString &fileName, AgentManager *manager)
{
Q_UNUSED(manager);
Q_UNUSED(manager)
if (!KDesktopFile::isDesktopFile(fileName)) {
return false;
......
......@@ -36,5 +36,5 @@ QByteArray EntityHiddenAttribute::serialized() const
void EntityHiddenAttribute::deserialize(const QByteArray &data)
{
Q_ASSERT(data.isEmpty());
Q_UNUSED(data);
Q_UNUSED(data)
}
......@@ -60,7 +60,7 @@ void ChangeMediator::invalidateCollection(const Akonadi::Collection &collection)