aboutsummaryrefslogtreecommitdiff
path: root/launcher/InstanceList.h
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2022-09-26 08:25:12 -0300
committerGitHub <noreply@github.com>2022-09-26 08:25:12 -0300
commit370c3aa5985698351e706e61c660a3a566a5f09b (patch)
tree5bd62ceec118396d676cf3799edafdb806e4375d /launcher/InstanceList.h
parent58a5331f7bafb149c18f560a0363daab65521262 (diff)
parentdd6f670dec7dfd1a9ad6f4595ad5447ac735c737 (diff)
downloadPrismLauncher-370c3aa5985698351e706e61c660a3a566a5f09b.tar.gz
PrismLauncher-370c3aa5985698351e706e61c660a3a566a5f09b.tar.bz2
PrismLauncher-370c3aa5985698351e706e61c660a3a566a5f09b.zip
Merge pull request #894 from flowln/update_from_external_source
epic PR
Diffstat (limited to 'launcher/InstanceList.h')
-rw-r--r--launcher/InstanceList.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/launcher/InstanceList.h b/launcher/InstanceList.h
index 62282f04..3673298f 100644
--- a/launcher/InstanceList.h
+++ b/launcher/InstanceList.h
@@ -24,10 +24,10 @@
#include "BaseInstance.h"
-#include "QObjectPtr.h"
-
class QFileSystemWatcher;
class InstanceTask;
+struct InstanceName;
+
using InstanceId = QString;
using GroupId = QString;
using InstanceLocator = std::pair<InstancePtr, int>;
@@ -101,7 +101,10 @@ public:
InstListError loadList();
void saveNow();
+ /* O(n) */
InstancePtr getInstanceById(QString id) const;
+ /* O(n) */
+ InstancePtr getInstanceByManagedName(const QString& managed_name) const;
QModelIndex getInstanceIndexById(const QString &id) const;
QStringList getGroups();
bool isGroupCollapsed(const QString &groupName);
@@ -127,8 +130,10 @@ public:
/**
* Commit the staging area given by @keyPath to the provider - used when creation succeeds.
* Used by instance manipulation tasks.
+ * should_override is used when another similar instance already exists, and we want to override it
+ * - for instance, when updating it.
*/
- bool commitStagedInstance(const QString & keyPath, const QString& instanceName, const QString & groupName);
+ bool commitStagedInstance(const QString& keyPath, const InstanceName& instanceName, const QString& groupName, bool should_override);
/**
* Destroy a previously created staging area given by @keyPath - used when creation fails.