2 * Copyright (C) 2016 Canonical, Ltd.
3 * Copyright (C) 2020 UBports Foundation.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 3.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19#include <QFutureWatcher>
20#include <unity/shell/launcher/AppDrawerModelInterface.h>
22#include "launcheritem.h"
27class AppDrawerModel: public AppDrawerModelInterface
30 // TODO: Add this to AppDrawerModelInterface in unity-api.
31 // Or, better yet, remove AppDrawerModelInterface from unity-api.
32 Q_PROPERTY(bool refreshing READ refreshing NOTIFY refreshingChanged)
34 AppDrawerModel(QObject* parent = nullptr);
36 int rowCount(const QModelIndex &parent) const override;
37 QVariant data(const QModelIndex &index, int role) const override;
39 // TODO: add these to AppDrawerModelInterface too.
41 Q_INVOKABLE void refresh();
44 void refreshingChanged();
47 void appAdded(const QString &appId);
48 void appRemoved(const QString &appId);
49 void appInfoChanged(const QString &appId);
51 void onRefreshFinished();
54 // Using shared_ptr is unavoidable in order to share the refresh result
55 // from the worker thread safely without a memory leak, in case the model
56 // is destructed before the worker finishes.
57 typedef QList<std::shared_ptr<LauncherItem>> ItemList;
61 XdgWatcher *m_xdgWatcher;
62 QFutureWatcher<ItemList> m_refreshFutureWatcher;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list