From a74dccc1ba32619ba0aaa4ab1cb3a6c564509ac1 Mon Sep 17 00:00:00 2001 From: Lana Black Date: Sun, 9 Jun 2024 23:21:15 +0000 Subject: [PATCH] Small fixes. --- app/layouts/importer.cpp | 15 ++++++++------- app/layouts/manager.cpp | 1 + app/layouts/storage.cpp | 8 ++++---- app/layouts/synchronizer.cpp | 4 ++-- app/package/lattepackage.cpp | 1 - app/plasma/extended/backgroundcache.cpp | 2 +- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/layouts/importer.cpp b/app/layouts/importer.cpp index 4fb4284ed..872dea08c 100644 --- a/app/layouts/importer.cpp +++ b/app/layouts/importer.cpp @@ -20,11 +20,12 @@ // Qt #include #include +#include // KDE -#include -#include -#include +#include +#include +#include #include #include #include @@ -740,7 +741,7 @@ QString Importer::layoutTemplateSystemFilePath(const QString &name) QString Importer::uniqueLayoutName(QString name) { - int pos_ = name.lastIndexOf(QRegExp(QString(" - [0-9]+"))); + int pos_ = name.lastIndexOf(QRegularExpression(QString(" - [0-9]+"))); if (layoutExists(name) && pos_ > 0) { name = name.left(pos_); @@ -797,14 +798,14 @@ QStringList Importer::checkRepairMultipleLayoutsLinkedFile() KConfigGroup linkedContainments = KConfigGroup(filePtr, "Containments"); //! layoutName and its Containments - QHash linkedLayoutContainmentGroups; + QMultiMap linkedLayoutContainmentGroups; for(const auto &cId : linkedContainments.groupList()) { QString layoutName = linkedContainments.group(cId).readEntry("layoutId", QString()); if (!layoutName.isEmpty()) { qDebug() << layoutName; - linkedLayoutContainmentGroups[layoutName].append(cId); + linkedLayoutContainmentGroups.insert(layoutName,cId); linkedContainments.group(cId).writeEntry("layoutId", QString()); } } @@ -821,7 +822,7 @@ QStringList Importer::checkRepairMultipleLayoutsLinkedFile() origLayoutContainments.deleteGroup(); //Update containments - for(const auto &cId : linkedLayoutContainmentGroups[layoutName]) { + for(const auto &cId : linkedLayoutContainmentGroups.values(layoutName)) { KConfigGroup newContainment = origLayoutContainments.group(cId); linkedContainments.group(cId).copyTo(&newContainment); linkedContainments.group(cId).deleteGroup(); diff --git a/app/layouts/manager.cpp b/app/layouts/manager.cpp index 118ad97b6..382740c2f 100644 --- a/app/layouts/manager.cpp +++ b/app/layouts/manager.cpp @@ -31,6 +31,7 @@ #include #include #include +#include namespace Latte { namespace Layouts { diff --git a/app/layouts/storage.cpp b/app/layouts/storage.cpp index a0b77a2b9..aa7de47b0 100644 --- a/app/layouts/storage.cpp +++ b/app/layouts/storage.cpp @@ -31,7 +31,7 @@ #include // Plasma -#include +#include #include #include @@ -696,7 +696,7 @@ Data::View Storage::newView(const Layout::GenericLayout *destinationLayout, cons Plasma::Containment *newContainment = (importedViews.size() == 1 ? importedViews[0] : nullptr); - if (!newContainment || !newContainment->kPackage().isValid()) { + if (!newContainment || !newContainment->pluginMetaData().isValid()) { qWarning() << "the requested containment plugin can not be located or loaded from:" << templateFile; return Data::View(); } @@ -1122,7 +1122,7 @@ bool Storage::hasOrphanedParentAppletOfSubContainment(const Layout::GenericLayou errorinfo.containment.storageId = cid; errorinfo.applet = metadata(applet->pluginMetaData().pluginId()); errorinfo.applet.storageId = aid; - errorinfo.applet.subcontainmentId = subid; + errorinfo.applet.subcontainmentId = QString::number(subid); error.information << errorinfo; } @@ -1146,7 +1146,7 @@ bool Storage::hasOrphanedParentAppletOfSubContainment(const Layout::GenericLayou errorinfo.containment.storageId = cid; errorinfo.applet = metadata(containmentsEntries.group(cid).group("Applets").group(aid).readEntry("plugin", "")); errorinfo.applet.storageId = aid; - errorinfo.applet.subcontainmentId = subid; + errorinfo.applet.subcontainmentId = QString::number(subid); error.information << errorinfo; } diff --git a/app/layouts/synchronizer.cpp b/app/layouts/synchronizer.cpp index b12b175ee..22cd41da1 100644 --- a/app/layouts/synchronizer.cpp +++ b/app/layouts/synchronizer.cpp @@ -26,10 +26,10 @@ // Plasma #include +#include +#include // KDE -#include -#include #include #define LAYOUTSINITINTERVAL 350 diff --git a/app/package/lattepackage.cpp b/app/package/lattepackage.cpp index 21765557d..a223bbff6 100644 --- a/app/package/lattepackage.cpp +++ b/app/package/lattepackage.cpp @@ -13,7 +13,6 @@ // KDE #include -#include namespace Latte { diff --git a/app/plasma/extended/backgroundcache.cpp b/app/plasma/extended/backgroundcache.cpp index 1334d6802..cd99d8dfb 100644 --- a/app/plasma/extended/backgroundcache.cpp +++ b/app/plasma/extended/backgroundcache.cpp @@ -18,7 +18,7 @@ #include // Plasma -#include +#include // KDE #include