linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yordan Karadzhov <ykaradzhov@vmware.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org, y.karadz@gmail.com,
	Yordan Karadzhov <ykaradzhov@vmware.com>,
	Slavomir Kaslev <kaslevs@vmware.com>
Subject: [PATCH 5/5] kernel-shark: Remember the paths used by the Open-File dialogs.
Date: Tue, 23 Apr 2019 16:27:41 +0300	[thread overview]
Message-ID: <20190423132741.17864-6-ykaradzhov@vmware.com> (raw)
In-Reply-To: <20190423132741.17864-1-ykaradzhov@vmware.com>

The application 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(-)

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


  parent reply	other threads:[~2019-04-23 13:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23 13:27 [PATCH 0/5] Modifications needed for KS 1.0 Yordan Karadzhov
2019-04-23 13:27 ` [PATCH 1/5] kernel-shark: Add INSTALL PREFIX to the Cmake-generated header file Yordan Karadzhov
2019-04-23 13:27 ` [PATCH 2/5] kernel-shark: Add logic for the initial path of Open-File dialogs Yordan Karadzhov
2019-04-23 13:27 ` [PATCH 3/5] kernel-shark: Add logic for the plugins search path Yordan Karadzhov
2019-04-23 13:27 ` [PATCH 4/5] kernel-shark: Remove the definition of KS_DIR Yordan Karadzhov
2019-04-23 13:27 ` Yordan Karadzhov [this message]
2019-05-02  8:42 ` [PATCH 0/5] Modifications needed for KS 1.0 Slavomir Kaslev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190423132741.17864-6-ykaradzhov@vmware.com \
    --to=ykaradzhov@vmware.com \
    --cc=kaslevs@vmware.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=y.karadz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).