Moving the proxy model test suite to kdesupport?

Stephen Kelly steveire at
Sat Jul 3 14:13:08 BST 2010


The test suite for proxy models is growing inside 

The unit tests for kselectionproxymodel and kdescendantsproxymodel depend on 
the test suite library.

Last week I added a ModelEventLogger which is useful for debugging model or 
proxy using applications, but as it is hidden inside kdeui/tests, the only 
way to use the logger is to hack the CMakeLists to find the library and 

kde-devel at bishop:~/kde/src/KDE/kdepim/kmail{master}$ git diff .
diff --git a/kmail/CMakeLists.txt b/kmail/CMakeLists.txt
index ee2fbd1..c1d89a1 100644
--- a/kmail/CMakeLists.txt
+++ b/kmail/CMakeLists.txt
@@ -33,6 +33,7 @@ include_directories(
+  /home/kde-devel/kde/src/KDE/kdelibs/kdeui/tests/proxymodeltestsuite
@@ -252,6 +253,7 @@ target_link_libraries(kmailprivate
+  /home/kde-devel/kde/build/KDE/kdelibs/lib/
diff --git a/kmail/kmkernel.cpp b/kmail/kmkernel.cpp
index 4abf35a..b828e00 100644
--- a/kmail/kmkernel.cpp
+++ b/kmail/kmkernel.cpp
@@ -108,6 +108,8 @@ using KMail::MailServiceImpl;
 #include "searchdescriptionattribute.h"
+#include "modeleventlogger.h"
 static KMKernel * mySelf = 0;
 static bool s_askingToGoOnline = false;
@@ -233,6 +235,8 @@ KMKernel::KMKernel (QObject *parent, const char *name) :
   mEntityTreeModel->setIncludeUnsubscribed( false );
Akonadi::EntityTreeModel::LazyPopulation );
+  new ModelEventLogger(mEntityTreeModel, this);
   mCollectionModel = new Akonadi::EntityMimeTypeFilterModel( this );
   mCollectionModel->setSourceModel( mEntityTreeModel );
Akonadi::Collection::mimeType() );

I was thinking of moving the already self-contained proxymodeltestsuite 
library into kdesupport.

The library would be a build-time dependency for kdelibs and is needed only 
when tests are being built. 

The disadvantage is that people wishing to build kdelibs tests would need to 
build this external dependency. The advantage is that people hitting an 
assert in kmail etc would just need to install the library from a well known 
location, include the header and attach the logger. The library would not 
need to be packaged or versioned as far as I'm concerned. The 
proxymodeltestsuite library depends on Qt and my Grantlee templating system.

Any thoughts?


PS, for more on this, attend my talk in room 1 this afternoon at Akademy :).

More information about the kde-core-devel mailing list