mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
fix(PackProfile): don't reset dirty if component list saving failed
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
9776fb8d68
commit
c6072ff434
2 changed files with 9 additions and 6 deletions
|
|
@ -167,6 +167,7 @@ static bool savePackProfile(const QString& filename, const ComponentContainer& c
|
||||||
}
|
}
|
||||||
if (!outFile.commit()) {
|
if (!outFile.commit()) {
|
||||||
qCCritical(instanceProfileC) << "Couldn't save" << outFile.fileName() << "because:" << outFile.errorString();
|
qCCritical(instanceProfileC) << "Couldn't save" << outFile.fileName() << "because:" << outFile.errorString();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -229,9 +230,8 @@ static PackProfile::Result loadPackProfile(PackProfile* parent,
|
||||||
|
|
||||||
void PackProfile::saveNow()
|
void PackProfile::saveNow()
|
||||||
{
|
{
|
||||||
if (saveIsScheduled()) {
|
if (saveIsScheduled() && save_internal()) {
|
||||||
d->m_saveTimer.stop();
|
d->m_saveTimer.stop();
|
||||||
save_internal();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -279,12 +279,15 @@ QString PackProfile::patchFilePathForUid(const QString& uid) const
|
||||||
return patchesPattern().arg(uid);
|
return patchesPattern().arg(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackProfile::save_internal()
|
bool PackProfile::save_internal()
|
||||||
{
|
{
|
||||||
qDebug() << d->m_instance->name() << "|" << "Component list save performed now";
|
qDebug() << d->m_instance->name() << "|" << "Component list save performed now";
|
||||||
auto filename = componentsFilePath();
|
auto filename = componentsFilePath();
|
||||||
savePackProfile(filename, d->components);
|
if (savePackProfile(filename, d->components)) {
|
||||||
d->dirty = false;
|
d->dirty = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PackProfile::Result PackProfile::load()
|
PackProfile::Result PackProfile::load()
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ class PackProfile : public QAbstractListModel {
|
||||||
QString patchesPattern() const;
|
QString patchesPattern() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void save_internal();
|
bool save_internal();
|
||||||
void updateSucceeded();
|
void updateSucceeded();
|
||||||
void updateFailed(const QString& error);
|
void updateFailed(const QString& error);
|
||||||
void componentDataChanged();
|
void componentDataChanged();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue