Commit 7ce78b5f authored by Martin Kacej's avatar Martin Kacej

mobile proxy model added

parent fc52d7aa
/*
* <one line to give the library's name and an idea of what it does.>
* Copyright 2017 Martin Kacej <m.kacej@atlas.sk>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* 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 General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mobileappletproxymodel.h"
MobileAppletProxymodel::MobileAppletProxymodel(QObject* parent):AppletProxyModel(parent)
{
setDynamicSortFilter(true);
sort(0, Qt::DescendingOrder);
}
MobileAppletProxymodel::~MobileAppletProxymodel()
{
}
bool MobileAppletProxymodel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
{
return true;
}
/*
* Mobile applet proxy model - model for displaying netwoks in mobile applet
* Copyright 2017 Martin Kacej <m.kacej@atlas.sk>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* 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 General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MOBILEAPPLETPROXYMODEL_H
#define MOBILEAPPLETPROXYMODEL_H
#include "appletproxymodel.h"
class Q_DECL_EXPORT MobileAppletProxymodel : public AppletProxyModel
{
Q_OBJECT
Q_PROPERTY(QAbstractItemModel * sourceModel READ sourceModel WRITE setSourceModel)
public:
explicit MobileAppletProxymodel(QObject* parent = 0);
virtual ~MobileAppletProxymodel();
protected:
virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const Q_DECL_OVERRIDE;
};
#endif // MOBILEAPPLETPROXYMODEL_H
......@@ -55,6 +55,11 @@ Item {
sourceModel: connectionModel
}
PlasmaNM.MobileAppletProxyModel{
id: mobileappletProxyModel
sourceModel: connectionModel
}
Column {
id: formLayout
spacing: units.gridUnit
......@@ -129,7 +134,7 @@ Item {
width: parent.width
currentIndex: -1
boundsBehavior: Flickable.StopAtBounds
model: appletProxyModel
model: mobileappletProxyModel
delegate: RowItemDelegate{
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment