From 04d17b7a05a094f08106fdd2490dfc7b49def19d Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Tue, 5 Aug 2014 15:16:25 +0200 Subject: [PATCH] Save the last directoy where we loaded a tilebank from. --HG-- branch : gsoc2014-dfighter --- .../src/plugins/tile_editor/tile_editor_main_window.cpp | 5 ++++- .../studio/src/plugins/tile_editor/tile_editor_main_window.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) 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 0341502d5..62aea3fcb 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 @@ -264,7 +264,7 @@ void TileEditorMainWindow::open() { QString fn = QFileDialog::getOpenFileName( this, tr( "Loading tilebank" ), - "", + m_lastOpenDir, tr( "tilebank files (*.tilebank)" ) ); if( fn.isEmpty() ) @@ -284,6 +284,9 @@ void TileEditorMainWindow::open() onTileBankLoaded(); m_fileName = fn; + + int idx = fn.lastIndexOf( '/' ); + m_lastOpenDir = fn.left( idx ); } void TileEditorMainWindow::onZoomFactor(int level) diff --git a/code/studio/src/plugins/tile_editor/tile_editor_main_window.h b/code/studio/src/plugins/tile_editor/tile_editor_main_window.h index c9b96928c..550c6bb75 100644 --- a/code/studio/src/plugins/tile_editor/tile_editor_main_window.h +++ b/code/studio/src/plugins/tile_editor/tile_editor_main_window.h @@ -122,6 +122,7 @@ private: }; QString m_fileName; + QString m_lastOpenDir; }; #endif // TILE_EDITOR_MAIN_WINDOW_H