unity-dev team mailing list archive
-
unity-dev team
-
Mailing list archive
-
Message #00119
Re: [Ayatana-dev] Naming of QSortFilterProxyModelQML in unity-2d
On Thursday, April 07, 2011 01:27:29 PM Aurélien Gâteau wrote:
> Hi Richard, nice to see you there :)
And nice to see your familiar KDE name too..
> On 07/04/2011 11:15, Richard Dale wrote:
> > The C++ class that acts as a wrapper for the QSortFilterProxyModel is
> > called 'QSortFilterProxyModelQML', which seems fine to me. However,
> > the QML class is also called 'QSortFilterProxyModelQML' and that seems
> > a bit ugly.
> >
> > So in the QML we have this:
> >
> > QSortFilterProxyModelQML {
> >
> > id: filteredByWorkspace
> > ...
> >
> > }
> >
> > But wouldn't this look a bit more 'qml-like'?
> >
> > SortFilterProxyModel {
> >
> > id: filteredByWorkspace
> > ...
> >
> > }
>
> I agree, but it's quite low-priority for us right now as we are getting
> ready for the release. If you have a patch ready I would be happy to
> apply it though.
I don't want to distract you from the release, but here is a patch I made with
'bzr diff > qsortfilterproxyqml.patch' in the unity-2d directory. I'm still
learning about bzr, and so please tell me if there is a better way to do a
patch or when it is a good idea to create a personal branch on launchpad.
-- Richard
=== modified file 'launcher/Launcher.qml'
--- launcher/Launcher.qml 2011-04-01 14:41:38 +0000
+++ launcher/Launcher.qml 2011-04-07 12:51:34 +0000
@@ -72,7 +72,7 @@
}
}
- QSortFilterProxyModelQML {
+ SortFilterProxyModel {
id: visiblePlaces
model: places
dynamicSortFilter: true
=== modified file 'libunity-2d-private/Unity2d/plugin.cpp'
--- libunity-2d-private/Unity2d/plugin.cpp 2011-03-02 15:29:28 +0000
+++ libunity-2d-private/Unity2d/plugin.cpp 2011-04-07 12:47:48 +0000
@@ -63,7 +63,7 @@
void Unity2dPlugin::registerTypes(const char *uri)
{
- qmlRegisterType<QSortFilterProxyModelQML>(uri, 0, 1, "QSortFilterProxyModelQML");
+ qmlRegisterType<QSortFilterProxyModelQML>(uri, 0, 1, "SortFilterProxyModel");
qmlRegisterType<WindowInfo>(uri, 0, 1, "WindowInfo");
qmlRegisterType<WindowsList>(uri, 0, 1, "WindowsList");
=== modified file 'places/Home.qml'
--- places/Home.qml 2011-04-07 09:16:24 +0000
+++ places/Home.qml 2011-04-07 12:47:48 +0000
@@ -18,7 +18,7 @@
import Qt 4.7
import UnityApplications 1.0 /* Necessary for the ImageProvider serving image://icons/theme_name/icon_name */
-import Unity2d 1.0 /* Necessary for QSortFilterProxyModelQML */
+import Unity2d 1.0 /* Necessary for SortFilterProxyModel */
import Places 1.0 /* Necessary for DashDeclarativeView.*Dash */
Item {
@@ -116,7 +116,7 @@
Each result has a column (the second one) containing the id of
the group it belongs to (groupId).
*/
- model: QSortFilterProxyModelQML {
+ model: SortFilterProxyModel {
model: item.globalResultsModel
/* FIXME: we ignore the groupId with renderer 'UnityEmptySearchRenderer'
=== modified file 'places/PlaceEntryView.qml'
--- places/PlaceEntryView.qml 2011-03-23 14:04:23 +0000
+++ places/PlaceEntryView.qml 2011-04-07 12:47:48 +0000
@@ -17,7 +17,7 @@
*/
import Qt 4.7
-import Unity2d 1.0 /* Necessary for QSortFilterProxyModelQML */
+import Unity2d 1.0 /* Necessary for SortFilterProxyModel */
Item {
id: placeEntryView
@@ -27,7 +27,7 @@
function activateFirstResult() {
/* Going through the list of groups and selecting the first one
- that has results for the search. A QSortFilterProxyModelQML
+ that has results for the search. A SortFilterProxyModel
('firstGroupModel') is used to filter the search results per group.
*/
var placeEntry, i
@@ -44,7 +44,7 @@
}
}
- QSortFilterProxyModelQML {
+ SortFilterProxyModel {
id: firstGroupModel
property int groupId
@@ -89,7 +89,7 @@
width: ListView.view.width
/* Model that will be used by the group's delegate */
- QSortFilterProxyModelQML {
+ SortFilterProxyModel {
id: group_model
model: placeEntryView.model.entryResultsModel
=== modified file 'spread/Windows.qml'
--- spread/Windows.qml 2011-03-22 06:04:20 +0000
+++ spread/Windows.qml 2011-04-07 12:47:48 +0000
@@ -53,7 +53,7 @@
/* This proxy model takes care of removing all windows that are not on
the current workspace and that are not pinned to all workspaces. */
- QSortFilterProxyModelQML {
+ SortFilterProxyModel {
id: filteredByWorkspace
model: switcher.allWindows
dynamicSortFilter: true
@@ -64,7 +64,7 @@
/* If there's any application filter set, this proxy model will remove
all windows that do not belong to it. */
- QSortFilterProxyModelQML {
+ SortFilterProxyModel {
id: filteredByApplication
model: filteredByWorkspace
dynamicSortFilter: true
=== modified file 'spread/Workspaces.qml'
--- spread/Workspaces.qml 2011-04-04 16:23:43 +0000
+++ spread/Workspaces.qml 2011-04-07 12:47:48 +0000
@@ -55,7 +55,7 @@
((height - 2*margin) / switcher.height)
/* When this is set, it is used to filter the global list of windows to limit it to
- a single application. See the QSortFilterProxyModelQML used in Spread.qml */
+ a single application. See the SortFilterProxyModel used in Spread.qml */
property string applicationFilter
/* The number of the currently zoomed workspace (-1 means no workspace)
Follow ups
References