SnapshotSettings::SnapshotSettings(QWidget *parent) : QWidget(parent) {
QBoxLayout *layout = new QHBoxLayout(this);
SnapshotSettings::SnapshotSettings(QWidget *parent) : QWidget(parent) {
QBoxLayout *layout = new QHBoxLayout(this);
QSettings settings;
QString location = settings.value("snapshotsFolder").toString();
if (location.isEmpty() || !QFile::exists(location)) {
QSettings settings;
QString location = settings.value("snapshotsFolder").toString();
if (location.isEmpty() || !QFile::exists(location)) {
-#if QT_VERSION >= 0x050000
- location = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
-#else
- location = QDesktopServices::storageLocation(QDesktopServices::PicturesLocation);
-#endif
+ location = Paths::getPicturesLocation();
-#if QT_VERSION >= 0x050000
- QString home = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
-#else
- QString home = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
-#endif
+ const QString home = Paths::getHomeLocation();
QString displayPath = path;
displayPath = displayPath.remove(home + "/");
return displayPath;
}
void SnapshotSettings::changeFolder() {
QString displayPath = path;
displayPath = displayPath.remove(home + "/");
return displayPath;
}
void SnapshotSettings::changeFolder() {
#ifdef APP_MAC
QFileDialog* dialog = new QFileDialog(this);
dialog->setFileMode(QFileDialog::Directory);
dialog->setOptions(QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | QFileDialog::ReadOnly);
#ifdef APP_MAC
QFileDialog* dialog = new QFileDialog(this);
dialog->setFileMode(QFileDialog::Directory);
dialog->setOptions(QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | QFileDialog::ReadOnly);
dialog->setDirectory(path);
dialog->open(this, SLOT(folderChosen(const QString &)));
#else
dialog->setDirectory(path);
dialog->open(this, SLOT(folderChosen(const QString &)));
#else
QString folder = QFileDialog::getExistingDirectory(window(), QString(),
path,
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | QFileDialog::ReadOnly);
QString folder = QFileDialog::getExistingDirectory(window(), QString(),
path,
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | QFileDialog::ReadOnly);