packages: kde4-kdelibs/kde4-kdelibs-bug-187066.patch (NEW) - rel 3; unoffic...

arekm arekm at pld-linux.org
Sun May 29 09:44:42 CEST 2011


Author: arekm                        Date: Sun May 29 07:44:42 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- rel 3; unofficial workaround for bug 187066 (file dialog crashes sometimes)

---- Files affected:
packages/kde4-kdelibs:
   kde4-kdelibs-bug-187066.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/kde4-kdelibs/kde4-kdelibs-bug-187066.patch
diff -u /dev/null packages/kde4-kdelibs/kde4-kdelibs-bug-187066.patch:1.1
--- /dev/null	Sun May 29 09:44:42 2011
+++ packages/kde4-kdelibs/kde4-kdelibs-bug-187066.patch	Sun May 29 09:44:37 2011
@@ -0,0 +1,46 @@
+diff --git a/kfile/kdiroperator.cpp b/kfile/kdiroperator.cpp
+index 8eb1819..4c93ac9 100644
+--- a/kfile/kdiroperator.cpp
++++ b/kfile/kdiroperator.cpp
+@@ -2526,7 +2526,7 @@ void KDirOperator::Private::_k_slotExpandToUrl(const QModelIndex &index)
+             const KUrl url = *it;
+             if (url.isParentOf(item.url())) {
+                 const KFileItem _item = dirLister->findByUrl(url);
+-                if (_item.isDir()) {
++                if (!_item.isNull() && _item.isDir()) {
+                     const QModelIndex _index = dirModel->indexForItem(_item);
+                     const QModelIndex _proxyIndex = proxyModel->mapFromSource(_index);
+                     treeView->expand(_proxyIndex);
+diff --git a/kfile/tests/kdiroperatortest.cpp b/kfile/tests/kdiroperatortest.cpp
+index 147aaaa..429fc30 100644
+--- a/kfile/tests/kdiroperatortest.cpp
++++ b/kfile/tests/kdiroperatortest.cpp
+@@ -67,6 +67,28 @@ private Q_SLOTS:
+         QVERIFY(qobject_cast<QTreeView*>(dirOp->view()));
+         delete dirOp;
+     }
++
++    /**
++     * testBug187066 does the following:
++     * 
++     * 1. Open a KDirOperator in kdelibs/kfile
++     * 2. Set the current item to "file:///"
++     * 3. Set the current item to "file:///.../kdelibs/kfile/tests/kdiroperatortest.cpp"
++     *
++     * This may result in a crash, see https://bugs.kde.org/show_bug.cgi?id=187066
++     */
++    
++    void testBug187066()
++    {
++        const KUrl kFileDirUrl(KUrl(KDESRCDIR).upUrl());
++
++        KDirOperator dirOp(kFileDirUrl);
++        dirOp.setView(KFile::DetailTree);
++        QTest::kWaitForSignal(dirOp.dirLister(), SIGNAL(completed()));
++        dirOp.setCurrentItem("file:///");
++        dirOp.setCurrentItem(KDESRCDIR "kdiroperatortest.cpp");
++        QTest::kWaitForSignal(dirOp.dirLister(), SIGNAL(completed()));
++    }
+ };
+ 
+ QTEST_KDEMAIN( KDirOperatorTest, GUI )
================================================================


More information about the pld-cvs-commit mailing list