diff options
author | Martin Kampas <martin.kampas@jolla.com> | 2016-11-05 08:14:57 +0100 |
---|---|---|
committer | Juergen Bocklage-Ryannel <juergen.bocklage-ryannel@pelagicore.com> | 2016-11-22 20:32:23 +0000 |
commit | cb3ed6c436c2281a055c98b3b0610b6efa88a5d5 (patch) | |
tree | 87ed0a58f7d0a5fc48d9c1141950f9f827be351c | |
parent | c185dce5dff9d250fa7c2bd8f32fb0f211992577 (diff) |
Bench: Activate root path when workspace is opened
Change-Id: Ibef1d4293b71ff9d0ce0155ed2937fce662bbfd9
Reviewed-by: Juergen Bocklage-Ryannel <juergen.bocklage-ryannel@pelagicore.com>
-rw-r--r-- | src/bench/main.cpp | 2 | ||||
-rw-r--r-- | src/bench/mainwindow.cpp | 6 | ||||
-rw-r--r-- | 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); |