KDE/kdevplatform/plugins/projectmanagerview
Andreas Pakulat
apaku at gmx.de
Sun Aug 24 01:18:52 UTC 2008
SVN commit 851566 by apaku:
Implement a proxy selection model. This is needed because the public selection
model available in the project controller works on the projectmodel, while the
project treeview uses a proxymodel. So we need a ProxySelectionModel which
manages signals from the treeview to the public selection model and vice versa
and does the needed index conversions.
If anybody knows a better way of doing this, let me know and I'll happily
remove this class again.
CCMAIL:kdevelop-devel at kdevelop.org
M +1 -0 CMakeLists.txt
M +2 -1 projectmanagerview.cpp
A proxyselectionmodel.cpp [License: LGPL (v2+)]
A proxyselectionmodel.h [License: LGPL (v2+)]
--- trunk/KDE/kdevplatform/plugins/projectmanagerview/CMakeLists.txt #851565:851566
@@ -10,6 +10,7 @@
projectbuildsetwidget.cpp
projectbuildsetmodel.cpp
projectproxymodel.cpp
+ proxyselectionmodel.cpp
)
kde4_add_ui_files( kdevprojectmanagerview_PLUGIN_SRCS projectbuildsetwidget.ui )
--- trunk/KDE/kdevplatform/plugins/projectmanagerview/projectmanagerview.cpp #851565:851566
@@ -54,6 +54,7 @@
#include "projectbuildsetwidget.h"
#include "projectmanagerviewplugin.h"
#include "projecttreeview.h"
+#include "proxyselectionmodel.h"
using namespace KDevelop;
@@ -154,7 +155,7 @@
d->m_projectOverview->setModel( d->m_modelFilter );
d->m_projectOverview->setSortingEnabled(true);
d->m_projectOverview->sortByColumn( 0, Qt::AscendingOrder );
- d->m_projectOverview->setSelectionModel( ICore::self()->projectController()->projectSelectionModel() );
+ d->m_projectOverview->setSelectionModel( new ProxySelectionModel( d->m_projectOverview, ICore::self()->projectController()->projectSelectionModel(), this ) );
// d->m_projectOverview->setModel( overviewModel );c
setWindowIcon( SmallIcon( "kdevelop" ) ); //FIXME
setWindowTitle( i18n( "Project Manager" ) );
More information about the KDevelop-devel
mailing list