[arch-commits] Commit in qt (3 files)
Andrea Scarpino
andrea at archlinux.org
Sat Jan 8 02:20:26 UTC 2011
Date: Friday, January 7, 2011 @ 21:20:26
Author: andrea
Revision: 105354
add patch to fix crashes with kdepim 4.6beta
Added:
qt/kde-unstable/
qt/kde-unstable/fix-filtering.patch
Modified:
qt/kde-unstable/PKGBUILD
----------------------------------+
PKGBUILD | 9 +-
kde-unstable/fix-filtering.patch | 116 +++++++++++++++++++++++++++++++++++++
2 files changed, 122 insertions(+), 3 deletions(-)
Modified: kde-unstable/PKGBUILD
===================================================================
--- trunk/PKGBUILD 2011-01-07 17:37:37 UTC (rev 105306)
+++ kde-unstable/PKGBUILD 2011-01-08 02:20:26 UTC (rev 105354)
@@ -4,7 +4,7 @@
pkgname=qt
pkgver=4.7.1
-pkgrel=3
+pkgrel=4
pkgdesc='A cross-platform application and UI framework'
arch=('i686' 'x86_64')
url='http://qt.nokia.com/'
@@ -26,14 +26,16 @@
'assistant.desktop' 'designer.desktop' 'linguist.desktop'
'qtconfig.desktop'
'fix-qtbug-15857.patch'
- 'add-postgresql9.patch')
+ 'add-postgresql9.patch'
+ 'fix-filtering.patch')
md5sums=('6f88d96507c84e9fea5bf3a71ebeb6d7'
'fc211414130ab2764132e7370f8e5caa'
'85179f5e0437514f8639957e1d8baf62'
'f11852b97583610f3dbb669ebc3e21bc'
'6b771c8a81dd90b45e8a79afa0e5bbfd'
'c359d7b8c3a7fdd99512feaab8c2e26b'
- 'ae3bb58e7b63786d420905baf083fcd2')
+ 'ae3bb58e7b63786d420905baf083fcd2'
+ 'c5c34077811d37a6ba4c156d0018e7c2')
build() {
unset QMAKESPEC
@@ -46,6 +48,7 @@
# Already fixed upstream
patch -Np1 -i ${srcdir}/fix-qtbug-15857.patch
patch -Np1 -i ${srcdir}/add-postgresql9.patch
+ patch -Np1 -i ${srcdir}/fix-filtering.patch
sed -i "s|-O2|$CXXFLAGS|" mkspecs/common/g++.conf
sed -i "/^QMAKE_RPATH/s| -Wl,-rpath,||g" mkspecs/common/g++.conf
Added: kde-unstable/fix-filtering.patch
===================================================================
--- kde-unstable/fix-filtering.patch (rev 0)
+++ kde-unstable/fix-filtering.patch 2011-01-08 02:20:26 UTC (rev 105354)
@@ -0,0 +1,116 @@
+From 88dd7568fff419510a7c26ffb93d93cc276d7b3b Mon Sep 17 00:00:00 2001
+From: Stephen Kelly <stephen.kelly at kdab.com>
+Date: Tue, 23 Nov 2010 15:31:12 +0100
+Subject: [PATCH] Fix filtering of columns in QSFPM.
+
+Fixes a crash introduced in 315c09c3873f7c5d8b785443372bf975bae47ee7
+
+Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de at nokia.com>
+Reviewed-by: Olivier
+---
+ src/gui/itemviews/qsortfilterproxymodel.cpp | 4 +-
+ .../qsortfilterproxymodel.pro | 5 ++-
+ .../tst_qsortfilterproxymodel.cpp | 39 ++++++++++++++++++++
+ 3 files changed, 44 insertions(+), 4 deletions(-)
+
+diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp
+index dc8d938..0d9819e 100644
+--- a/src/gui/itemviews/qsortfilterproxymodel.cpp
++++ b/src/gui/itemviews/qsortfilterproxymodel.cpp
+@@ -782,14 +782,14 @@ void QSortFilterProxyModelPrivate::source_items_inserted(
+ if (orthogonal_source_to_proxy.isEmpty()) {
+ const int ortho_end = (orient == Qt::Horizontal) ? model->rowCount(source_parent) : model->columnCount(source_parent);
+
++ orthogonal_source_to_proxy.resize(ortho_end);
++
+ for (int ortho_item = 0; ortho_item < ortho_end; ++ortho_item) {
+ if ((orient == Qt::Horizontal) ? q->filterAcceptsRow(ortho_item, source_parent)
+ : q->filterAcceptsColumn(ortho_item, source_parent)) {
+ orthogonal_proxy_to_source.append(ortho_item);
+ }
+ }
+- orthogonal_source_to_proxy.resize(orthogonal_proxy_to_source.size());
+-
+ if (orient == Qt::Horizontal) {
+ // We're reacting to columnsInserted, but we've just inserted new rows. Sort them.
+ sort_source_rows(orthogonal_proxy_to_source, source_parent);
+diff --git a/tests/auto/qsortfilterproxymodel/qsortfilterproxymodel.pro b/tests/auto/qsortfilterproxymodel/qsortfilterproxymodel.pro
+index d2c1147..7edd4a5 100644
+--- a/tests/auto/qsortfilterproxymodel/qsortfilterproxymodel.pro
++++ b/tests/auto/qsortfilterproxymodel/qsortfilterproxymodel.pro
+@@ -1,6 +1,7 @@
+ load(qttest_p4)
+
+-SOURCES += tst_qsortfilterproxymodel.cpp
+-
++INCLUDEPATH += $$PWD/../modeltest
+
++SOURCES += tst_qsortfilterproxymodel.cpp ../modeltest/dynamictreemodel.cpp ../modeltest/modeltest.cpp
++HEADERS += ../modeltest/dynamictreemodel.h ../modeltest/modeltest.h
+
+diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+index 66caf4a..93b9d30 100644
+--- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
++++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+@@ -43,6 +43,9 @@
+ #include <QtTest/QtTest>
+ #include "../../shared/util.h"
+
++#include "dynamictreemodel.h"
++#include "modeltest.h"
++
+ #include <QtCore>
+ #include <QtGui>
+
+@@ -144,6 +147,7 @@ private slots:
+
+ void testMultipleProxiesWithSelection();
+ void mapSelectionFromSource();
++ void filteredColumns();
+
+ protected:
+ void buildHierarchy(const QStringList &data, QAbstractItemModel *model);
+@@ -3174,5 +3178,40 @@ void tst_QSortFilterProxyModel::taskQTBUG_10287_unnecessaryMapCreation()
+ // No assert failure, it passes.
+ }
+
++class FilteredColumnProxyModel : public QSortFilterProxyModel
++{
++ Q_OBJECT
++public:
++ FilteredColumnProxyModel(QObject *parent = 0)
++ : QSortFilterProxyModel(parent)
++ {
++
++ }
++
++protected:
++ bool filterAcceptsColumn(int column, const QModelIndex &source_parent) const
++ {
++ return column % 2 != 0;
++ }
++};
++
++void tst_QSortFilterProxyModel::filteredColumns()
++{
++ DynamicTreeModel *model = new DynamicTreeModel(this);
++
++ FilteredColumnProxyModel *proxy = new FilteredColumnProxyModel(this);
++ proxy->setSourceModel(model);
++
++ new ModelTest(proxy, this);
++
++ ModelInsertCommand *insertCommand = new ModelInsertCommand(model, this);
++ insertCommand->setNumCols(2);
++ insertCommand->setStartRow(0);
++ insertCommand->setEndRow(0);
++ // Parent is QModelIndex()
++ insertCommand->doCommand();
++
++}
++
+ QTEST_MAIN(tst_QSortFilterProxyModel)
+ #include "tst_qsortfilterproxymodel.moc"
+--
+1.6.1
+
More information about the arch-commits
mailing list