comparison src/mainwindow.cpp @ 553:9c8147c9f245

Fix #354, Remote repo URL should be cleared when starting a new local project
author Chris Cannam
date Fri, 17 Feb 2012 10:58:41 +0000
parents 7663c1c19d47
children 930462068dcc
comparison
equal deleted inserted replaced
552:7663c1c19d47 553:9c8147c9f245
280 QSettings s(hgrc.canonicalFilePath(), QSettings::IniFormat); 280 QSettings s(hgrc.canonicalFilePath(), QSettings::IniFormat);
281 s.beginGroup("paths"); 281 s.beginGroup("paths");
282 path = s.value("default").toString(); 282 path = s.value("default").toString();
283 } 283 }
284 284
285 std::cerr << "hgQueryPaths: setting m_remoteRepoPath to " << m_remoteRepoPath << " from file " << hgrc.absoluteFilePath() << std::endl;
286
285 m_remoteRepoPath = path; 287 m_remoteRepoPath = path;
286 288
287 // We have to do this here, because commandCompleted won't be called 289 // We have to do this here, because commandCompleted won't be called
288 MultiChoiceDialog::addRecentArgument("local", m_workFolderPath); 290 MultiChoiceDialog::addRecentArgument("local", m_workFolderPath);
289 MultiChoiceDialog::addRecentArgument("remote", m_remoteRepoPath); 291 MultiChoiceDialog::addRecentArgument("remote", m_remoteRepoPath);
1482 } 1484 }
1483 1485
1484 d->addChoice("remote", 1486 d->addChoice("remote",
1485 tr("<qt><center><img src=\":images/browser-64.png\"><br>Remote repository</center></qt>"), 1487 tr("<qt><center><img src=\":images/browser-64.png\"><br>Remote repository</center></qt>"),
1486 explanation, 1488 explanation,
1487 MultiChoiceDialog::UrlArg); 1489 MultiChoiceDialog::UrlArg,
1490 true); // default empty
1488 1491
1489 if (d->exec() == QDialog::Accepted) { 1492 if (d->exec() == QDialog::Accepted) {
1490 1493
1491 // New block to ensure QSettings is deleted before 1494 // New block to ensure QSettings is deleted before
1492 // hgQueryPaths called. NB use of absoluteFilePath instead of 1495 // hgQueryPaths called. NB use of absoluteFilePath instead of
3081 { 3084 {
3082 QDir workFolder; 3085 QDir workFolder;
3083 3086
3084 QSettings settings; 3087 QSettings settings;
3085 3088
3086 m_remoteRepoPath = settings.value("remoterepopath", "").toString();
3087 m_workFolderPath = settings.value("workfolderpath", "").toString(); 3089 m_workFolderPath = settings.value("workfolderpath", "").toString();
3088 if (!workFolder.exists(m_workFolderPath)) 3090 if (!workFolder.exists(m_workFolderPath)) {
3089 {
3090 m_workFolderPath = ""; 3091 m_workFolderPath = "";
3091 } 3092 }
3092 3093
3093 QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); 3094 QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
3094 QSize size = settings.value("size", QSize(550, 550)).toSize(); 3095 QSize size = settings.value("size", QSize(550, 550)).toSize();