aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Humpula <michal.humpula@seznam.cz>2014-01-26 17:04:36 (GMT)
committerMichal Humpula <michal.humpula@seznam.cz>2014-01-26 17:04:36 (GMT)
commita3c1034f0ba0717c510f917b3c5244c192cdf687 (patch)
treef6abbe5fab3ca85f6a3d64fc6abb92ca8be154a3
parentc6315f7e3f36c6d63f91ce295dd79539bdb2a35c (diff)
try to fix filetreemodel listMode tests
-rw-r--r--addons/filetree/autotests/filetree_model_test.cpp5
-rw-r--r--addons/filetree/autotests/filetree_model_test.h2
-rw-r--r--addons/filetree/katefiletreemodel.cpp2
3 files changed, 1 insertions, 8 deletions
diff --git a/addons/filetree/autotests/filetree_model_test.cpp b/addons/filetree/autotests/filetree_model_test.cpp
index d55966c..badf99c 100644
--- a/addons/filetree/autotests/filetree_model_test.cpp
+++ b/addons/filetree/autotests/filetree_model_test.cpp
@@ -567,9 +567,6 @@ void FileTreeModelTest::buildTreeFullPath()
qDeleteAll(documents);
}
-// fails on build.kde.org, we need a way to fix that
-#if 0
-
void FileTreeModelTest::listMode_data()
{
QTest::addColumn<QList<DummyDocument *>>("documents");
@@ -631,8 +628,6 @@ void FileTreeModelTest::listMode()
qDeleteAll(documents);
}
-#endif
-
void FileTreeModelTest::deleteDocument_data()
{
QTest::addColumn<QList<DummyDocument *>>("documents");
diff --git a/addons/filetree/autotests/filetree_model_test.h b/addons/filetree/autotests/filetree_model_test.h
index 10ef149..8ea4f28 100644
--- a/addons/filetree/autotests/filetree_model_test.h
+++ b/addons/filetree/autotests/filetree_model_test.h
@@ -45,10 +45,8 @@ class FileTreeModelTest : public QObject
void buildTreeBatchPrefill_data();
void buildTreeBatchPrefill();
-#if 0
void listMode_data();
void listMode();
-#endif
void deleteDocument_data();
void deleteDocument();
diff --git a/addons/filetree/katefiletreemodel.cpp b/addons/filetree/katefiletreemodel.cpp
index 523bdb0..512392a 100644
--- a/addons/filetree/katefiletreemodel.cpp
+++ b/addons/filetree/katefiletreemodel.cpp
@@ -438,7 +438,7 @@ void KateFileTreeModel::clearModel()
// remove all items
// can safely ignore documentClosed here
- beginRemoveRows(QModelIndex(), 0, m_root->childCount() - 1);
+ beginRemoveRows(QModelIndex(), 0, qMax(m_root->childCount() - 1, 0));
delete m_root;
m_root = new ProxyItemDir(QLatin1String("m_root"), 0);