forked from qt-creator/qt-creator
Gerrit: Fix writing .netrc configuration file
The file is expected in the home directory, but was written in the current working directory. Change-Id: I4c91f8d706a26331c6b6c878d38ac3556f3ca9b7 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
45a84ea6b5
commit
1c36a6b274
@@ -73,7 +73,8 @@ AuthenticationDialog::AuthenticationDialog(GerritServer *server) :
|
||||
ui->descriptionLabel->setOpenExternalLinks(true);
|
||||
ui->serverLineEdit->setText(server->host);
|
||||
ui->userLineEdit->setText(server->user.userName);
|
||||
m_netrcFileName = QLatin1String(Utils::HostOsInfo::isWindowsHost() ? "_netrc" : ".netrc");
|
||||
m_netrcFileName = QDir::homePath() + '/' +
|
||||
QLatin1String(Utils::HostOsInfo::isWindowsHost() ? "_netrc" : ".netrc");
|
||||
readExistingConf();
|
||||
|
||||
QPushButton *anonymous = ui->buttonBox->addButton(tr("Anonymous"), QDialogButtonBox::AcceptRole);
|
||||
@@ -98,7 +99,7 @@ AuthenticationDialog::~AuthenticationDialog()
|
||||
|
||||
void AuthenticationDialog::readExistingConf()
|
||||
{
|
||||
QFile netrcFile(QDir::homePath() + '/' + m_netrcFileName);
|
||||
QFile netrcFile(m_netrcFileName);
|
||||
if (!netrcFile.open(QFile::ReadOnly | QFile::Text))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user