# HG changeset patch # User Chris Cannam # Date 1305792852 -3600 # Node ID f7dc2c5d86509d2ec46604d939ba23ecb34eef66 # Parent c22a3981c88d03b6aa51d7e0944c9557442363c8 Avoid failing on startup if started with no cwd diff -r c22a3981c88d -r f7dc2c5d8650 src/mainwindow.cpp --- 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()