Merge branch 'master' into sebas/kplugins
Conflicts: CMakeLists.txt
This commit is contained in:
commit
21c04fd3d3
@ -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)
|
||||
|
@ -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
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include "abstractrunner.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QtWidgets/QAction>
|
||||
#include <QHash>
|
||||
#include <QMenu>
|
||||
#include <QMimeData>
|
||||
|
@ -23,7 +23,7 @@
|
||||
#define PLASMA_CONTAINMENT_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
#include <kplugininfo.h>
|
||||
#include <ksharedconfig.h>
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include <plasma/plasma.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QtWidgets/QAction>
|
||||
#include <QMenu>
|
||||
|
||||
#include "containment.h"
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include "querymatch.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QtWidgets/QAction>
|
||||
#include <QIcon>
|
||||
#include <QReadWriteLock>
|
||||
#include <QSharedData>
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <QGraphicsSceneWheelEvent>
|
||||
|
||||
#include <KDebug>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
|
||||
#include <Plasma/Containment>
|
||||
|
||||
@ -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());
|
||||
|
@ -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 <path>", "Generate a SHA1 hash for the package at <path>"), "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 <path>", "Generate a SHA1 hash for the package at <path>"), "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 <path>", "Install the package at <path>"), "path"));
|
||||
parser->addOption(QCommandLineOption(QStringList() << "s" << "show", i18nc("Do not translate <name>", "Show information of package <name>"), "name"));
|
||||
parser->addOption(QCommandLineOption(QStringList() << "u" << "upgrade", i18nc("Do not translate <path>", "Upgrade the package at <path>"), "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 <name>", "Remove the package named <name>"), "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 <path>", "Install the package at <path>"), "path"));
|
||||
parser.addOption(QCommandLineOption(QStringList() << "s" << "show", i18nc("Do not translate <name>", "Show information of package <name>"), "name"));
|
||||
parser.addOption(QCommandLineOption(QStringList() << "u" << "upgrade", i18nc("Do not translate <path>", "Upgrade the package at <path>"), "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 <name>", "Remove the package named <name>"), "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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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")) {
|
||||
|
@ -21,7 +21,7 @@
|
||||
#ifndef CONTAINMENTINTERFACE_H
|
||||
#define CONTAINMENTINTERFACE_H
|
||||
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
|
||||
#include <Plasma/Containment>
|
||||
|
||||
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user