}
void DownloadSettings::changeFolder() {
-
+ const QString path = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
#ifdef APP_MAC
QFileDialog* dialog = new QFileDialog(this);
dialog->setFileMode(QFileDialog::Directory);
dialog->setOptions(QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | QFileDialog::ReadOnly);
- dialog->setDirectory(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
+ dialog->setDirectory(path);
dialog->open(this, SLOT(folderChosen(const QString &)));
#else
+
QString folder = QFileDialog::getExistingDirectory(window(), tr("Choose the download location"),
- QDesktopServices::storageLocation(QDesktopServices::HomeLocation),
- QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | QFileDialog::ReadOnly);
+ path,
+ QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | QFileDialog::ReadOnly);
folderChosen(folder);
#endif
}
}
void DownloadSettings::updateMessage() {
- QString path = DownloadManager::instance()->currentDownloadFolder();
- QString home = QDesktopServices::storageLocation(QDesktopServices::HomeLocation) + "/";
+ const QString path = DownloadManager::instance()->currentDownloadFolder();
+ const QString home = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
QString displayPath = path;
- displayPath = displayPath.remove(home);
+ displayPath = displayPath.remove(home + "/");
message->setText(
- tr("Downloading to: %1")
- .arg("<a href='file://%1' style='text-decoration:none; color:palette(text); font-weight:bold'>%2</a>")
- .arg(path, displayPath));
+ tr("Downloading to: %1")
+ .arg("<a href='file://%1' style='text-decoration:none; color:palette(text); font-weight:bold'>%2</a>")
+ .arg(path, displayPath));
}