Skip to content

Commit

Permalink
[Plugin Manager] Small cleanups: don't connect redundant signal, remo…
Browse files Browse the repository at this point in the history
…ve unused condition.
  • Loading branch information
borysiasty committed Oct 17, 2018
1 parent 9254e49 commit 57faed4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
19 changes: 0 additions & 19 deletions src/app/pluginmanager/qgspluginmanager.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/app/pluginmanager/qgspluginmanager.h
Expand Up @@ -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 );

Expand Down

0 comments on commit 57faed4

Please sign in to comment.