From cb3ed6c436c2281a055c98b3b0610b6efa88a5d5 Mon Sep 17 00:00:00 2001 From: Martin Kampas Date: Sat, 5 Nov 2016 08:14:57 +0100 Subject: Bench: Activate root path when workspace is opened Change-Id: Ibef1d4293b71ff9d0ce0155ed2937fce662bbfd9 Reviewed-by: Juergen Bocklage-Ryannel --- src/bench/main.cpp | 2 +- src/bench/mainwindow.cpp | 6 ++++-- src/bench/mainwindow.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bench/main.cpp b/src/bench/main.cpp index 108946f..395d48b 100644 --- a/src/bench/main.cpp +++ b/src/bench/main.cpp @@ -383,7 +383,7 @@ void MasterApplication::listenForArguments() void MasterApplication::applyOptions(const Options &options) { if (!options.workspace().isEmpty()) - m_window->setWorkspace(QDir(options.workspace()).absolutePath()); + m_window->setWorkspace(QDir(options.workspace()).absolutePath(), false); if (!options.pluginPath().isEmpty()) { if (!m_window->isInitialized()) diff --git a/src/bench/mainwindow.cpp b/src/bench/mainwindow.cpp index 567e215..6e3c17b 100644 --- a/src/bench/mainwindow.cpp +++ b/src/bench/mainwindow.cpp @@ -216,7 +216,7 @@ void MainWindow::init() restoreGeometry(s.value("geometry").toByteArray()); //Only set the workspace if we didn't already set it by command line if (m_workspacePath.isEmpty()) { - setWorkspace(s.value("workspace", QDir::currentPath()).toString()); + setWorkspace(s.value("workspace", QDir::currentPath()).toString(), false); } if (s.value("http_proxy/enabled").toBool()) { @@ -338,13 +338,15 @@ void MainWindow::slowDownAnimations(bool enable) } -void MainWindow::setWorkspace(const QString& path) +void MainWindow::setWorkspace(const QString& path, bool activateRootPath) { m_workspacePath = path; m_workspace->setRootPath(path); m_node->setWorkspace(path); m_hub->setWorkspace(path); m_allHosts->setWorkspace(path); + if (activateRootPath) + m_workspace->activateRootPath(); updateRecentFolder(path); } diff --git a/src/bench/mainwindow.h b/src/bench/mainwindow.h index f410121..87e65a8 100644 --- a/src/bench/mainwindow.h +++ b/src/bench/mainwindow.h @@ -58,7 +58,7 @@ public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); void activateDocument(const QString path); - void setWorkspace(const QString& path); + void setWorkspace(const QString& path, bool activateRootPath = true); void setPluginPath(const QString& path); void setImportPaths(const QStringList& pathList); void setStaysOnTop(bool enabled); -- cgit v1.2.3