fix - reset configuration doesn't reset 'Save path'

(cherry picked from commit aa26cda409b745ed2b585ad393591aa03d4813dd)
This commit is contained in:
Yuriy Puchkov
2021-01-12 19:45:28 +02:00
committed by borgmanJeremy
parent ea5cf3e042
commit c93c91e09f

View File

@@ -151,6 +151,8 @@ void GeneneralConf::resetConfiguration()
tr("Are you sure you want to reset the configuration?"),
QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::Yes) {
m_savePath->setText(
QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
ConfigHandler().setDefaults();
}
}
@@ -280,8 +282,12 @@ void GeneneralConf::initSaveAfterCopy()
QHBoxLayout* pathLayout = new QHBoxLayout();
m_savePath = new QLineEdit(
QStandardPaths::writableLocation(QStandardPaths::PicturesLocation), this);
QString path = ConfigHandler().savePath();
if (path.isEmpty()) {
path =
QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
}
m_savePath = new QLineEdit(path, this);
m_savePath->setDisabled(true);
QString foreground = this->palette().foreground().color().name();
m_savePath->setStyleSheet(QStringLiteral("color: %1").arg(foreground));
@@ -330,8 +336,12 @@ void GeneneralConf::saveAfterCopyChanged(bool checked)
void GeneneralConf::changeSavePath()
{
QString path = chooseFolder(
QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
QString path = ConfigHandler().savePath();
if (path.isEmpty()) {
path =
QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
}
chooseFolder(path);
if (!path.isEmpty()) {
m_savePath->setText(path);
ConfigHandler().setSavePath(path);