Commit 4e6cfb39 authored by Alexander Lohnau's avatar Alexander Lohnau 💬

Prevent clang-format uglification

parent 8d7faee0
......@@ -285,12 +285,14 @@ QVariantList recentDocumentActions(KService::Ptr service)
return list;
}
// clang-format off
auto query = UsedResources
| RecentlyUsedFirst
| Agent(storageId)
| Type::any()
| Activity::current()
| Url::file();
// clang-format on
ResultSet results(query);
......@@ -343,11 +345,13 @@ bool handleRecentDocumentAction(KService::Ptr service, const QString &actionId,
return false;
}
// clang-format off
auto query = UsedResources
| Agent(storageId)
| Type::any()
| Activity::current()
| Url::file();
// clang-format on
KAStats::forgetResources(query);
......
......@@ -172,6 +172,7 @@ void RecentContactsModel::refresh()
{
QObject *oldModel = sourceModel();
// clang-format off
auto query = UsedResources
| RecentlyUsedFirst
| Agent(QStringLiteral("KTp"))
......@@ -179,6 +180,7 @@ void RecentContactsModel::refresh()
| Activity::current()
| Url::startsWith(QStringLiteral("ktp"))
| Limit(15);
// clang-format on
ResultModel *model = new ResultModel(query);
......
......@@ -513,11 +513,13 @@ void RecentUsageModel::refresh()
setSourceModel(nullptr);
delete oldModel;
// clang-format off
auto query = UsedResources
| (m_ordering == Recent ? RecentlyUsedFirst : HighScoredFirst)
| Agent::any()
| (m_usage == OnlyDocs ? Type::files() : Type::any())
| Activity::current();
// clang-format on
switch (m_usage) {
case AppsAndDocs:
......
......@@ -149,7 +149,7 @@ void FileMenu::open(int x, int y)
const bool canTrash = itemProperties.isLocal() && itemProperties.supportsMoving();
if (canTrash) {
QAction *moveToTrashAction = KStandardAction::moveToTrash(this, [this] {
auto moveToTrashLambda = [this] {
const QList<QUrl> urls{m_url};
KIO::JobUiDelegate uiDelegate;
......@@ -159,7 +159,8 @@ void FileMenu::open(int x, int y)
KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, urls,
QUrl(QStringLiteral("trash:/")), job);
}
}, menu);
};
QAction *moveToTrashAction = KStandardAction::moveToTrash(this, moveToTrashLambda, menu);
moveToTrashAction->setShortcut({}); // Can't focus notification to press Delete
menu->addAction(moveToTrashAction);
}
......@@ -168,7 +169,7 @@ void FileMenu::open(int x, int y)
const bool showDeleteCommand = cg.readEntry("ShowDeleteCommand", false);
if (itemProperties.supportsDeleting() && (!canTrash || showDeleteCommand)) {
QAction *deleteAction = KStandardAction::deleteFile(this, [this] {
auto deleteLambda = [this] {
const QList<QUrl> urls{m_url};
KIO::JobUiDelegate uiDelegate;
......@@ -176,7 +177,8 @@ void FileMenu::open(int x, int y)
auto *job = KIO::del(urls);
job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
}, menu);
};
QAction *deleteAction = KStandardAction::deleteFile(this, deleteLambda, menu);
deleteAction->setShortcut({});
menu->addAction(deleteAction);
}
......
......@@ -46,7 +46,7 @@ GlobalShortcuts::~GlobalShortcuts() = default;
void GlobalShortcuts::showDoNotDisturbOsd(bool doNotDisturb) const
{
QDBusMessage msg = QDBusMessage::createMethodCall(
QDBusMessage msg = QDBusMessage::createMethodCall(//
QStringLiteral("org.kde.plasmashell"),
QStringLiteral("/org/kde/osdService"),
QStringLiteral("org.kde.osdService"),
......
......@@ -122,6 +122,7 @@ QString JobPrivate::prettyDestUrl() const
void JobPrivate::updateHasDetails()
{
// clang-format off
const bool hasDetails = m_totalBytes > 0
|| m_totalFiles > 0
|| m_totalDirectories > 0
......@@ -133,6 +134,7 @@ void JobPrivate::updateHasDetails()
|| !m_descriptionValue1.isEmpty()
|| !m_descriptionValue2.isEmpty()
|| m_speed > 0;
// clang-format on
if (m_hasDetails != hasDetails) {
m_hasDetails = hasDetails;
......
......@@ -59,6 +59,7 @@ void RecentDocuments::match(Plasma::RunnerContext &context)
return;
}
// clang-format off
const QString term = context.query();
auto query = UsedResources
| Activity::current()
......@@ -67,6 +68,7 @@ void RecentDocuments::match(Plasma::RunnerContext &context)
// we search only on file name, as KActivity does not support better options
| Url("/*/" + term + "*")
| Limit(20);
// clang-format on
const auto result = new ResultModel(query);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment