complete porting

This commit is contained in:
Marco Martin 2014-02-19 20:00:29 +01:00
parent d3253428dc
commit 90c608f863
11 changed files with 32 additions and 32 deletions

View File

@ -38,7 +38,7 @@ generate_export_header(KF5PlasmaQuick BASE_NAME PlasmaQuick)
set(plasmaquick_LIB_INCLUDES
${CMAKE_CURRENT_BINARY_DIR}/plasmaquick_export.h
appletquickitem.h
plasmaquickview.h
view.h
configview.h
configmodel.h
packageurlinterceptor.h

View File

@ -49,7 +49,7 @@ namespace Plasma
class ConfigLoader;
} // namespace Plasma
class AppletInterface : public AppletQuickItem
class AppletInterface : public PlasmaQuick::AppletQuickItem
{
Q_OBJECT

View File

@ -115,7 +115,7 @@ void ContainmentInterface::init()
pkg.setPath("org.kde.desktoptoolbox");
}
PackageUrlInterceptor *interceptor = dynamic_cast<PackageUrlInterceptor *>(qmlObject()->engine()->urlInterceptor());
PlasmaQuick::PackageUrlInterceptor *interceptor = dynamic_cast<PlasmaQuick::PackageUrlInterceptor *>(qmlObject()->engine()->urlInterceptor());
if (interceptor) {
interceptor->addAllowedPath(pkg.path());
}

View File

