[PATCH 4/4] kernel-shark: Configuration file directory to be created by the executable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The build process should not make the directory that will contain
KernelShark configuration files. This directory should be made by
the application itself.

Suggested-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
Signed-off-by: Yordan Karadzhov <ykaradzhov@xxxxxxxxxx>
---
 kernel-shark/CMakeLists.txt       | 2 --
 kernel-shark/src/KsMainWindow.cpp | 3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel-shark/CMakeLists.txt b/kernel-shark/CMakeLists.txt
index 14d73f5..c6a4abf 100644
--- a/kernel-shark/CMakeLists.txt
+++ b/kernel-shark/CMakeLists.txt
@@ -17,8 +17,6 @@ set(KS_DIR ${CMAKE_SOURCE_DIR})
 set(_KS_CACHE_DIR "$ENV{HOME}/.cache/kernelshark"
     CACHE STRING "Directory for cached configuration files.")
 
-file(MAKE_DIRECTORY ${_KS_CACHE_DIR})
-
 include(${KS_DIR}/build/FindTraceCmd.cmake)
 include(${KS_DIR}/build/FindJSONC.cmake)
 
diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
index 39b06d6..898e598 100644
--- a/kernel-shark/src/KsMainWindow.cpp
+++ b/kernel-shark/src/KsMainWindow.cpp
@@ -127,6 +127,9 @@ KsMainWindow::KsMainWindow(QWidget *parent)
 		this,		&KsMainWindow::_deselectB);
 
 	_resizeEmpty();
+
+	if (!QDir(KS_CACHE_DIR).exists())
+		QDir().mkdir(KS_CACHE_DIR);
 }
 
 /** Destroy KernelShark Main window. */
-- 
2.19.1




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux