Merge branch 'mart/plasmaquickNamespace'
This commit is contained in:
commit
a7c6d3a79e
@ -2,7 +2,7 @@ project(PlasmaQuick)
|
||||
|
||||
set(plasmaquick_LIB_SRC
|
||||
appletquickitem.cpp
|
||||
plasmaquickview.cpp
|
||||
view.cpp
|
||||
configmodel.cpp
|
||||
configview.cpp
|
||||
packageurlinterceptor.cpp
|
||||
@ -38,18 +38,18 @@ 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
|
||||
)
|
||||
|
||||
install(FILES ${plasmaquick_LIB_INCLUDES}
|
||||
DESTINATION ${INCLUDE_INSTALL_DIR}/plasmaquick COMPONENT Devel)
|
||||
#install(FILES ${plasmaquick_LIB_INCLUDES}
|
||||
# DESTINATION ${INCLUDE_INSTALL_DIR}/plasmaquick COMPONENT Devel)
|
||||
|
||||
install(DIRECTORY
|
||||
includes/PlasmaQuick
|
||||
DESTINATION ${INCLUDE_INSTALL_DIR}/KDE COMPONENT Devel)
|
||||
#install(DIRECTORY
|
||||
# includes/PlasmaQuick
|
||||
# DESTINATION ${INCLUDE_INSTALL_DIR}/KDE COMPONENT Devel)
|
||||
|
||||
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5PlasmaQuick")
|
||||
|
||||
|
@ -38,6 +38,9 @@
|
||||
|
||||
#include <packageurlinterceptor.h>
|
||||
|
||||
namespace PlasmaQuick
|
||||
{
|
||||
|
||||
QHash<QObject *, AppletQuickItem *> AppletQuickItemPrivate::s_rootObjects = QHash<QObject *, AppletQuickItem *>();
|
||||
|
||||
AppletQuickItemPrivate::AppletQuickItemPrivate(Plasma::Applet *a, AppletQuickItem *item)
|
||||
@ -660,7 +663,7 @@ void AppletQuickItem::itemChange(ItemChange change, const ItemChangeData &value)
|
||||
QQuickItem::itemChange(change, value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#include "moc_appletquickitem.cpp"
|
||||
|
||||
|
@ -30,6 +30,17 @@
|
||||
|
||||
#include <plasmaquick/plasmaquick_export.h>
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the public Plasma API. It exists purely as an
|
||||
// implementation detail. This header file may change from version to
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
namespace Plasma {
|
||||
class Applet;
|
||||
}
|
||||
@ -39,6 +50,8 @@ namespace KDeclarative {
|
||||
}
|
||||
|
||||
|
||||
namespace PlasmaQuick {
|
||||
|
||||
class AppletQuickItemPrivate;
|
||||
|
||||
class PLASMAQUICK_EXPORT AppletQuickItem : public QQuickItem
|
||||
@ -146,6 +159,9 @@ private:
|
||||
Q_PRIVATE_SLOT(d, void fillHeightChanged())
|
||||
};
|
||||
|
||||
QML_DECLARE_TYPEINFO(AppletQuickItem, QML_HAS_ATTACHED_PROPERTIES)
|
||||
}
|
||||
|
||||
QML_DECLARE_TYPEINFO(PlasmaQuick::AppletQuickItem, QML_HAS_ATTACHED_PROPERTIES)
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include <Plasma/Corona>
|
||||
#include <Plasma/PluginLoader>
|
||||
|
||||
namespace PlasmaQuick {
|
||||
|
||||
//////////////////////////////ConfigModel
|
||||
|
||||
@ -242,5 +243,6 @@ QQmlListProperty<ConfigCategory> ConfigModel::categories()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_configmodel.cpp"
|
||||
|
@ -26,10 +26,24 @@
|
||||
|
||||
#include <plasmaquick/plasmaquick_export.h>
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the public Plasma API. It exists purely as an
|
||||
// implementation detail. This header file may change from version to
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
namespace Plasma {
|
||||
class Applet;
|
||||
}
|
||||
|
||||
namespace PlasmaQuick
|
||||
{
|
||||
|
||||
class ConfigPropertyMap;
|
||||
|
||||
class ConfigCategoryPrivate;
|
||||
@ -100,4 +114,6 @@ private:
|
||||
ConfigModelPrivate *const d;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // multiple inclusion guard
|
||||
|
@ -39,6 +39,8 @@
|
||||
#include <Plasma/PluginLoader>
|
||||
|
||||
|
||||
namespace PlasmaQuick
|
||||
{
|
||||
|
||||
//////////////////////////////ConfigView
|
||||
|
||||
@ -156,4 +158,6 @@ void ConfigView::resizeEvent(QResizeEvent *re)
|
||||
QQuickWindow::resizeEvent(re);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_configview.cpp"
|
||||
|
@ -25,10 +25,24 @@
|
||||
|
||||
#include <plasmaquick/plasmaquick_export.h>
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the public Plasma API. It exists purely as an
|
||||
// implementation detail. This header file may change from version to
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
namespace Plasma {
|
||||
class Applet;
|
||||
}
|
||||
|
||||
namespace PlasmaQuick
|
||||
{
|
||||
|
||||
class ConfigViewPrivate;
|
||||
|
||||
class ConfigModel;
|
||||
@ -68,4 +82,6 @@ private:
|
||||
ConfigViewPrivate *const d;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // multiple inclusion guard
|
||||
|
@ -25,6 +25,9 @@
|
||||
|
||||
#include <kdeclarative/kdeclarative.h>
|
||||
|
||||
namespace PlasmaQuick
|
||||
{
|
||||
|
||||
PackageUrlInterceptor::PackageUrlInterceptor(QQmlEngine *engine, const Plasma::Package &p)
|
||||
: QQmlAbstractUrlInterceptor(),
|
||||
m_package(p),
|
||||
@ -138,6 +141,6 @@ QUrl PackageUrlInterceptor::intercept(const QUrl &path, QQmlAbstractUrlIntercept
|
||||
return QUrl();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -26,8 +26,22 @@
|
||||
|
||||
#include <Plasma/Package>
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the public Plasma API. It exists purely as an
|
||||
// implementation detail. This header file may change from version to
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
class QQmlEngine;
|
||||
|
||||
namespace PlasmaQuick
|
||||
{
|
||||
|
||||
//depends from https://codereview.qt-project.org/#change,65626
|
||||
class PLASMAQUICK_EXPORT PackageUrlInterceptor: public QQmlAbstractUrlInterceptor
|
||||
{
|
||||
@ -76,5 +90,6 @@ private:
|
||||
QQmlEngine *m_engine;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -22,6 +22,17 @@
|
||||
|
||||
#include <QQmlComponent>
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the public Plasma API. It exists purely as an
|
||||
// implementation detail. This header file may change from version to
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
namespace Plasma {
|
||||
class Applet;
|
||||
}
|
||||
@ -30,6 +41,8 @@ namespace KDeclarative {
|
||||
class QmlObject;
|
||||
}
|
||||
|
||||
namespace PlasmaQuick {
|
||||
|
||||
class AppletQuickItem;
|
||||
|
||||
class AppletQuickItemPrivate
|
||||
@ -90,4 +103,6 @@ public:
|
||||
static QHash<QObject *, AppletQuickItem *> s_rootObjects;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -38,6 +38,8 @@
|
||||
#include <Plasma/Corona>
|
||||
#include <Plasma/PluginLoader>
|
||||
|
||||
namespace PlasmaQuick {
|
||||
|
||||
///////////////////////ConfigCategory
|
||||
|
||||
ConfigCategory::ConfigCategory(QObject *parent)
|
||||
@ -110,5 +112,6 @@ void ConfigCategory::setPluginName(const QString &name)
|
||||
emit pluginNameChanged();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "private/moc_configcategory_p.cpp"
|
||||
|
@ -22,6 +22,19 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the public Plasma API. It exists purely as an
|
||||
// implementation detail. This header file may change from version to
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
namespace PlasmaQuick {
|
||||
|
||||
//This class represents a single row item of the ConfigModel model in a QML friendly manner.
|
||||
//the properties contains all the data needed to represent an icon in the sidebar of a configuration dialog, of applets or containments
|
||||
class ConfigCategory : public QObject
|
||||
@ -61,4 +74,6 @@ private:
|
||||
QString m_pluginName;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // multiple inclusion guard
|
||||
|
@ -16,7 +16,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "plasmaquickview.h"
|
||||
#include "view.h"
|
||||
#include "configview.h"
|
||||
|
||||
#include <QDebug>
|
||||
@ -27,36 +27,39 @@
|
||||
|
||||
#include "plasma/pluginloader.h"
|
||||
|
||||
class PlasmaQuickViewPrivate
|
||||
namespace PlasmaQuick
|
||||
{
|
||||
|
||||
class ViewPrivate
|
||||
{
|
||||
public:
|
||||
|
||||
PlasmaQuickViewPrivate(Plasma::Corona *corona, PlasmaQuickView *view);
|
||||
~PlasmaQuickViewPrivate();
|
||||
ViewPrivate(Plasma::Corona *corona, View *view);
|
||||
~ViewPrivate();
|
||||
|
||||
void setContainment(Plasma::Containment *cont);
|
||||
Plasma::Types::FormFactor formFactor() const;
|
||||
Plasma::Types::Location location() const;
|
||||
void showConfigurationInterface(Plasma::Applet *applet);
|
||||
|
||||
PlasmaQuickView *q;
|
||||
friend class PlasmaQuickView;
|
||||
View *q;
|
||||
friend class View;
|
||||
Plasma::Corona *corona;
|
||||
QWeakPointer<Plasma::Containment> containment;
|
||||
QWeakPointer<ConfigView> configView;
|
||||
};
|
||||
|
||||
PlasmaQuickViewPrivate::PlasmaQuickViewPrivate(Plasma::Corona *cor, PlasmaQuickView *view)
|
||||
ViewPrivate::ViewPrivate(Plasma::Corona *cor, View *view)
|
||||
: q(view),
|
||||
corona(cor)
|
||||
{
|
||||
}
|
||||
|
||||
PlasmaQuickViewPrivate::~PlasmaQuickViewPrivate()
|
||||
ViewPrivate::~ViewPrivate()
|
||||
{
|
||||
}
|
||||
|
||||
void PlasmaQuickViewPrivate::setContainment(Plasma::Containment *cont)
|
||||
void ViewPrivate::setContainment(Plasma::Containment *cont)
|
||||
{
|
||||
if (containment.data() == cont) {
|
||||
return;
|
||||
@ -91,11 +94,11 @@ void PlasmaQuickViewPrivate::setContainment(Plasma::Containment *cont)
|
||||
if (cont) {
|
||||
cont->reactToScreenChange();
|
||||
QObject::connect(cont, &Plasma::Containment::locationChanged,
|
||||
q, &PlasmaQuickView::locationChanged);
|
||||
q, &View::locationChanged);
|
||||
QObject::connect(cont, &Plasma::Containment::formFactorChanged,
|
||||
q, &PlasmaQuickView::formFactorChanged);
|
||||
q, &View::formFactorChanged);
|
||||
QObject::connect(cont, &Plasma::Containment::configureRequested,
|
||||
q, &PlasmaQuickView::showConfigurationInterface);
|
||||
q, &View::showConfigurationInterface);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
@ -120,7 +123,7 @@ void PlasmaQuickViewPrivate::setContainment(Plasma::Containment *cont)
|
||||
}
|
||||
}
|
||||
|
||||
Plasma::Types::Location PlasmaQuickViewPrivate::location() const
|
||||
Plasma::Types::Location ViewPrivate::location() const
|
||||
{
|
||||
if (!containment) {
|
||||
return Plasma::Types::Desktop;
|
||||
@ -128,7 +131,7 @@ Plasma::Types::Location PlasmaQuickViewPrivate::location() const
|
||||
return containment.data()->location();
|
||||
}
|
||||
|
||||
Plasma::Types::FormFactor PlasmaQuickViewPrivate::formFactor() const
|
||||
Plasma::Types::FormFactor ViewPrivate::formFactor() const
|
||||
{
|
||||
if (!containment) {
|
||||
return Plasma::Types::Planar;
|
||||
@ -136,7 +139,7 @@ Plasma::Types::FormFactor PlasmaQuickViewPrivate::formFactor() const
|
||||
return containment.data()->formFactor();
|
||||
}
|
||||
|
||||
void PlasmaQuickViewPrivate::showConfigurationInterface(Plasma::Applet *applet)
|
||||
void ViewPrivate::showConfigurationInterface(Plasma::Applet *applet)
|
||||
{
|
||||
if (configView) {
|
||||
configView.data()->hide();
|
||||
@ -156,9 +159,9 @@ void PlasmaQuickViewPrivate::showConfigurationInterface(Plasma::Applet *applet)
|
||||
|
||||
|
||||
|
||||
PlasmaQuickView::PlasmaQuickView(Plasma::Corona *corona, QWindow *parent)
|
||||
View::View(Plasma::Corona *corona, QWindow *parent)
|
||||
: QQuickView(parent),
|
||||
d(new PlasmaQuickViewPrivate(corona, this))
|
||||
d(new ViewPrivate(corona, this))
|
||||
{
|
||||
QSurfaceFormat format;
|
||||
format.setAlphaBufferSize(8);
|
||||
@ -168,29 +171,29 @@ PlasmaQuickView::PlasmaQuickView(Plasma::Corona *corona, QWindow *parent)
|
||||
|
||||
|
||||
QObject::connect(screen(), &QScreen::geometryChanged,
|
||||
this, &PlasmaQuickView::screenGeometryChanged);
|
||||
this, &View::screenGeometryChanged);
|
||||
|
||||
if (!corona->package().isValid()) {
|
||||
qWarning() << "Invalid home screen package";
|
||||
}
|
||||
|
||||
setResizeMode(PlasmaQuickView::SizeRootObjectToView);
|
||||
setResizeMode(View::SizeRootObjectToView);
|
||||
|
||||
QObject::connect(corona, &Plasma::Corona::packageChanged,
|
||||
this, &PlasmaQuickView::coronaPackageChanged);
|
||||
this, &View::coronaPackageChanged);
|
||||
}
|
||||
|
||||
PlasmaQuickView::~PlasmaQuickView()
|
||||
View::~View()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
Plasma::Corona *PlasmaQuickView::corona() const
|
||||
Plasma::Corona *View::corona() const
|
||||
{
|
||||
return d->corona;
|
||||
}
|
||||
|
||||
KConfigGroup PlasmaQuickView::config() const
|
||||
KConfigGroup View::config() const
|
||||
{
|
||||
if (!containment()) {
|
||||
return KConfigGroup();
|
||||
@ -199,45 +202,47 @@ KConfigGroup PlasmaQuickView::config() const
|
||||
return KConfigGroup(&views, QString::number(containment()->screen()));
|
||||
}
|
||||
|
||||
void PlasmaQuickView::setContainment(Plasma::Containment *cont)
|
||||
void View::setContainment(Plasma::Containment *cont)
|
||||
{
|
||||
d->setContainment(cont);
|
||||
}
|
||||
|
||||
Plasma::Containment *PlasmaQuickView::containment() const
|
||||
Plasma::Containment *View::containment() const
|
||||
{
|
||||
return d->containment.data();
|
||||
}
|
||||
|
||||
void PlasmaQuickView::setLocation(Plasma::Types::Location location)
|
||||
void View::setLocation(Plasma::Types::Location location)
|
||||
{
|
||||
d->containment.data()->setLocation(location);
|
||||
}
|
||||
|
||||
Plasma::Types::Location PlasmaQuickView::location() const
|
||||
Plasma::Types::Location View::location() const
|
||||
{
|
||||
return d->location();
|
||||
}
|
||||
|
||||
Plasma::Types::FormFactor PlasmaQuickView::formFactor() const
|
||||
Plasma::Types::FormFactor View::formFactor() const
|
||||
{
|
||||
return d->formFactor();
|
||||
}
|
||||
|
||||
QRectF PlasmaQuickView::screenGeometry()
|
||||
QRectF View::screenGeometry()
|
||||
{
|
||||
return screen()->geometry();
|
||||
}
|
||||
|
||||
void PlasmaQuickView::showConfigurationInterface(Plasma::Applet *applet)
|
||||
void View::showConfigurationInterface(Plasma::Applet *applet)
|
||||
{
|
||||
d->showConfigurationInterface(applet);
|
||||
}
|
||||
|
||||
void PlasmaQuickView::coronaPackageChanged(const Plasma::Package &package)
|
||||
void View::coronaPackageChanged(const Plasma::Package &package)
|
||||
{
|
||||
setContainment(0);
|
||||
setSource(QUrl::fromLocalFile(package.filePath("views", "Desktop.qml")));
|
||||
}
|
||||
|
||||
#include "moc_plasmaquickview.cpp"
|
||||
}
|
||||
|
||||
#include "moc_view.cpp"
|
@ -25,9 +25,23 @@
|
||||
#include "plasma/corona.h"
|
||||
#include "plasma/containment.h"
|
||||
|
||||
class PlasmaQuickViewPrivate;
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the public Plasma API. It exists purely as an
|
||||
// implementation detail. This header file may change from version to
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
class PLASMAQUICK_EXPORT PlasmaQuickView : public QQuickView
|
||||
namespace PlasmaQuick
|
||||
{
|
||||
|
||||
class ViewPrivate;
|
||||
|
||||
class PLASMAQUICK_EXPORT View : public QQuickView
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(Plasma::Types::Location location READ location WRITE setLocation NOTIFY locationChanged)
|
||||
@ -39,8 +53,8 @@ public:
|
||||
* @param corona the corona of this view
|
||||
* @param parent the QWindow this View is parented to
|
||||
**/
|
||||
explicit PlasmaQuickView(Plasma::Corona *corona, QWindow *parent = 0);
|
||||
virtual ~PlasmaQuickView();
|
||||
explicit View(Plasma::Corona *corona, QWindow *parent = 0);
|
||||
virtual ~View();
|
||||
|
||||
/**
|
||||
* @return the corona of this view
|
||||
@ -115,8 +129,10 @@ Q_SIGNALS:
|
||||
void screenGeometryChanged();
|
||||
|
||||
private:
|
||||
PlasmaQuickViewPrivate *const d;
|
||||
friend class PlasmaQuickViewPrivate;
|
||||
ViewPrivate *const d;
|
||||
friend class ViewPrivate;
|
||||
};
|
||||
|
||||
#endif // PLASMAQUICKVIEW_H
|
||||
}
|
||||
|
||||
#endif // View_H
|
@ -49,7 +49,7 @@ namespace Plasma
|
||||
class ConfigLoader;
|
||||
} // namespace Plasma
|
||||
|
||||
class AppletInterface : public AppletQuickItem
|
||||
class AppletInterface : public PlasmaQuick::AppletQuickItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -37,7 +37,7 @@ namespace Plasma {
|
||||
class Containment;
|
||||
}
|
||||
|
||||
class PanelConfigView : public ConfigView
|
||||
class PanelConfigView : public PlasmaQuick::ConfigView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include <Plasma/PackageStructure>
|
||||
#include <qstandardpaths.h>
|
||||
|
||||
#include "plasmaquickview.h"
|
||||
#include <view.h>
|
||||
#include "kcategorizeditemsviewmodels_p.h"
|
||||
#include "plasmaappletitemmodel_p.h"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user