Skip to content

Commit

Permalink
[GRASS] removed multiple input sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Sep 10, 2015
1 parent a44bfb2 commit 3d7b6fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 5 additions & 7 deletions src/plugins/grass/qgsgrassmoduleinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,8 @@ QgsGrassModuleInputComboBox::QgsGrassModuleInputComboBox( QgsGrassObject::Type t
QCompleter *completer = new QgsGrassModuleInputCompleter( completerProxy, this );
completer->setCompletionRole( Qt::DisplayRole );
completer->setCaseSensitivity( Qt::CaseInsensitive );
// TODO: enable when Qt version requirement gets over 5.2
//setFilterMode( Qt::MatchWildcard );
completer->setCompletionMode( QCompleter::PopupCompletion );
completer->setMaxVisibleItems( 20 );
// TODO: set custom treeview for completer popup to show items in tree structure, if feasible
Expand Down Expand Up @@ -636,7 +638,6 @@ QgsGrassModuleInput::QgsGrassModuleInput( QgsGrassModule *module,
, mModuleStandardOptions( options )
, mModel( 0 )
, mSelectedModel( 0 )
, mSelectedProxy( 0 )
, mComboBox( 0 )
, mRegionButton( 0 )
, mLayerLabel( 0 )
Expand Down Expand Up @@ -792,10 +793,8 @@ QgsGrassModuleInput::QgsGrassModuleInput( QgsGrassModule *module,
if ( multiple() )
{
mSelectedModel = new QStandardItemModel( 0, 2 );
mSelectedProxy = new QSortFilterProxyModel( this );
mSelectedProxy->setSourceModel( mSelectedModel );
mSelectedTreeView = new QgsGrassModuleInputSelectedView( this );
mSelectedTreeView->setModel( mSelectedProxy );
mSelectedTreeView->setModel( mSelectedModel );
connect( mSelectedTreeView, SIGNAL( deleteItem( const QModelIndex & ) ), this, SLOT( deleteSelectedItem( const QModelIndex & ) ) );
layout->addWidget( mSelectedTreeView );
}
Expand Down Expand Up @@ -1154,10 +1153,9 @@ void QgsGrassModuleInput::onActivated( const QString & text )
void QgsGrassModuleInput::deleteSelectedItem( const QModelIndex &index )
{
QgsDebugMsg( "entered" );
QModelIndex sourceIndex = mSelectedProxy->mapToSource( index );
if ( sourceIndex.isValid() )
if ( index.isValid() )
{
mSelectedModel->removeRow( sourceIndex.row() );
mSelectedModel->removeRow( index.row() );
emit valueChanged();
}
}
2 changes: 0 additions & 2 deletions src/plugins/grass/qgsgrassmoduleinput.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,6 @@ class QgsGrassModuleInput : public QgsGrassModuleGroupBoxItem
//! Model containing currently selected maps
QStandardItemModel *mSelectedModel;

QSortFilterProxyModel *mSelectedProxy;

//! Combo box with GRASS layers
QgsGrassModuleInputComboBox *mComboBox;

Expand Down

0 comments on commit 3d7b6fb

Please sign in to comment.