application property
This commit is contained in:
parent
8fbc0a4493
commit
d713dc1c13
@ -281,8 +281,10 @@ WidgetExplorer::WidgetExplorer(QObject *parent)
|
||||
: QObject(parent),
|
||||
d(new WidgetExplorerPrivate(this))
|
||||
{
|
||||
populateWidgetList();
|
||||
//FIXME: delay
|
||||
setApplication();
|
||||
d->initRunningApplets();
|
||||
|
||||
d->filterItemModel.setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
d->filterItemModel.setDynamicSortFilter(true);
|
||||
d->filterItemModel.setSourceModel(&d->itemModel);
|
||||
@ -309,14 +311,18 @@ void WidgetExplorer::setDesktopView(DesktopView *view)
|
||||
emit desktopViewChanged();
|
||||
}
|
||||
|
||||
void WidgetExplorer::populateWidgetList(const QString &app)
|
||||
void WidgetExplorer::setApplication(const QString &app)
|
||||
{
|
||||
if (d->application == app) {
|
||||
return;
|
||||
}
|
||||
|
||||
d->application = app;
|
||||
d->itemModel.setApplication(app);
|
||||
d->initFilters();
|
||||
|
||||
d->itemModel.setRunningApplets(d->runningApplets);
|
||||
|
||||
emit applicationChanged();
|
||||
}
|
||||
|
||||
QString WidgetExplorer::application()
|
||||
|
@ -75,6 +75,11 @@ class WidgetExplorer : public QObject
|
||||
*/
|
||||
Q_PROPERTY(QList<QObject *> extraActions READ extraActions NOTIFY extraActionsChanged)
|
||||
|
||||
/**
|
||||
* The application that owns the widget list. different application may show different lists
|
||||
*/
|
||||
Q_PROPERTY(QString application READ application WRITE setApplication NOTIFY applicationChanged)
|
||||
|
||||
Q_PROPERTY(DesktopView *desktopView READ desktopView WRITE setDesktopView NOTIFY desktopViewChanged)
|
||||
|
||||
public:
|
||||
@ -90,7 +95,7 @@ public:
|
||||
*
|
||||
* @arg application the application which the widgets should be loaded for.
|
||||
*/
|
||||
void populateWidgetList(const QString &application = QString());
|
||||
void setApplication(const QString &application = QString());
|
||||
|
||||
/**
|
||||
* Changes the current default containment to add applets to
|
||||
@ -131,6 +136,7 @@ Q_SIGNALS:
|
||||
void extraActionsChanged();
|
||||
void closed();
|
||||
void desktopViewChanged();
|
||||
void applicationChanged();
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user