From 5bb4761c739bf8fd33e778a184d747fe4079cab3 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 19 Feb 2014 19:37:30 +0100 Subject: [PATCH 1/5] use a namespace in libplasmaquick right now only the library builds --- src/plasmaquick/appletquickitem.cpp | 5 +- src/plasmaquick/appletquickitem.h | 7 ++- src/plasmaquick/configmodel.cpp | 2 + src/plasmaquick/configmodel.h | 5 ++ src/plasmaquick/configview.cpp | 4 ++ src/plasmaquick/configview.h | 5 ++ src/plasmaquick/packageurlinterceptor.cpp | 5 +- src/plasmaquick/packageurlinterceptor.h | 4 ++ src/plasmaquick/plasmaquickview.cpp | 65 +++++++++++--------- src/plasmaquick/plasmaquickview.h | 20 +++--- src/plasmaquick/private/appletquickitem_p.h | 4 ++ src/plasmaquick/private/configcategory_p.cpp | 3 + src/plasmaquick/private/configcategory_p.h | 4 ++ 13 files changed, 93 insertions(+), 40 deletions(-) diff --git a/src/plasmaquick/appletquickitem.cpp b/src/plasmaquick/appletquickitem.cpp index 7966fcaca..a0dbf5ed2 100644 --- a/src/plasmaquick/appletquickitem.cpp +++ b/src/plasmaquick/appletquickitem.cpp @@ -38,6 +38,9 @@ #include +namespace PlasmaQuick +{ + QHash AppletQuickItemPrivate::s_rootObjects = QHash(); 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" diff --git a/src/plasmaquick/appletquickitem.h b/src/plasmaquick/appletquickitem.h index 28bdab877..d0a1acaef 100644 --- a/src/plasmaquick/appletquickitem.h +++ b/src/plasmaquick/appletquickitem.h @@ -39,6 +39,8 @@ namespace KDeclarative { } +namespace PlasmaQuick { + class AppletQuickItemPrivate; class PLASMAQUICK_EXPORT AppletQuickItem : public QQuickItem @@ -146,6 +148,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 diff --git a/src/plasmaquick/configmodel.cpp b/src/plasmaquick/configmodel.cpp index f495556fd..26a8fba29 100644 --- a/src/plasmaquick/configmodel.cpp +++ b/src/plasmaquick/configmodel.cpp @@ -38,6 +38,7 @@ #include #include +namespace PlasmaQuick { //////////////////////////////ConfigModel @@ -242,5 +243,6 @@ QQmlListProperty ConfigModel::categories() } +} #include "moc_configmodel.cpp" diff --git a/src/plasmaquick/configmodel.h b/src/plasmaquick/configmodel.h index c158c16de..e6b43704c 100644 --- a/src/plasmaquick/configmodel.h +++ b/src/plasmaquick/configmodel.h @@ -30,6 +30,9 @@ namespace Plasma { class Applet; } +namespace PlasmaQuick +{ + class ConfigPropertyMap; class ConfigCategoryPrivate; @@ -100,4 +103,6 @@ private: ConfigModelPrivate *const d; }; +} + #endif // multiple inclusion guard diff --git a/src/plasmaquick/configview.cpp b/src/plasmaquick/configview.cpp index 887a4d293..7d3efccba 100644 --- a/src/plasmaquick/configview.cpp +++ b/src/plasmaquick/configview.cpp @@ -39,6 +39,8 @@ #include +namespace PlasmaQuick +{ //////////////////////////////ConfigView @@ -156,4 +158,6 @@ void ConfigView::resizeEvent(QResizeEvent *re) QQuickWindow::resizeEvent(re); } +} + #include "moc_configview.cpp" diff --git a/src/plasmaquick/configview.h b/src/plasmaquick/configview.h index 307278752..c6b4d13ab 100644 --- a/src/plasmaquick/configview.h +++ b/src/plasmaquick/configview.h @@ -29,6 +29,9 @@ namespace Plasma { class Applet; } +namespace PlasmaQuick +{ + class ConfigViewPrivate; class ConfigModel; @@ -68,4 +71,6 @@ private: ConfigViewPrivate *const d; }; +} + #endif // multiple inclusion guard diff --git a/src/plasmaquick/packageurlinterceptor.cpp b/src/plasmaquick/packageurlinterceptor.cpp index 71699d7eb..71e7d6837 100644 --- a/src/plasmaquick/packageurlinterceptor.cpp +++ b/src/plasmaquick/packageurlinterceptor.cpp @@ -25,6 +25,9 @@ #include +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(); } - +} diff --git a/src/plasmaquick/packageurlinterceptor.h b/src/plasmaquick/packageurlinterceptor.h index c722a4db3..b2c01edf5 100644 --- a/src/plasmaquick/packageurlinterceptor.h +++ b/src/plasmaquick/packageurlinterceptor.h @@ -28,6 +28,9 @@ class QQmlEngine; +namespace PlasmaQuick +{ + //depends from https://codereview.qt-project.org/#change,65626 class PLASMAQUICK_EXPORT PackageUrlInterceptor: public QQmlAbstractUrlInterceptor { @@ -76,5 +79,6 @@ private: QQmlEngine *m_engine; }; +} #endif diff --git a/src/plasmaquick/plasmaquickview.cpp b/src/plasmaquick/plasmaquickview.cpp index a7c480a49..550b1fe32 100644 --- a/src/plasmaquick/plasmaquickview.cpp +++ b/src/plasmaquick/plasmaquickview.cpp @@ -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 containment; QWeakPointer 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" diff --git a/src/plasmaquick/plasmaquickview.h b/src/plasmaquick/plasmaquickview.h index cc92ab22d..a853a0f77 100644 --- a/src/plasmaquick/plasmaquickview.h +++ b/src/plasmaquick/plasmaquickview.h @@ -25,9 +25,13 @@ #include "plasma/corona.h" #include "plasma/containment.h" -class PlasmaQuickViewPrivate; -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 +43,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 +119,10 @@ Q_SIGNALS: void screenGeometryChanged(); private: - PlasmaQuickViewPrivate *const d; - friend class PlasmaQuickViewPrivate; + ViewPrivate *const d; + friend class ViewPrivate; }; -#endif // PLASMAQUICKVIEW_H +} + +#endif // View_H diff --git a/src/plasmaquick/private/appletquickitem_p.h b/src/plasmaquick/private/appletquickitem_p.h index 7e111136e..8e0b3f7a1 100644 --- a/src/plasmaquick/private/appletquickitem_p.h +++ b/src/plasmaquick/private/appletquickitem_p.h @@ -30,6 +30,8 @@ namespace KDeclarative { class QmlObject; } +namespace PlasmaQuick { + class AppletQuickItem; class AppletQuickItemPrivate @@ -90,4 +92,6 @@ public: static QHash s_rootObjects; }; +} + #endif diff --git a/src/plasmaquick/private/configcategory_p.cpp b/src/plasmaquick/private/configcategory_p.cpp index 5183d3793..08e48c138 100644 --- a/src/plasmaquick/private/configcategory_p.cpp +++ b/src/plasmaquick/private/configcategory_p.cpp @@ -38,6 +38,8 @@ #include #include +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" diff --git a/src/plasmaquick/private/configcategory_p.h b/src/plasmaquick/private/configcategory_p.h index 3ea208a7a..d1103c57d 100644 --- a/src/plasmaquick/private/configcategory_p.h +++ b/src/plasmaquick/private/configcategory_p.h @@ -22,6 +22,8 @@ #include +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 +63,6 @@ private: QString m_pluginName; }; +} + #endif // multiple inclusion guard From d3253428dcd34c2cf348c1f9ce37c0f042b6c0ec Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 19 Feb 2014 19:40:40 +0100 Subject: [PATCH 2/5] plasmaquickview.h -> view.h --- src/plasmaquick/CMakeLists.txt | 2 +- src/plasmaquick/{plasmaquickview.cpp => view.cpp} | 4 ++-- src/plasmaquick/{plasmaquickview.h => view.h} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename src/plasmaquick/{plasmaquickview.cpp => view.cpp} (99%) rename src/plasmaquick/{plasmaquickview.h => view.h} (100%) diff --git a/src/plasmaquick/CMakeLists.txt b/src/plasmaquick/CMakeLists.txt index 7e31b315b..5ee8fcf5a 100644 --- a/src/plasmaquick/CMakeLists.txt +++ b/src/plasmaquick/CMakeLists.txt @@ -2,7 +2,7 @@ project(PlasmaQuick) set(plasmaquick_LIB_SRC appletquickitem.cpp - plasmaquickview.cpp + view.cpp configmodel.cpp configview.cpp packageurlinterceptor.cpp diff --git a/src/plasmaquick/plasmaquickview.cpp b/src/plasmaquick/view.cpp similarity index 99% rename from src/plasmaquick/plasmaquickview.cpp rename to src/plasmaquick/view.cpp index 550b1fe32..9932cae9f 100644 --- a/src/plasmaquick/plasmaquickview.cpp +++ b/src/plasmaquick/view.cpp @@ -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 @@ -245,4 +245,4 @@ void View::coronaPackageChanged(const Plasma::Package &package) } -#include "moc_plasmaquickview.cpp" +#include "moc_view.cpp" diff --git a/src/plasmaquick/plasmaquickview.h b/src/plasmaquick/view.h similarity index 100% rename from src/plasmaquick/plasmaquickview.h rename to src/plasmaquick/view.h From 90c608f863a68f4ad2926de99fbc3ab6ab676a0c Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 19 Feb 2014 20:00:29 +0100 Subject: [PATCH 3/5] complete porting --- src/plasmaquick/CMakeLists.txt | 2 +- src/scriptengines/qml/plasmoid/appletinterface.h | 2 +- .../qml/plasmoid/containmentinterface.cpp | 2 +- src/shell/containmentconfigview.cpp | 8 ++++---- src/shell/containmentconfigview.h | 14 +++++++------- src/shell/desktopview.cpp | 4 ++-- src/shell/desktopview.h | 6 +++--- src/shell/panelconfigview.h | 2 +- src/shell/panelview.cpp | 16 ++++++++-------- src/shell/panelview.h | 6 +++--- src/shell/widgetexplorer/widgetexplorer.cpp | 2 +- 11 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/plasmaquick/CMakeLists.txt b/src/plasmaquick/CMakeLists.txt index 5ee8fcf5a..36a89f812 100644 --- a/src/plasmaquick/CMakeLists.txt +++ b/src/plasmaquick/CMakeLists.txt @@ -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 diff --git a/src/scriptengines/qml/plasmoid/appletinterface.h b/src/scriptengines/qml/plasmoid/appletinterface.h index b4b9b0f47..d91946c6d 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.h +++ b/src/scriptengines/qml/plasmoid/appletinterface.h @@ -49,7 +49,7 @@ namespace Plasma class ConfigLoader; } // namespace Plasma -class AppletInterface : public AppletQuickItem +class AppletInterface : public PlasmaQuick::AppletQuickItem { Q_OBJECT diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index c22594cf7..de9cdefee 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -115,7 +115,7 @@ void ContainmentInterface::init() pkg.setPath("org.kde.desktoptoolbox"); } - PackageUrlInterceptor *interceptor = dynamic_cast(qmlObject()->engine()->urlInterceptor()); + PlasmaQuick::PackageUrlInterceptor *interceptor = dynamic_cast(qmlObject()->engine()->urlInterceptor()); if (interceptor) { interceptor->addAllowedPath(pkg.path()); } diff --git a/src/shell/containmentconfigview.cpp b/src/shell/containmentconfigview.cpp index 287afcaf6..041ff5490 100644 --- a/src/shell/containmentconfigview.cpp +++ b/src/shell/containmentconfigview.cpp @@ -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) { diff --git a/src/shell/containmentconfigview.h b/src/shell/containmentconfigview.h index f20323303..d4941763e 100644 --- a/src/shell/containmentconfigview.h +++ b/src/shell/containmentconfigview.h @@ -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; diff --git a/src/shell/desktopview.cpp b/src/shell/desktopview.cpp index 78fd62e8e..203f71813 100644 --- a/src/shell/desktopview.cpp +++ b/src/shell/desktopview.cpp @@ -30,7 +30,7 @@ #include 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(); diff --git a/src/shell/desktopview.h b/src/shell/desktopview.h index 62af187a0..21848fca8 100644 --- a/src/shell/desktopview.h +++ b/src/shell/desktopview.h @@ -20,13 +20,13 @@ #define DESKTOVIEW_H -#include +#include #include "panelconfigview.h" #include 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 m_configView; + QPointer m_configView; bool m_stayBehind : 1; bool m_fillScreen : 1; }; diff --git a/src/shell/panelconfigview.h b/src/shell/panelconfigview.h index 223ccfb14..5892ebe0b 100644 --- a/src/shell/panelconfigview.h +++ b/src/shell/panelconfigview.h @@ -37,7 +37,7 @@ namespace Plasma { class Containment; } -class PanelConfigView : public ConfigView +class PanelConfigView : public PlasmaQuick::ConfigView { Q_OBJECT diff --git a/src/shell/panelview.cpp b/src/shell/panelview.cpp index 60d550282..bd8d929ff 100644 --- a/src/shell/panelview.cpp +++ b/src/shell/panelview.cpp @@ -37,7 +37,7 @@ #include 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(); 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); } diff --git a/src/shell/panelview.h b/src/shell/panelview.h index 9e75f9adf..e9cec0b77 100644 --- a/src/shell/panelview.h +++ b/src/shell/panelview.h @@ -20,7 +20,7 @@ #define PANELVIEW_H -#include +#include #include "panelconfigview.h" #include #include @@ -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 m_panelConfigView; + QPointer m_panelConfigView; ShellCorona *m_corona; QTimer *m_strutsTimer; VisibilityMode m_visibilityMode; diff --git a/src/shell/widgetexplorer/widgetexplorer.cpp b/src/shell/widgetexplorer/widgetexplorer.cpp index 6cbb06b58..f2c7bbea6 100644 --- a/src/shell/widgetexplorer/widgetexplorer.cpp +++ b/src/shell/widgetexplorer/widgetexplorer.cpp @@ -36,7 +36,7 @@ #include #include -#include "plasmaquickview.h" +#include #include "kcategorizeditemsviewmodels_p.h" #include "plasmaappletitemmodel_p.h" From e9580fc25743848c054d16d02bfc7270600f8114 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 20 Feb 2014 11:16:46 +0100 Subject: [PATCH 4/5] don't install headers of plasmaquick don't commit to binary stability just yet --- src/plasmaquick/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plasmaquick/CMakeLists.txt b/src/plasmaquick/CMakeLists.txt index 36a89f812..b1404df6e 100644 --- a/src/plasmaquick/CMakeLists.txt +++ b/src/plasmaquick/CMakeLists.txt @@ -44,12 +44,12 @@ set(plasmaquick_LIB_INCLUDES 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") From 5fb89a5ea9942fa5a1ae873802a1a7affd362390 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 20 Feb 2014 11:19:50 +0100 Subject: [PATCH 5/5] add warning notices that is not public api --- src/plasmaquick/appletquickitem.h | 11 +++++++++++ src/plasmaquick/configmodel.h | 11 +++++++++++ src/plasmaquick/configview.h | 11 +++++++++++ src/plasmaquick/packageurlinterceptor.h | 11 +++++++++++ src/plasmaquick/private/appletquickitem_p.h | 11 +++++++++++ src/plasmaquick/private/configcategory_p.h | 11 +++++++++++ src/plasmaquick/view.h | 10 ++++++++++ 7 files changed, 76 insertions(+) diff --git a/src/plasmaquick/appletquickitem.h b/src/plasmaquick/appletquickitem.h index d0a1acaef..1deaea985 100644 --- a/src/plasmaquick/appletquickitem.h +++ b/src/plasmaquick/appletquickitem.h @@ -30,6 +30,17 @@ #include +// +// 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; } diff --git a/src/plasmaquick/configmodel.h b/src/plasmaquick/configmodel.h index e6b43704c..462e163e1 100644 --- a/src/plasmaquick/configmodel.h +++ b/src/plasmaquick/configmodel.h @@ -26,6 +26,17 @@ #include +// +// 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; } diff --git a/src/plasmaquick/configview.h b/src/plasmaquick/configview.h index c6b4d13ab..5b8babe71 100644 --- a/src/plasmaquick/configview.h +++ b/src/plasmaquick/configview.h @@ -25,6 +25,17 @@ #include +// +// 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; } diff --git a/src/plasmaquick/packageurlinterceptor.h b/src/plasmaquick/packageurlinterceptor.h index b2c01edf5..08e44e834 100644 --- a/src/plasmaquick/packageurlinterceptor.h +++ b/src/plasmaquick/packageurlinterceptor.h @@ -26,6 +26,17 @@ #include +// +// 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 diff --git a/src/plasmaquick/private/appletquickitem_p.h b/src/plasmaquick/private/appletquickitem_p.h index 8e0b3f7a1..784899a54 100644 --- a/src/plasmaquick/private/appletquickitem_p.h +++ b/src/plasmaquick/private/appletquickitem_p.h @@ -22,6 +22,17 @@ #include +// +// 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; } diff --git a/src/plasmaquick/private/configcategory_p.h b/src/plasmaquick/private/configcategory_p.h index d1103c57d..0d9f1e66f 100644 --- a/src/plasmaquick/private/configcategory_p.h +++ b/src/plasmaquick/private/configcategory_p.h @@ -22,6 +22,17 @@ #include +// +// 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. diff --git a/src/plasmaquick/view.h b/src/plasmaquick/view.h index a853a0f77..16bdd4be3 100644 --- a/src/plasmaquick/view.h +++ b/src/plasmaquick/view.h @@ -25,6 +25,16 @@ #include "plasma/corona.h" #include "plasma/containment.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 PlasmaQuick {