summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MultiMC.cpp3
-rw-r--r--gui/settingsdialog.cpp22
2 files changed, 17 insertions, 8 deletions
diff --git a/MultiMC.cpp b/MultiMC.cpp
index 4e2a5b0b..e425aa44 100644
--- a/MultiMC.cpp
+++ b/MultiMC.cpp
@@ -149,6 +149,9 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
// init the http meta cache
initHttpMetaCache();
+ // set up a basic autodetected proxy (system default)
+ QNetworkProxyFactory::setUseSystemConfiguration(true);
+
// create the global network manager
m_qnam.reset(new QNetworkAccessManager(this));
diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp
index fb204d10..f961a7de 100644
--- a/gui/settingsdialog.cpp
+++ b/gui/settingsdialog.cpp
@@ -67,21 +67,27 @@ void SettingsDialog::on_instDirBrowseBtn_clicked()
void SettingsDialog::on_modsDirBrowseBtn_clicked()
{
- QString dir = QFileDialog::getExistingDirectory(this, tr("Mods Directory"),
- ui->modsDirTextBox->text());
- if (!dir.isEmpty())
+ QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Mods Directory"),
+ ui->modsDirTextBox->text());
+ QString cooked_dir = NormalizePath(raw_dir);
+
+ // do not allow current dir - it's dirty. Do not allow dirs that don't exist
+ if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists())
{
- ui->modsDirTextBox->setText(dir);
+ ui->modsDirTextBox->setText(cooked_dir);
}
}
void SettingsDialog::on_lwjglDirBrowseBtn_clicked()
{
- QString dir = QFileDialog::getExistingDirectory(this, tr("LWJGL Directory"),
- ui->lwjglDirTextBox->text());
- if (!dir.isEmpty())
+ QString raw_dir = QFileDialog::getExistingDirectory(this, tr("LWJGL Directory"),
+ ui->lwjglDirTextBox->text());
+ QString cooked_dir = NormalizePath(raw_dir);
+
+ // do not allow current dir - it's dirty. Do not allow dirs that don't exist
+ if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists())
{
- ui->lwjglDirTextBox->setText(dir);
+ ui->lwjglDirTextBox->setText(cooked_dir);
}
}