[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/sysadmin/shaman/plugins/packagesview
From: Lukas Appelhans <l.appelhans () gmx ! de>
Date: 2008-06-19 15:53:12
Message-ID: 1213890792.364844.26020.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 822235 by lappelhans:
Make the PackagesSortFilterProxyModel compile and use it :)
M +1 -1 CMakeLists.txt
M +8 -9 PackagesSortFilterProxyModel.cpp
M +4 -0 PackagesViewWidget.cpp
M +2 -0 PackagesViewWidget.h
--- trunk/playground/sysadmin/shaman/plugins/packagesview/CMakeLists.txt \
#822234:822235 @@ -4,7 +4,7 @@
PackagesViewPlugin.cpp
PackagesViewWidget.cpp
PackagesModel.cpp
- #PackagesSortFilterProxyModel.cpp
+ PackagesSortFilterProxyModel.cpp
PackagesViewDockWidget.cpp
)
--- trunk/playground/sysadmin/shaman/plugins/packagesview/PackagesSortFilterProxyModel.cpp \
#822234:822235 @@ -58,15 +58,14 @@
if (!package)
return false;
- return (m_group.isEmpty() || package->groups().contains(m_group)) && //Look if \
it's in the group
- (m_repo.isEmpty() || package->repository() = m_repo) && //Look if it's in \
the repository
- searchMatch && //Now let's check the state
+ return /**(m_group.isEmpty() || package->packageGroups().contains(m_group)) && \
//Look if it's in the group + (m_repo.isEmpty() || package->repositories() \
= m_repo) && //Look if it's in the repository**/ ((m_state == All) ||
- (m_state == Installed && m_package->status() != Package::Installed) ||
- (m_state == NotInstalled && m_package->status() != \
Package::NotInstalled) ||
- (m_state == Upgradeable && m_package->status() != Package::Upgradeable) \
||
- (m_state == Queued && m_package->action() != Package::NoAction)) && \
//Let's go for searching + (m_state == Installed && package->state() != \
Shaman::Package::Installed) || + (m_state == NotInstalled && \
package->state() != Shaman::Package::NotInstalled) || + (m_state == \
Upgradeable && package->state() != Shaman::Package::Upgradeable) || + \
(m_state == Queued && package->action() != Shaman::Package::NoAction)) && //Let's go \
for searching (m_searchText.isEmpty() ||
- (m_seach == Name && package->name().contains(m_searchText))
- (m_search == Description && \
package->desciption().contains(m_searchText))); + (m_search == Name && \
package->name().contains(m_searchText)) || + (m_search == Description && \
package->description().contains(m_searchText))); }
--- trunk/playground/sysadmin/shaman/plugins/packagesview/PackagesViewWidget.cpp \
#822234:822235 @@ -9,6 +9,7 @@
*/
#include "PackagesViewWidget.h"
#include "PackagesModel.h"
+#include "PackagesSortFilterProxyModel.h"
#include <BackendPlugin.h>
@@ -18,6 +19,9 @@
{
setupUi(this);
m_model = new PackagesModel(m_backend->packages(), this);
+ m_proxyModel = new PackagesSortFilterProxyModel(this);
+ m_proxyModel->setSourceModel(m_model);
+ treeView->setModel(m_proxyModel);
}
PackagesViewWidget::~PackagesViewWidget()
--- trunk/playground/sysadmin/shaman/plugins/packagesview/PackagesViewWidget.h \
#822234:822235 @@ -19,6 +19,7 @@
}
class PackagesModel;
+class PackagesSortFilterProxyModel;
class PackagesViewWidget : public QWidget, public Ui::PackagesViewWidget
{
@@ -30,6 +31,7 @@
private:
Shaman::BackendPlugin * m_backend;
PackagesModel * m_model;
+ PackagesSortFilterProxyModel * m_proxyModel;
};
#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic