mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-05 21:06:58 +03:00
remove InstanceName
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
f67a670bcf
commit
3338db3f28
8 changed files with 95 additions and 110 deletions
|
|
@ -955,7 +955,7 @@ class InstanceStaging : public Task {
|
|||
void childSucceeded()
|
||||
{
|
||||
unsigned sleepTime = backoff();
|
||||
if (m_parent->commitStagedInstance(m_stagingPath, *m_child, m_child->group(), *m_child)) {
|
||||
if (m_parent->commitStagedInstance(m_stagingPath, *m_child, m_child->group())) {
|
||||
m_backoffTimer.stop();
|
||||
emitSucceeded();
|
||||
return;
|
||||
|
|
@ -972,14 +972,14 @@ class InstanceStaging : public Task {
|
|||
void childFailed(const QString& reason)
|
||||
{
|
||||
m_backoffTimer.stop();
|
||||
m_parent->destroyStagingPath(m_stagingPath);
|
||||
FS::deletePath(m_stagingPath);
|
||||
emitFailed(reason);
|
||||
}
|
||||
|
||||
void childAborted()
|
||||
{
|
||||
m_backoffTimer.stop();
|
||||
m_parent->destroyStagingPath(m_stagingPath);
|
||||
FS::deletePath(m_stagingPath);
|
||||
emitAborted();
|
||||
}
|
||||
|
||||
|
|
@ -1024,22 +1024,20 @@ QString InstanceList::getStagedInstancePath()
|
|||
return result;
|
||||
}
|
||||
|
||||
bool InstanceList::commitStagedInstance(const QString& path,
|
||||
const InstanceName& instanceName,
|
||||
QString groupName,
|
||||
const InstanceTask& commiting)
|
||||
bool InstanceList::commitStagedInstance(const QString& path, const InstanceTask& instanceTask, QString groupName)
|
||||
{
|
||||
if (groupName.isEmpty() && !groupName.isNull())
|
||||
if (groupName.isEmpty() && !groupName.isNull()) {
|
||||
groupName = QString();
|
||||
}
|
||||
|
||||
QString instID;
|
||||
|
||||
auto should_override = commiting.shouldOverride();
|
||||
auto shouldOverride = instanceTask.shouldOverride();
|
||||
|
||||
if (should_override) {
|
||||
instID = commiting.originalInstanceID();
|
||||
if (shouldOverride) {
|
||||
instID = instanceTask.originalInstanceID();
|
||||
} else {
|
||||
instID = FS::DirNameFromString(instanceName.modifiedName(), m_instDir);
|
||||
instID = FS::DirNameFromString(instanceTask.modifiedName(), m_instDir);
|
||||
}
|
||||
|
||||
Q_ASSERT(!instID.isEmpty());
|
||||
|
|
@ -1048,7 +1046,7 @@ bool InstanceList::commitStagedInstance(const QString& path,
|
|||
WatchLock lock(m_watcher, m_instDir);
|
||||
QString destination = FS::PathCombine(m_instDir, instID);
|
||||
|
||||
if (should_override) {
|
||||
if (shouldOverride) {
|
||||
if (!FS::overrideFolder(destination, path)) {
|
||||
qWarning() << "Failed to override" << path << "to" << destination;
|
||||
return false;
|
||||
|
|
@ -1073,11 +1071,6 @@ bool InstanceList::commitStagedInstance(const QString& path,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool InstanceList::destroyStagingPath(const QString& keyPath)
|
||||
{
|
||||
return FS::deletePath(keyPath);
|
||||
}
|
||||
|
||||
int InstanceList::getTotalPlayTime()
|
||||
{
|
||||
updateTotalPlayTime();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue