From 2993c88a5d3b6056f894149305805142340ccf23 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 24 Jul 2014 18:44:00 +0200 Subject: [PATCH] When selecting another land, select the first tile set, if it exists. --HG-- branch : gsoc2014-dfighter --- .../src/plugins/tile_editor/tile_editor_main_window.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/studio/src/plugins/tile_editor/tile_editor_main_window.cpp b/code/studio/src/plugins/tile_editor/tile_editor_main_window.cpp index dbd9d6407..5e3127d51 100644 --- a/code/studio/src/plugins/tile_editor/tile_editor_main_window.cpp +++ b/code/studio/src/plugins/tile_editor/tile_editor_main_window.cpp @@ -445,6 +445,12 @@ void TileEditorMainWindow::onLandRowChanged( int row ) connect( m_ui->tileSetLV->selectionModel(), SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ), this, SLOT( changeActiveTileSet( const QModelIndex &, const QModelIndex & ) ) ); + + if( m_ui->tileSetLV->model()->rowCount() != 0 ) + { + QModelIndex idx = m_ui->tileSetLV->model()->index( 0, 0 ); + m_ui->tileSetLV->setCurrentIndex( idx ); + } } m_ui->tileSetLV->reset();