changeset 382:f7dc2c5d8650

Avoid failing on startup if started with no cwd
author Chris Cannam
date Thu, 19 May 2011 09:14:12 +0100 (2011-05-19)
parents c22a3981c88d
children 1affc7820bef
files src/mainwindow.cpp
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/mainwindow.cpp	Thu May 19 09:13:59 2011 +0100
+++ b/src/mainwindow.cpp	Thu May 19 09:14:12 2011 +0100
@@ -220,14 +220,22 @@
 {
     QStringList params;
     params << "--version";
-    m_runner->requestAction(HgAction(ACT_TEST_HG, m_myDirPath, params));
+    // The path is not necessarily set here, but we need something for
+    // this test or else HgRunner will (cautiously) refuse to run
+    QString path = m_myDirPath;
+    if (path == "") path = QDir::homePath();
+    m_runner->requestAction(HgAction(ACT_TEST_HG, path, params));
 }
 
 void MainWindow::hgTestExtension()
 {
     QStringList params;
     params << "--version";
-    m_runner->requestAction(HgAction(ACT_TEST_HG_EXT, m_myDirPath, params));
+    // The path is not necessarily set here, but we need something for
+    // this test or else HgRunner will (cautiously) refuse to run
+    QString path = m_myDirPath;
+    if (path == "") path = QDir::homePath();
+    m_runner->requestAction(HgAction(ACT_TEST_HG_EXT, path, params));
 }
 
 void MainWindow::hgStat()