@ -68,10 +68,10 @@ void ContainmentConfigView::init()
setSource(QUrl::fromLocalFile(m_containment->corona()->package().filePath("containmentconfigurationui")));
}
ConfigModel *ContainmentConfigView::containmentActionConfigModel()
PlasmaQuick::ConfigModel *ContainmentConfigView::containmentActionConfigModel()
{
if (!m_containmentActionConfigModel) {
m_containmentActionConfigModel = new ConfigModel(this);
m_containmentActionConfigModel = new PlasmaQuick::ConfigModel(this);
KPluginInfo::List actions = Plasma::PluginLoader::self()->listContainmentActionsInfo(QString());
@ -94,10 +94,10 @@ QAbstractItemModel *ContainmentConfigView::currentContainmentActionsModel()
return m_currentContainmentActionsModel;
}
ConfigModel *ContainmentConfigView::wallpaperConfigModel()
PlasmaQuick::ConfigModel *ContainmentConfigView::wallpaperConfigModel()
{
if (!m_wallpaperConfigModel) {
m_wallpaperConfigModel = new ConfigModel(this);
m_wallpaperConfigModel = new PlasmaQuick::ConfigModel(this);
QStringList dirs(QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "plasma/wallpapers", QStandardPaths::LocateDirectory));
Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic");
foreach (const QString &dirPath, dirs) {

View File

@ -36,12 +36,12 @@ namespace KDeclarative {
}
//TODO: out of the library?
class ContainmentConfigView : public ConfigView
class ContainmentConfigView : public PlasmaQuick::ConfigView
{
Q_OBJECT
Q_PROPERTY(ConfigModel *containmentActionConfigModel READ containmentActionConfigModel CONSTANT)
Q_PROPERTY(PlasmaQuick::ConfigModel *containmentActionConfigModel READ containmentActionConfigModel CONSTANT)
Q_PROPERTY(QAbstractItemModel *currentContainmentActionsModel READ currentContainmentActionsModel CONSTANT)
Q_PROPERTY(ConfigModel *wallpaperConfigModel READ wallpaperConfigModel CONSTANT)
Q_PROPERTY(PlasmaQuick::ConfigModel *wallpaperConfigModel READ wallpaperConfigModel CONSTANT)
Q_PROPERTY(KDeclarative::ConfigPropertyMap *wallpaperConfiguration READ wallpaperConfiguration NOTIFY wallpaperConfigurationChanged)
Q_PROPERTY(QString currentWallpaper READ currentWallpaper WRITE setCurrentWallpaper NOTIFY currentWallpaperChanged)
@ -51,9 +51,9 @@ public:
virtual void init();
ConfigModel *containmentActionConfigModel();
PlasmaQuick::ConfigModel *containmentActionConfigModel();
QAbstractItemModel *currentContainmentActionsModel();
ConfigModel *wallpaperConfigModel();
PlasmaQuick::ConfigModel *wallpaperConfigModel();
QString currentWallpaper() const;
void setCurrentWallpaper(const QString &wallpaper);
KDeclarative::ConfigPropertyMap *wallpaperConfiguration() const;
@ -69,8 +69,8 @@ protected:
private:
Plasma::Containment *m_containment;
ConfigModel *m_wallpaperConfigModel;
ConfigModel *m_containmentActionConfigModel;
PlasmaQuick::ConfigModel *m_wallpaperConfigModel;
PlasmaQuick::ConfigModel *m_containmentActionConfigModel;
CurrentContainmentActionsModel *m_currentContainmentActionsModel;
QString m_currentWallpaper;
KDeclarative::ConfigPropertyMap *m_currentWallpaperConfig;

View File

@ -30,7 +30,7 @@
#include <Plasma/Package>
DesktopView::DesktopView(ShellCorona *corona, QScreen *screen)
: PlasmaQuickView(corona, 0),
: PlasmaQuick::View(corona, 0),
m_stayBehind(false),
m_fillScreen(false)
{
@ -135,7 +135,7 @@ void DesktopView::showConfigurationInterface(Plasma::Applet *applet)
if (cont) {
m_configView = new ContainmentConfigView(cont);
} else {
m_configView = new ConfigView(applet);
m_configView = new PlasmaQuick::ConfigView(applet);
}
m_configView.data()->init();
m_configView.data()->show();

View File

@ -20,13 +20,13 @@
#define DESKTOVIEW_H
#include <plasmaquickview.h>
#include <view.h>
#include "panelconfigview.h"
#include <QtCore/qpointer.h>
class ShellCorona;
class DesktopView : public PlasmaQuickView
class DesktopView : public PlasmaQuick::View
{
Q_OBJECT
Q_PROPERTY(bool stayBehind READ stayBehind WRITE setStayBehind NOTIFY stayBehindChanged)
@ -55,7 +55,7 @@ Q_SIGNALS:
void fillScreenChanged();
private:
QPointer<ConfigView> m_configView;
QPointer<PlasmaQuick::ConfigView> m_configView;
bool m_stayBehind : 1;
bool m_fillScreen : 1;
};

View File

@ -37,7 +37,7 @@ namespace Plasma {
class Containment;
}
class PanelConfigView : public ConfigView
class PanelConfigView : public PlasmaQuick::ConfigView
{
Q_OBJECT

View File

@ -37,7 +37,7 @@
#include <Plasma/Package>
PanelView::PanelView(ShellCorona *corona, QWindow *parent)
: PlasmaQuickView(corona, parent),
: PlasmaQuick::View(corona, parent),
m_offset(0),
m_maxLength(0),
m_minLength(0),
@ -72,13 +72,13 @@ PanelView::PanelView(ShellCorona *corona, QWindow *parent)
this, &PanelView::positionPanel);
connect(screen(), &QScreen::geometryChanged,
this, &PanelView::positionPanel);
connect(this, &PlasmaQuickView::locationChanged,
connect(this, &PlasmaQuick::View::locationChanged,
&m_positionPaneltimer, [=] () {
m_positionPaneltimer.start();
});
connect(this, &PlasmaQuickView::containmentChanged,
connect(this, &PlasmaQuick::View::containmentChanged,
this, &PanelView::positionPanel);
connect(this, &PlasmaQuickView::containmentChanged,
connect(this, &PlasmaQuick::View::containmentChanged,
this, [=] () {
m_positionPaneltimer.start();
});
@ -95,7 +95,7 @@ PanelView::PanelView(ShellCorona *corona, QWindow *parent)
connect(QApplication::desktop(), &QDesktopWidget::screenCountChanged,
this, &PanelView::updateStruts);
setResizeMode(PlasmaQuickView::SizeRootObjectToView);
setResizeMode(PlasmaQuick::View::SizeRootObjectToView);
qmlRegisterType<QScreen>();
engine()->rootContext()->setContextProperty("panel", this);
setSource(QUrl::fromLocalFile(m_corona->package().filePath("views", "Panel.qml")));
@ -497,7 +497,7 @@ void PanelView::showConfigurationInterface(Plasma::Applet *applet)
if (cont) {
m_panelConfigView = new PanelConfigView(cont, this);
} else {
m_panelConfigView = new ConfigView(applet);
m_panelConfigView = new PlasmaQuick::ConfigView(applet);
}
m_panelConfigView.data()->init();
m_panelConfigView.data()->show();
@ -528,13 +528,13 @@ void PanelView::resizeEvent(QResizeEvent *ev)
}
m_positionPaneltimer.start();
PlasmaQuickView::resizeEvent(ev);
PlasmaQuick::View::resizeEvent(ev);
}
void PanelView::showEvent(QShowEvent *event)
{
PanelShadows::self()->addWindow(this);
PlasmaQuickView::showEvent(event);
PlasmaQuick::View::showEvent(event);
KWindowSystem::setOnAllDesktops(winId(), true);
}

View File

@ -20,7 +20,7 @@
#define PANELVIEW_H
#include <plasmaquickview.h>
#include <view.h>
#include "panelconfigview.h"
#include <QtCore/qpointer.h>
#include <Plasma/Theme>
@ -28,7 +28,7 @@
class ShellCorona;
class PanelView : public PlasmaQuickView
class PanelView : public PlasmaQuick::View
{
Q_OBJECT
Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged)
@ -110,7 +110,7 @@ private:
int m_maxLength;
int m_minLength;
Qt::Alignment m_alignment;
QPointer<ConfigView> m_panelConfigView;
QPointer<PlasmaQuick::ConfigView> m_panelConfigView;
ShellCorona *m_corona;
QTimer *m_strutsTimer;
VisibilityMode m_visibilityMode;

View File

@ -36,7 +36,7 @@
#include <Plasma/PackageStructure>
#include <qstandardpaths.h>
#include "plasmaquickview.h"
#include <view.h>
#include "kcategorizeditemsviewmodels_p.h"
#include "plasmaappletitemmodel_p.h"