use a generic plasmaquickview

This commit is contained in:
Marco Martin 2013-10-30 12:46:25 +01:00
parent b2b74b4eaa
commit d20bc0ea1b
3 changed files with 17 additions and 14 deletions

View File

@ -43,7 +43,7 @@ Item {
WidgetExplorer {
id: widgetExplorer
desktopView: desktop
view: desktop
onShouldClose: main.closed();
}

View File

@ -36,7 +36,7 @@
#include <Plasma/PackageStructure>
#include <qstandardpaths.h>
#include "desktopview.h"
#include "plasmaquickview.h"
#include "kcategorizeditemsviewmodels_p.h"
#include "plasmaappletitemmodel_p.h"
@ -63,7 +63,7 @@ public:
containment(0),
itemModel(w),
filterModel(w),
desktopView(0)
view(0)
{
}
@ -94,7 +94,7 @@ public:
PlasmaAppletItemModel itemModel;
KCategorizedItemsViewModels::DefaultFilterModel filterModel;
DefaultItemFilterProxyModel filterItemModel;
DesktopView *desktopView;
PlasmaQuickView *view;
};
void WidgetExplorerPrivate::initFilters()
@ -297,18 +297,18 @@ WidgetExplorer::~WidgetExplorer()
}
DesktopView *WidgetExplorer::desktopView()
PlasmaQuickView *WidgetExplorer::view()
{
return d->desktopView;
return d->view;
}
void WidgetExplorer::setDesktopView(DesktopView *view)
void WidgetExplorer::setView(PlasmaQuickView *view)
{
d->desktopView = view;
d->view = view;
if (view) {
setContainment(view->containment());
}
emit desktopViewChanged();
emit viewChanged();
}
void WidgetExplorer::setApplication(const QString &app)

View File

@ -34,7 +34,7 @@ namespace Plasma {
class Applet;
}
class WidgetExplorerPrivate;
class DesktopView;
class PlasmaQuickView;
//We need to access the separator property that is not exported by QAction
class WidgetAction : public QAction
@ -80,7 +80,10 @@ class WidgetExplorer : public QObject
*/
Q_PROPERTY(QString application READ application WRITE setApplication NOTIFY applicationChanged)
Q_PROPERTY(DesktopView *desktopView READ desktopView WRITE setDesktopView NOTIFY desktopViewChanged)
/**
* The view in which we want to add widgets in the end
*/
Q_PROPERTY(PlasmaQuickView *view READ view WRITE setView NOTIFY viewChanged)
public:
explicit WidgetExplorer(QObject *parent = 0);
@ -114,8 +117,8 @@ public:
Plasma::Corona *corona() const;
DesktopView *desktopView();
void setDesktopView(DesktopView *view);
PlasmaQuickView *view();
void setView(PlasmaQuickView *view);
QObject *widgetsModel() const;
QObject *filterModel() const;
@ -132,7 +135,7 @@ Q_SIGNALS:
void widgetsMenuActionsChanged();
void extraActionsChanged();
void shouldClose();
void desktopViewChanged();
void viewChanged();
void applicationChanged();
public Q_SLOTS: