KDE/kdevplatform/plugins/quickopen
Andreas Pakulat
apaku at gmx.de
Mon Apr 14 12:39:02 UTC 2008
SVN commit 796858 by apaku:
Remember the selection of Scope between invocations of the quickopen widget.
Maybe this should be stored in config?
CCMAIL:kdevelop-devel at kdevelop.org
M +8 -1 quickopenplugin.cpp
M +7 -1 quickopenplugin.h
--- trunk/KDE/kdevplatform/plugins/quickopen/quickopenplugin.cpp #796857:796858
@@ -242,6 +242,7 @@
}
}
+ emit scopesChanged( checkedScopes );
m_model->enableProviders( checkedItems, checkedScopes );
}
@@ -479,10 +480,16 @@
if( modes & Classes )
initialItems << i18n("Classes");
- new QuickOpenWidgetHandler( d, m_model, initialItems, QStringList() );
+ QuickOpenWidgetHandler* handler = new QuickOpenWidgetHandler( d, m_model, initialItems, lastUsedScopes );
+ connect( handler, SIGNAL( scopesChanged( const QStringList& ) ), this, SLOT( storeScopes( const QStringList& ) ) );
}
+void QuickOpenPlugin::storeScopes( const QStringList& scopes )
+{
+ lastUsedScopes = scopes;
+}
+
void QuickOpenPlugin::quickOpen()
{
if(!modelIsFree())
--- trunk/KDE/kdevplatform/plugins/quickopen/quickopenplugin.h #796857:796858
@@ -75,6 +75,8 @@
void quickOpenDefinition();
void quickOpenNavigate();
void quickOpenNavigateFunctions();
+private slots:
+ void storeScopes( const QStringList& );
private:
//Whether the model is free for use. Else we cannot create a quickopen-widget.
bool modelIsFree() const;
@@ -86,6 +88,7 @@
QuickOpenModel* m_model;
class ProjectFileDataProvider* m_projectFileData;
class ProjectItemDataProvider* m_projectItemData;
+ QStringList lastUsedScopes;
};
class QuickOpenWidgetHandler : public QObject {
@@ -99,7 +102,10 @@
* */
QuickOpenWidgetHandler( QDialog* d, QuickOpenModel* model, const QStringList& initialItems, const QStringList& initialScopes, bool listOnly = false, bool noSearchField = false );
~QuickOpenWidgetHandler();
-
+
+ signals:
+ void scopesChanged( const QStringList& scopes );
+
private slots:
void currentChanged( const QModelIndex& current, const QModelIndex& previous );
void accept();
More information about the KDevelop-devel
mailing list