@@ -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))
@@ -155,6 +155,8 @@ private:
QString _lastDataFilePath, _lastConfFilePath, _lastPluginFilePath;
+ QSettings _settings;
+
void _open();
void _restoreSession();
The application will remember the used file paths across different executions. Suggested-by: Slavomir Kaslev <kaslevs@vmware.com> Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com> --- kernel-shark/src/KsMainWindow.cpp | 11 ++++++++++- kernel-shark/src/KsMainWindow.hpp | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-)