The application remember the used file paths across different executions. Suggested-by: Slavomir Kaslev <kaslevs@xxxxxxxxxx> Signed-off-by: Yordan Karadzhov <ykaradzhov@xxxxxxxxxx> --- kernel-shark/src/KsMainWindow.cpp | 11 ++++++++++- kernel-shark/src/KsMainWindow.hpp | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 748bacd..5f326f5 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -67,7 +67,8 @@ KsMainWindow::KsMainWindow(QWidget *parent) _fullScreenModeAction("Full Screen Mode", this), _aboutAction("About", this), _contentsAction("Contents", this), - _deselectShortcut(this) + _deselectShortcut(this), + _settings("kernelshark.org", "Kernel Shark") // organization , application { setWindowTitle("Kernel Shark"); _createActions(); @@ -126,6 +127,10 @@ KsMainWindow::KsMainWindow(QWidget *parent) connect(&_mState, &KsDualMarkerSM::deselectB, this, &KsMainWindow::_deselectB); + _lastDataFilePath = _settings.value("dataPath").toString(); + _lastConfFilePath = _settings.value("confPath").toString(); + _lastPluginFilePath = _settings.value("pluginPath").toString(); + _resizeEmpty(); } @@ -143,6 +148,10 @@ KsMainWindow::~KsMainWindow() _session.getConfDocPtr()); } + _settings.setValue("dataPath", _lastDataFilePath); + _settings.setValue("confPath", _lastConfFilePath); + _settings.setValue("pluginPath", _lastPluginFilePath); + _data.clear(); if (kshark_instance(&kshark_ctx)) diff --git a/kernel-shark/src/KsMainWindow.hpp b/kernel-shark/src/KsMainWindow.hpp index 2bf3285..962de2d 100644 --- a/kernel-shark/src/KsMainWindow.hpp +++ b/kernel-shark/src/KsMainWindow.hpp @@ -155,6 +155,8 @@ private: QString _lastDataFilePath, _lastConfFilePath, _lastPluginFilePath; + QSettings _settings; + void _open(); void _restoreSession(); -- 2.20.1
![]() |