diff --git a/CMakeLists.txt b/CMakeLists.txt index b51c8dde7..99721f6aa 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) @@ -58,11 +57,13 @@ 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) #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) 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 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 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/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(); 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);