mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-28 22:53:09 +00:00
get rid of favoritesmodel
This commit is contained in:
parent
0dca5a4a3f
commit
fa2d6b0258
6 changed files with 0 additions and 109 deletions
|
|
@ -3,7 +3,6 @@ project(satellitecomponents)
|
|||
set(satellitecomponents_SRCS
|
||||
satellitecomponentsplugin.cpp
|
||||
applicationlistmodel.cpp
|
||||
favoritesmodel.cpp
|
||||
)
|
||||
|
||||
add_library(satellitecomponentsplugin SHARED ${satellitecomponents_SRCS})
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
// Self
|
||||
#include "applicationlistmodel.h"
|
||||
#include "favoritesmodel.h"
|
||||
|
||||
// Qt
|
||||
#include <QByteArray>
|
||||
|
|
@ -38,9 +37,6 @@
|
|||
ApplicationListModel::ApplicationListModel(QObject *parent)
|
||||
: QAbstractListModel(parent)
|
||||
{
|
||||
m_favoritesModel = new FavoritesModel(this);
|
||||
m_favoritesModel->setSourceModel(this);
|
||||
|
||||
//can't use the new syntax as this signal is overloaded
|
||||
connect(KSycoca::self(), SIGNAL(databaseChanged(const QStringList &)),
|
||||
this, SLOT(sycocaDbChanged(const QStringList &)));
|
||||
|
|
@ -50,11 +46,6 @@ ApplicationListModel::~ApplicationListModel()
|
|||
{
|
||||
}
|
||||
|
||||
FavoritesModel *ApplicationListModel::favoritesModel()
|
||||
{
|
||||
return m_favoritesModel;
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> ApplicationListModel::roleNames() const
|
||||
{
|
||||
QHash<int, QByteArray> roleNames;
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@
|
|||
|
||||
class QString;
|
||||
|
||||
class FavoritesModel;
|
||||
|
||||
struct ApplicationData {
|
||||
QString name;
|
||||
QString icon;
|
||||
|
|
@ -41,13 +39,11 @@ class ApplicationListModel : public QAbstractListModel {
|
|||
|
||||
Q_PROPERTY(int count READ count NOTIFY countChanged)
|
||||
Q_PROPERTY(QStringList appOrder READ appOrder WRITE setAppOrder NOTIFY appOrderChanged)
|
||||
Q_PROPERTY(FavoritesModel *favoritesModel READ favoritesModel CONSTANT)
|
||||
|
||||
public:
|
||||
ApplicationListModel(QObject *parent = 0);
|
||||
virtual ~ApplicationListModel();
|
||||
|
||||
FavoritesModel *favoritesModel();
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
|
||||
int count() { return m_applicationList.count(); }
|
||||
|
|
@ -85,7 +81,6 @@ private:
|
|||
|
||||
QStringList m_appOrder;
|
||||
QHash<QString, int> m_appPositions;
|
||||
FavoritesModel *m_favoritesModel;
|
||||
};
|
||||
|
||||
#endif // APPLICATIONLISTMODEL_H
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
* Copyright 2015 by Marco Martin <mart@kde.org>
|
||||
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "favoritesmodel.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
FavoritesModel::FavoritesModel(QObject *parent)
|
||||
: QIdentityProxyModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
FavoritesModel::~FavoritesModel()
|
||||
{
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> FavoritesModel::roleNames() const
|
||||
{
|
||||
return sourceModel()->roleNames();
|
||||
}
|
||||
|
||||
int FavoritesModel::rowCount(const QModelIndex &parent) const
|
||||
{return QIdentityProxyModel::rowCount(parent);
|
||||
return qMin(QIdentityProxyModel::rowCount(parent), 4);
|
||||
}
|
||||
|
||||
#include "moc_favoritesmodel.cpp"
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
/*
|
||||
* Copyright 2015 by Marco MArtin <mart@kde.org>
|
||||
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef FAVORITESMODEL_H
|
||||
#define FAVORITESMODEL_H
|
||||
|
||||
#include <QIdentityProxyModel>
|
||||
|
||||
|
||||
class QTimer;
|
||||
|
||||
|
||||
class FavoritesModel : public QIdentityProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FavoritesModel(QObject *parent = 0);
|
||||
~FavoritesModel();
|
||||
|
||||
QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
|
||||
int count() const
|
||||
{
|
||||
return rowCount();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -28,7 +28,6 @@
|
|||
#include <kdeclarative/kdeclarative.h>
|
||||
|
||||
#include "applicationlistmodel.h"
|
||||
#include "favoritesmodel.h"
|
||||
|
||||
void SatelliteComponentsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
|
||||
{
|
||||
|
|
@ -46,7 +45,6 @@ void SatelliteComponentsPlugin::registerTypes(const char *uri)
|
|||
Q_ASSERT(uri == QLatin1String("org.kde.satellite.components"));
|
||||
|
||||
qmlRegisterType<ApplicationListModel>(uri, 0, 1, "ApplicationListModel");
|
||||
qmlRegisterType<FavoritesModel>();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue