Skip to content
Permalink
Browse files

[Plugin Manager] Small cleanups: don't connect redundant signal, remo…

…ve unused condition.
  • Loading branch information
borysiasty committed Oct 17, 2018
1 parent 9254e49 commit 57faed4c77be9884aa014266b07e57c40842286a
Showing with 0 additions and 22 deletions.
  1. +0 −19 src/app/pluginmanager/qgspluginmanager.cpp
  2. +0 −3 src/app/pluginmanager/qgspluginmanager.h
@@ -68,7 +68,6 @@ QgsPluginManager::QgsPluginManager( QWidget *parent, bool pluginsAreEnabled, Qt:
mPythonUtils = nullptr;

setupUi( this );
connect( vwPlugins, &QListView::clicked, this, &QgsPluginManager::vwPlugins_clicked );
connect( vwPlugins, &QListView::doubleClicked, this, &QgsPluginManager::vwPlugins_doubleClicked );
connect( wvDetails, &QgsWebView::linkClicked, this, &QgsPluginManager::wvDetails_linkClicked );
connect( leFilter, &QgsFilterLineEdit::textChanged, this, &QgsPluginManager::leFilter_textChanged );
@@ -1241,31 +1240,13 @@ void QgsPluginManager::setCurrentTab( int idx )


void QgsPluginManager::currentPluginChanged( const QModelIndex &index )
{
if ( index.column() == 0 )
{
// Do exactly the same as if a plugin was clicked
vwPlugins_clicked( index );
}
}



void QgsPluginManager::vwPlugins_clicked( const QModelIndex &index )
{
if ( index.column() == 0 )
{
// If the model has been filtered, the index row in the proxy won't match the index row in the underlying model
// so we need to jump through this little hoop to get the correct item
QModelIndex realIndex = mModelProxy->mapToSource( index );
QStandardItem *mypItem = mModelPlugins->itemFromIndex( realIndex );
if ( !mypItem->isEnabled() )
{
//The item is inactive (uncompatible or broken plugin), so it can't be selected. Display it's data anyway.
vwPlugins->clearSelection();
}
// Display details in any case: selection changed, inactive button clicked,
// or previously selected plugin clicked (while details view contains the welcome message for a category)
showPluginDetails( mypItem );
}
}
@@ -111,9 +111,6 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag
//! Load/unload plugin when checkbox state changed
void pluginItemChanged( QStandardItem *item );

//! Display details of inactive item too
void vwPlugins_clicked( const QModelIndex &index );

//! Load/unload plugin by double-click
void vwPlugins_doubleClicked( const QModelIndex &index );

0 comments on commit 57faed4

Please sign in to comment.
You can’t perform that action at this time.