Small fixes.

work/plasma6
Lana Black 8 months ago
parent 544ea8fcb0
commit a74dccc1ba

@ -20,11 +20,12 @@
// Qt
#include <QFile>
#include <QLatin1String>
#include <QRegularExpression>
// KDE
#include <KArchive/KTar>
#include <KArchive/KArchiveEntry>
#include <KArchive/KArchiveDirectory>
#include <KTar>
#include <KArchiveEntry>
#include <KArchiveDirectory>
#include <KConfigGroup>
#include <KLocalizedString>
#include <KNotification>
@ -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<QString, QStringList> linkedLayoutContainmentGroups;
QMultiMap<QString, QString> 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();

@ -31,6 +31,7 @@
#include <KMessageBox>
#include <KLocalizedString>
#include <KNotification>
#include <KPackage/Package>
namespace Latte {
namespace Layouts {

@ -31,7 +31,7 @@
#include <KPackage/PackageLoader>
// Plasma
#include <Plasma>
#include <Plasma/Plasma>
#include <Plasma/Applet>
#include <Plasma/Containment>
@ -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;
}

@ -26,10 +26,10 @@
// Plasma
#include <Plasma/Containment>
#include <PlasmaActivities/Consumer>
#include <PlasmaActivities/Controller>
// KDE
#include <KActivities/Consumer>
#include <KActivities/Controller>
#include <KWindowSystem>
#define LAYOUTSINITINTERVAL 350

@ -13,7 +13,6 @@
// KDE
#include <KPackage/PackageLoader>
#include <KLocalizedString>
namespace Latte {

@ -18,7 +18,7 @@
#include <QLatin1String>
// Plasma
#include <Plasma>
#include <Plasma/Plasma>
// KDE
#include <KConfigGroup>

Loading…
Cancel
Save