diff src/mainwindow.cpp @ 382:f7dc2c5d8650

Avoid failing on startup if started with no cwd
author Chris Cannam
date Thu, 19 May 2011 09:14:12 +0100
parents ad2e56d1e4c4
children 2925975bdc9e
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()