From 5b0b17f86ad09b48aa8f1699507b2b41f28e3ddc Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 1 Jul 2013 18:20:28 +0200 Subject: [PATCH 1/8] respect contents hints --- src/declarativeimports/plasmacomponents/qml/Dialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarativeimports/plasmacomponents/qml/Dialog.qml b/src/declarativeimports/plasmacomponents/qml/Dialog.qml index aac49eecb..7e40fb3f9 100644 --- a/src/declarativeimports/plasmacomponents/qml/Dialog.qml +++ b/src/declarativeimports/plasmacomponents/qml/Dialog.qml @@ -293,7 +293,7 @@ Item { Item { id: dialogLayout - width: Math.max(buttonItem.childrenRect.width, Math.min(contentItem.childrenRect.width, theme.mSize(theme.defaultFont).width * 30)) + width: Math.max(buttonItem.childrenRect.width, contentItem.childrenRect.width) height: titleBar.height + contentItem.childrenRect.height + buttonItem.childrenRect.height + 10 parent: internalLoader.dialog ? internalLoader.dialog : internalLoader.inlineDialog From 80bf4d66da1dd560f5660a5de3fde4027940e3c2 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Wed, 3 Jul 2013 19:16:19 +0200 Subject: [PATCH 2/8] Adapt to changes in QCommandLine --- src/plasmapkg/main.cpp | 30 +++++++++++++++--------------- src/plasmapkg/plasmapkg.cpp | 16 ++++++++-------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/plasmapkg/main.cpp b/src/plasmapkg/main.cpp index 4fcc18a8f..8e5f36600 100644 --- a/src/plasmapkg/main.cpp +++ b/src/plasmapkg/main.cpp @@ -26,30 +26,30 @@ int main(int argc, char **argv) { - QCommandLineParser *parser = new QCommandLineParser; - Plasma::PlasmaPkg app(argc, argv, parser); + QCommandLineParser parser; + Plasma::PlasmaPkg app(argc, argv, &parser); const QString description = i18n("Plasma Package Manager"); const char version[] = "2.0"; app.setApplicationVersion(version); - parser->addVersionOption(); - parser->addHelpOption(description); - parser->addOption(QCommandLineOption(QStringList() << "h" << "hash", i18nc("Do not translate ", "Generate a SHA1 hash for the package at "), "path")); - parser->addOption(QCommandLineOption(QStringList() << "g" << "global", i18n("For install or remove, operates on packages installed for all users."))); - parser->addOption(QCommandLineOption(QStringList() << "type", + parser.addVersionOption(); + parser.addHelpOption(description); + parser.addOption(QCommandLineOption(QStringList() << "h" << "hash", i18nc("Do not translate ", "Generate a SHA1 hash for the package at "), "path")); + parser.addOption(QCommandLineOption(QStringList() << "g" << "global", i18n("For install or remove, operates on packages installed for all users."))); + parser.addOption(QCommandLineOption(QStringList() << "type", i18nc("theme, wallpaper, etc. are keywords, but they may be translated, as both versions " "are recognized by the application " "(if translated, should be same as messages with 'package type' context below)", "The type of package, e.g. theme, wallpaper, plasmoid, dataengine, runner, layout-template, etc."), - "type", false, QStringList() << "plasmoid")); - parser->addOption(QCommandLineOption(QStringList() << "i" << "install", i18nc("Do not translate ", "Install the package at "), "path")); - parser->addOption(QCommandLineOption(QStringList() << "s" << "show", i18nc("Do not translate ", "Show information of package "), "name")); - parser->addOption(QCommandLineOption(QStringList() << "u" << "upgrade", i18nc("Do not translate ", "Upgrade the package at "), "path")); - parser->addOption(QCommandLineOption(QStringList() << "l" << "list", i18n("List installed packages"))); - parser->addOption(QCommandLineOption(QStringList() << "list-types", i18n("lists all known Package types that can be installed"))); - parser->addOption(QCommandLineOption(QStringList() << "r" << "remove", i18nc("Do not translate ", "Remove the package named "), "name")); - parser->addOption(QCommandLineOption(QStringList() << "p" << "packageroot", i18n("Absolute path to the package root. If not supplied, then the standard data directories for this KDE session will be searched instead."), "path")); + "type", "plasmoid")); + parser.addOption(QCommandLineOption(QStringList() << "i" << "install", i18nc("Do not translate ", "Install the package at "), "path")); + parser.addOption(QCommandLineOption(QStringList() << "s" << "show", i18nc("Do not translate ", "Show information of package "), "name")); + parser.addOption(QCommandLineOption(QStringList() << "u" << "upgrade", i18nc("Do not translate ", "Upgrade the package at "), "path")); + parser.addOption(QCommandLineOption(QStringList() << "l" << "list", i18n("List installed packages"))); + parser.addOption(QCommandLineOption(QStringList() << "list-types", i18n("lists all known Package types that can be installed"))); + parser.addOption(QCommandLineOption(QStringList() << "r" << "remove", i18nc("Do not translate ", "Remove the package named "), "name")); + parser.addOption(QCommandLineOption(QStringList() << "p" << "packageroot", i18n("Absolute path to the package root. If not supplied, then the standard data directories for this KDE session will be searched instead."), "path")); return app.exec(); } diff --git a/src/plasmapkg/plasmapkg.cpp b/src/plasmapkg/plasmapkg.cpp index 2aca95e00..87430f418 100644 --- a/src/plasmapkg/plasmapkg.cpp +++ b/src/plasmapkg/plasmapkg.cpp @@ -87,7 +87,7 @@ void PlasmaPkg::runMain() { Plasma::PackageStructure* structure = new Plasma::PackageStructure; if (d->parser->isSet("hash")) { - const QString path = d->parser->argument("hash"); + const QString path = d->parser->value("hash"); Plasma::Package package(structure); package.setPath(path); const QString hash = package.contentsHash(); @@ -107,19 +107,19 @@ void PlasmaPkg::runMain() return; } - QString type = d->parser->argument("type"); + QString type = d->parser->value("type"); QString packageRoot = type; d->pluginTypes.clear(); d->installer = 0; if (d->parser->isSet("remove")) { - d->package = d->parser->argument("remove"); + d->package = d->parser->value("remove"); } else if (d->parser->isSet("upgrade")) { - d->package = d->parser->argument("upgrade"); + d->package = d->parser->value("upgrade"); } else if (d->parser->isSet("install")) { - d->package = d->parser->argument("install"); + d->package = d->parser->value("install"); } else if (d->parser->isSet("show")) { - d->package = d->parser->argument("show"); + d->package = d->parser->value("show"); } if (!QDir::isAbsolutePath(d->package)) { @@ -269,7 +269,7 @@ void PlasmaPkg::runMain() if (!d->installer) { d->coutput(i18n("Could not load installer for package of type %1. Error reported was: %2", - d->parser->argument("type"), error)); + d->parser->value("type"), error)); return; } @@ -442,7 +442,7 @@ QString PlasmaPkg::findPackageRoot(const QString& pluginName, const QString& pre qWarning() << i18nc("The user entered conflicting options packageroot and global, this is the error message telling the user he can use only one", "The packageroot and global options conflict each other, please select only one."); ::exit(1); } else if (d->parser->isSet("packageroot")) { - packageRoot = d->parser->argument("packageroot"); + packageRoot = d->parser->value("packageroot"); //qDebug() << "(set via arg) d->packageRoot is: " << d->packageRoot; } else if (d->parser->isSet("global")) { packageRoot = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, d->packageRoot, QStandardPaths::LocateDirectory).last(); From b66943c9c50561602a56abfdb5e6542361624e50 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Wed, 3 Jul 2013 19:19:30 +0200 Subject: [PATCH 3/8] fix compilation Those components are required by some libraries. It seems to me that this should be fixed elsewhere, but also it's not acceptable to have modules that aren't compiling. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0fae48e4..49fffb833 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,8 +50,8 @@ find_package(kdeqt5staging REQUIRED NO_MODULE) # Load CMake, Compiler and InstallDirs settings from KF5 and the following are already somewhat "done" tier1/tier2 libs from kdelibs: find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs XmlGui KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver - KConfig KAuth kjs KWallet - ki18n kguiaddons kservice kwidgets ItemViews KNotifications KIconThemes KCompletion KJobWidgets KConfigWidgets) + KConfig KAuth kjs KWallet KDBusAddons + ki18n kguiaddons kservice kwidgets ItemViews KNotifications KIconThemes KCompletion KJobWidgets KConfigWidgets Sonnet ktextwidgets) #find_package(KF5Transitional REQUIRED) # those are not "done" yet: From 377e0d72f3180c804e66d656605e1b671232187e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Wed, 26 Jun 2013 01:09:51 +0200 Subject: [PATCH 4/8] fix some includes in porting script --- tools/port-plasma2.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/port-plasma2.sh b/tools/port-plasma2.sh index 2f114172e..804092ec2 100755 --- a/tools/port-plasma2.sh +++ b/tools/port-plasma2.sh @@ -40,7 +40,7 @@ for FS in `find $PWD -name '*.qml'`; do perl -p -i -e 's/QtQuick 1.1/QtQuick 2.0/g' $FS done -exit +#exit # Change plugin definitions, this is useful if you want to @@ -92,6 +92,12 @@ for FS in `find $PWD -name '*.h' -o -name '*.cpp'`; do perl -p -i -e 's/QGraphicsSceneWheel/QWheelEvent/g' $FS perl -p -i -e 's/QGraphicsSceneHoverEvent/QHoverEvent/g' $FS + # Fix up includes + perl -p -i -e 's/\#include \/\#include \/g' $FS + perl -p -i -e 's/\#include \/\#include \/g' $FS + perl -p -i -e 's/\#include \/\#include \/g' $FS + + done From 4fffde05479b6fd95da08c09cddda76141319e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Mon, 8 Jul 2013 01:39:55 +0200 Subject: [PATCH 5/8] ktextwidgets is gone --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49fffb833..b49ccbb7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,7 @@ find_package(kdeqt5staging REQUIRED NO_MODULE) find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs XmlGui KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver KConfig KAuth kjs KWallet KDBusAddons - ki18n kguiaddons kservice kwidgets ItemViews KNotifications KIconThemes KCompletion KJobWidgets KConfigWidgets Sonnet ktextwidgets) + ki18n kguiaddons kservice kwidgets ItemViews KNotifications KIconThemes KCompletion KJobWidgets KConfigWidgets Sonnet) #find_package(KF5Transitional REQUIRED) # those are not "done" yet: From ca5c059ecfab90b57b7dc88f4bbe29a25ff613df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Tue, 9 Jul 2013 00:55:03 +0200 Subject: [PATCH 6/8] KMenu becomes QMenu throughout --- src/plasma/tests/testcontainmentactionsplugin/test.cpp | 4 ++-- src/scriptengines/qml/plasmoid/containmentinterface.cpp | 8 ++++---- src/scriptengines/qml/plasmoid/containmentinterface.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plasma/tests/testcontainmentactionsplugin/test.cpp b/src/plasma/tests/testcontainmentactionsplugin/test.cpp index 8a09ff3cb..d7e6499ff 100644 --- a/src/plasma/tests/testcontainmentactionsplugin/test.cpp +++ b/src/plasma/tests/testcontainmentactionsplugin/test.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include @@ -60,7 +60,7 @@ void ContextTest::contextEvent(QGraphicsSceneMouseEvent *event) return; } - KMenu desktopMenu; + QMenu desktopMenu; desktopMenu.addTitle(m_text); desktopMenu.addAction(c->action("configure")); desktopMenu.exec(event->screenPos()); diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index d1f1644fb..bc3e3c202 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -207,7 +207,7 @@ void ContainmentInterface::mousePressEvent(QMouseEvent *event) void ContainmentInterface::mouseReleaseEvent(QMouseEvent *event) { - KMenu desktopMenu; + QMenu desktopMenu; //FIXME: very inefficient appletAt() implementation Plasma::Applet *applet = 0; @@ -234,7 +234,7 @@ void ContainmentInterface::mouseReleaseEvent(QMouseEvent *event) -void ContainmentInterface::addAppletActions(KMenu &desktopMenu, Plasma::Applet *applet, QEvent *event) +void ContainmentInterface::addAppletActions(QMenu &desktopMenu, Plasma::Applet *applet, QEvent *event) { foreach (QAction *action, applet->contextualActions()) { if (action) { @@ -254,7 +254,7 @@ void ContainmentInterface::addAppletActions(KMenu &desktopMenu, Plasma::Applet * } } - KMenu *containmentMenu = new KMenu(i18nc("%1 is the name of the containment", "%1 Options", containment()->title()), &desktopMenu); + QMenu *containmentMenu = new QMenu(i18nc("%1 is the name of the containment", "%1 Options", containment()->title()), &desktopMenu); addContainmentActions(*containmentMenu, event); if (!containmentMenu->isEmpty()) { @@ -296,7 +296,7 @@ void ContainmentInterface::addAppletActions(KMenu &desktopMenu, Plasma::Applet * } } -void ContainmentInterface::addContainmentActions(KMenu &desktopMenu, QEvent *event) +void ContainmentInterface::addContainmentActions(QMenu &desktopMenu, QEvent *event) { if (containment()->corona()->immutability() != Plasma::Types::Mutable && !KAuthorized::authorizeKAction("plasma/containment_actions")) { diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.h b/src/scriptengines/qml/plasmoid/containmentinterface.h index 39bd94bb8..660c0e005 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.h +++ b/src/scriptengines/qml/plasmoid/containmentinterface.h @@ -21,7 +21,7 @@ #ifndef CONTAINMENTINTERFACE_H #define CONTAINMENTINTERFACE_H -#include +#include #include @@ -74,8 +74,8 @@ protected: void mousePressEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); - void addAppletActions(KMenu &desktopMenu, Plasma::Applet *applet, QEvent *event); - void addContainmentActions(KMenu &desktopMenu, QEvent *event); + void addAppletActions(QMenu &desktopMenu, Plasma::Applet *applet, QEvent *event); + void addContainmentActions(QMenu &desktopMenu, QEvent *event); Q_SIGNALS: void appletAdded(QObject *applet); From ca3d78dd46969fdf6ddd571e62183f4aa7d8c825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Tue, 9 Jul 2013 01:50:34 +0200 Subject: [PATCH 7/8] Use module name in includes --- src/plasma/abstractrunner.cpp | 2 +- src/plasma/containment.h | 2 +- src/plasma/plasma.cpp | 2 +- src/plasma/querymatch.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plasma/abstractrunner.cpp b/src/plasma/abstractrunner.cpp index 518591695..a73e38ff3 100644 --- a/src/plasma/abstractrunner.cpp +++ b/src/plasma/abstractrunner.cpp @@ -19,7 +19,7 @@ #include "abstractrunner.h" -#include +#include #include #include #include diff --git a/src/plasma/containment.h b/src/plasma/containment.h index d2cc7a0bc..f5b35a2ee 100644 --- a/src/plasma/containment.h +++ b/src/plasma/containment.h @@ -23,7 +23,7 @@ #define PLASMA_CONTAINMENT_H #include -#include +#include #include #include diff --git a/src/plasma/plasma.cpp b/src/plasma/plasma.cpp index 57e3c7351..a6da2d526 100644 --- a/src/plasma/plasma.cpp +++ b/src/plasma/plasma.cpp @@ -19,7 +19,7 @@ #include -#include +#include #include #include "containment.h" diff --git a/src/plasma/querymatch.cpp b/src/plasma/querymatch.cpp index c3b068c24..ac9d7e780 100644 --- a/src/plasma/querymatch.cpp +++ b/src/plasma/querymatch.cpp @@ -19,7 +19,7 @@ #include "querymatch.h" -#include +#include #include #include #include From d61e2a44b27ad44c035f7db437553b743fb9f4fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Tue, 9 Jul 2013 02:29:57 +0200 Subject: [PATCH 8/8] Adapt to latest buildsystem changes --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b49ccbb7d..be7e797a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,6 @@ find_package(Qt5Core REQUIRED NO_MODULE) find_package(Qt5Transitional MODULE) find_package(Qt5Quick REQUIRED NO_MODULE) find_package(Qt5X11Extras REQUIRED NO_MODULE) -find_package(kde4support REQUIRED NO_MODULE) add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) @@ -55,6 +54,8 @@ find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs #find_package(KF5Transitional REQUIRED) # those are not "done" yet: +find_package(kde4support REQUIRED NO_MODULE) +find_package(ktextwidgets REQUIRED NO_MODULE) find_package(ki18n REQUIRED NO_MODULE) find_package(kio REQUIRED NO_MODULE) find_package(kdeclarative REQUIRED NO_MODULE)