I have made the following changes intended for : CE:MW:Shared / nemo-qml-plugins
Please review and accept or decline. BOSS has already run some checks on this request. See the "Messages from BOSS" section below. https://build.pub.meego.com//request/show/6454 Thank You, Nicola De Filippo [This message was auto-generated] --- Request # 6454: Messages from BOSS: State: review at 2012-08-30T01:49:06 by bossbot Reviews: accepted by bossbot : Prechecks succeeded. new for CE-maintainers : Please replace this text with a review and approve/reject the review (not the SR). BOSS will take care of the rest Changes: submit: home:niqt / nemo-qml-plugins -> CE:MW:Shared / nemo-qml-plugins changes files: -------------- --- nemo-qml-plugins.changes +++ nemo-qml-plugins.changes @@ -0,0 +1,3 @@ +* Tue Aug 30 2012 Nicola De Filippo <[email protected]> - 0.0.6 +- seasideproxymodel: add filter and search function (by Nicola) + old: ---- nemo-qml-plugins-0.0.5.tar.bz2 new: ---- 0003-add-filter-search.patch 0004-remove-blank-lines.patch nemo-qml-plugins-0.0.6.tar.bz2 spec files: ----------- --- nemo-qml-plugins.spec +++ nemo-qml-plugins.spec @@ -1,6 +1,6 @@ # # Do NOT Edit the Auto-generated Part! -# Generated by: spectacle version 0.24.1 +# Generated by: spectacle version 0.24 # Name: nemo-qml-plugins @@ -9,7 +9,7 @@ # << macros Summary: Nemo QML plugins source package. -Version: 0.0.5 +Version: 0.0.6 Release: 1 Group: System/Libraries License: BSD @@ -17,6 +17,8 @@ Source0: %{name}-%{version}.tar.bz2 Source100: nemo-qml-plugins.yaml Patch0: 0001-fix-defaults-for-variables.patch +Patch1: 0003-add-filter-search.patch +Patch2: 0004-remove-blank-lines.patch BuildRequires: pkgconfig(QtCore) >= 4.7.0 BuildRequires: pkgconfig(QtDeclarative) BuildRequires: pkgconfig(QtGui) @@ -59,6 +61,10 @@ # 0001-fix-defaults-for-variables.patch %patch0 -p1 +# 0003-add-filter-search.patch +%patch1 -p1 +# 0004-remove-blank-lines.patch +%patch2 -p1 # >> setup # << setup other changes: -------------- ++++++ 0003-add-filter-search.patch (new) --- 0003-add-filter-search.patch +++ 0003-add-filter-search.patch @@ -0,0 +1,101 @@ +From 8bb74d9e4c10abe4f40e3be88e8cc504f8009fd1 Mon Sep 17 00:00:00 2001 +From: Nicola De Filippo <[email protected]> +Date: Wed, 29 Aug 2012 01:23:46 +0200 +Subject: [PATCH 3/4] add filter search + +--- + contacts/seasideproxymodel.cpp | 34 ++++++++++++++++++++++++++++++++++ + contacts/seasideproxymodel.h | 5 +++++ + 2 files changed, 39 insertions(+) + +diff --git a/contacts/seasideproxymodel.cpp b/contacts/seasideproxymodel.cpp +index 5c52e55..e1e7cfa 100644 +--- a/contacts/seasideproxymodel.cpp ++++ b/contacts/seasideproxymodel.cpp +@@ -1,6 +1,7 @@ + /* + * Copyright 2011 Intel Corporation. + * Copyright 2011 Robin Burchell ++ * Copyright 2012 Nicola De Filippo + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at +@@ -46,6 +47,22 @@ void SeasideProxyModel::setFilter(FilterType filter) + invalidateFilter(); + } + ++void SeasideProxyModel::search(const QString & pattern) ++{ ++ if (pattern.length() == 0) { ++ setFilter(FilterAll); ++ } else { ++ setFilter(FilterSearch); ++ } ++ ++ QRegExp rx("*"+ pattern + "*"); ++ rx.setPatternSyntax(QRegExp::Wildcard); ++ ++ setFilterRegExp(rx); ++ qDebug() << Q_FUNC_INFO << filterRegExp(); ++} ++ ++ + int SeasideProxyModel::getSourceRow(int row) const + { + return mapToSource(index(row, 0)).row(); +@@ -72,6 +89,23 @@ bool SeasideProxyModel::filterAcceptsRow(int source_row, + return true; + } + ++ if (priv->filterType == FilterSearch) { ++ // TODO: this should not be here ++ qDebug("fastscroll: FilterSearch emitting countChanged"); ++ ++ if (person->displayLabel().contains(filterRegExp())) { ++ ++ ++ emit const_cast<SeasideProxyModel*>(this)->countChanged(); ++ return true; ++ } ++ return false; ++ } ++ ++ ++ ++ ++ + if (priv->filterType == FilterFavorites) { + if (person->favorite()) { + // TODO: this should not be here +diff --git a/contacts/seasideproxymodel.h b/contacts/seasideproxymodel.h +index df8edea..ccccd01 100644 +--- a/contacts/seasideproxymodel.h ++++ b/contacts/seasideproxymodel.h +@@ -1,5 +1,6 @@ + /* + * Copyright 2011 Intel Corporation. ++ * Copyright 2012 Nicola De Filippo. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at +@@ -26,6 +27,7 @@ public: + enum FilterType { + FilterAll, + FilterFavorites, ++ FilterSearch, + }; + + enum StringType { +@@ -34,6 +36,9 @@ public: + }; + + Q_INVOKABLE virtual void setFilter(FilterType filter); ++ ++ Q_INVOKABLE virtual void search(const QString & pattern); ++ + Q_INVOKABLE int getSourceRow(int row) const; + + // for fastscroll support +-- +1.7.9.5 + ++++++ 0004-remove-blank-lines.patch (new) --- 0004-remove-blank-lines.patch +++ 0004-remove-blank-lines.patch @@ -0,0 +1,39 @@ +From 6b2ec3f0c6bdf6e292072a9fb32af0a291606d1a Mon Sep 17 00:00:00 2001 +From: Nicola De Filippo <[email protected]> +Date: Wed, 29 Aug 2012 10:28:19 +0200 +Subject: [PATCH 4/4] remove blank lines + +--- + contacts/seasideproxymodel.cpp | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/contacts/seasideproxymodel.cpp b/contacts/seasideproxymodel.cpp +index e1e7cfa..5260549 100644 +--- a/contacts/seasideproxymodel.cpp ++++ b/contacts/seasideproxymodel.cpp +@@ -90,22 +90,14 @@ bool SeasideProxyModel::filterAcceptsRow(int source_row, + } + + if (priv->filterType == FilterSearch) { +- // TODO: this should not be here + qDebug("fastscroll: FilterSearch emitting countChanged"); +- + if (person->displayLabel().contains(filterRegExp())) { +- +- + emit const_cast<SeasideProxyModel*>(this)->countChanged(); + return true; + } + return false; + } + +- +- +- +- + if (priv->filterType == FilterFavorites) { + if (person->favorite()) { + // TODO: this should not be here +-- +1.7.9.5 + ++++++ nemo-qml-plugins-0.0.5.tar.bz2 -> nemo-qml-plugins-0.0.6.tar.bz2 ++++++ nemo-qml-plugins.yaml --- nemo-qml-plugins.yaml +++ nemo-qml-plugins.yaml @@ -2,12 +2,15 @@ Summary: Nemo QML plugins source package. Group: System/Libraries Description: Do not install this, install the subpackaged plugins. -Version: 0.0.5 +Version: 0.0.6 Release: 1 Sources: - "%{name}-%{version}.tar.bz2" Patches: - 0001-fix-defaults-for-variables.patch + - 0003-add-filter-search.patch + - 0004-remove-blank-lines.patch + License: BSD URL: https://github.com/nemomobile/nemo-qml-plugins Configure: none
