revert to pin() and introduce remove()
commitcbf87e3fdcada0f2ea4a0b1f721d50bc51a30975
authorMichael Zanetti <michael.zanetti@canonical.com>
dateWed 3 Jul 2013, 13:43 (13 years ago)
parent1a63151
plugins/Unity/Launcher/launchermodel.cpp+9
@@ -110,6 +110,15 @@ void LauncherModel::pin(int index)
110110 }
111111}
112112
113+void LauncherModel::remove(int index)
114+{
115+ beginRemoveRows(QModelIndex(), index, index);
116+ m_list.takeAt(index)->deleteLater();
117+ endRemoveRows();
118+
119+ storeAppList();
120+}
121+
113122QHash<int, QByteArray> LauncherModel::roleNames() const
114123{
115124 QHash<int, QByteArray> roles;
plugins/Unity/Launcher/launchermodel.h+1
@@ -46,6 +46,7 @@ public:
4646 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const;
4747 Q_INVOKABLE void move(int oldIndex, int newIndex);
4848 Q_INVOKABLE void pin(int index);
49+ Q_INVOKABLE void remove(int index);
4950
5051 QHash<int, QByteArray> roleNames() const;
5152