}
void DownloadSettings::changeFolder() {
- QString path;
+ 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);
-#if QT_VERSION >= 0x050000
- path = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
-#else
- path = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
-#endif
dialog->setDirectory(path);
dialog->open(this, SLOT(folderChosen(const QString &)));
#else
-#if QT_VERSION >= 0x050000
- path = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
-#else
- path = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
-#endif
QString folder = QFileDialog::getExistingDirectory(window(), tr("Choose the download location"),
path,
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | QFileDialog::ReadOnly);
}
void DownloadSettings::updateMessage() {
- QString path = DownloadManager::instance()->currentDownloadFolder();
-#if QT_VERSION >= 0x050000
- QString home = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
-#else
- QString home = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
-#endif
+ const QString path = DownloadManager::instance()->currentDownloadFolder();
+ const QString home = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
QString displayPath = path;
displayPath = displayPath.remove(home + "/");
message->setText(