# HG changeset patch
# User Chris Cannam
# Date 1329476321 0
# Node ID 9c8147c9f245e74569efa8c77984e76f88f2ac0e
# Parent 7663c1c19d47d59ad58ce848c3d20e6881bfb68b
Fix #354, Remote repo URL should be cleared when starting a new local project
diff -r 7663c1c19d47 -r 9c8147c9f245 src/mainwindow.cpp
--- a/src/mainwindow.cpp Thu Feb 16 14:30:46 2012 +0000
+++ b/src/mainwindow.cpp Fri Feb 17 10:58:41 2012 +0000
@@ -282,6 +282,8 @@
path = s.value("default").toString();
}
+ std::cerr << "hgQueryPaths: setting m_remoteRepoPath to " << m_remoteRepoPath << " from file " << hgrc.absoluteFilePath() << std::endl;
+
m_remoteRepoPath = path;
// We have to do this here, because commandCompleted won't be called
@@ -1484,7 +1486,8 @@
d->addChoice("remote",
tr("
Remote repository"),
explanation,
- MultiChoiceDialog::UrlArg);
+ MultiChoiceDialog::UrlArg,
+ true); // default empty
if (d->exec() == QDialog::Accepted) {
@@ -3083,10 +3086,8 @@
QSettings settings;
- m_remoteRepoPath = settings.value("remoterepopath", "").toString();
m_workFolderPath = settings.value("workfolderpath", "").toString();
- if (!workFolder.exists(m_workFolderPath))
- {
+ if (!workFolder.exists(m_workFolderPath)) {
m_workFolderPath = "";
}
diff -r 7663c1c19d47 -r 9c8147c9f245 src/multichoicedialog.cpp
--- a/src/multichoicedialog.cpp Thu Feb 16 14:30:46 2012 +0000
+++ b/src/multichoicedialog.cpp Fri Feb 17 10:58:41 2012 +0000
@@ -136,13 +136,15 @@
void
MultiChoiceDialog::addChoice(QString id, QString text,
- QString description, ArgType arg)
+ QString description, ArgType arg,
+ bool defaultEmpty)
{
bool first = (m_texts.empty());
m_texts[id] = text;
m_descriptions[id] = description;
m_argTypes[id] = arg;
+ m_defaultEmpty[id] = defaultEmpty;
if (arg != NoArg) {
m_recentFiles[id] = QSharedPointer
@@ -326,6 +328,7 @@
m_fileLabel->show();
m_fileCombo->show();
m_fileCombo->addItems(rf->getRecent());
+ if (m_defaultEmpty[id]) m_fileCombo->lineEdit()->setText("");
m_browseButton->show();
break;
@@ -334,6 +337,7 @@
m_fileLabel->show();
m_fileCombo->show();
m_fileCombo->addItems(rf->getRecent());
+ if (m_defaultEmpty[id]) m_fileCombo->lineEdit()->setText("");
m_browseButton->show();
break;
@@ -341,12 +345,14 @@
m_urlLabel->show();
m_urlCombo->show();
m_urlCombo->addItems(rf->getRecent());
+ if (m_defaultEmpty[id]) m_urlCombo->lineEdit()->setText("");
break;
case UrlToDirectoryArg:
m_urlLabel->show();
m_urlCombo->show();
m_urlCombo->addItems(rf->getRecent());
+ if (m_defaultEmpty[id]) m_urlCombo->lineEdit()->setText("");
m_fileLabel->setText(tr("&Folder:"));
m_fileLabel->show();
m_fileCombo->show();
diff -r 7663c1c19d47 -r 9c8147c9f245 src/multichoicedialog.h
--- a/src/multichoicedialog.h Thu Feb 16 14:30:46 2012 +0000
+++ b/src/multichoicedialog.h Fri Feb 17 10:58:41 2012 +0000
@@ -48,7 +48,8 @@
};
void addChoice(QString identifier, QString text,
- QString description, ArgType arg);
+ QString description, ArgType arg,
+ bool defaultEmpty = false);
void setCurrentChoice(QString);
QString getCurrentChoice();
@@ -71,6 +72,7 @@
QMap m_texts;
QMap m_descriptions;
QMap m_argTypes;
+ QMap m_defaultEmpty;
QMap > m_recentFiles;
QString m_currentChoice;