diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-11-06 09:27:15 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-11-06 09:27:15 -0500 |
| commit | ad8e9d99b30578676c15d10a74f010439e132406 (patch) | |
| tree | f3058d15be71493e10d1e18b565455d5cb7c84f9 /src/createinstancedialogpages.cpp | |
| parent | be9c39a3b47a8f93388eaf624b6d007eac22b68e (diff) | |
renamed InstanceManager::instance() to singleton() to avoid confusion
Diffstat (limited to 'src/createinstancedialogpages.cpp')
| -rw-r--r-- | src/createinstancedialogpages.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/createinstancedialogpages.cpp b/src/createinstancedialogpages.cpp index 00d49b99..26f2f61d 100644 --- a/src/createinstancedialogpages.cpp +++ b/src/createinstancedialogpages.cpp @@ -136,13 +136,13 @@ TypePage::TypePage(CreateInstanceDialog& dlg) { ui->createGlobal->setDescription( ui->createGlobal->description() - .arg(InstanceManager::instance().instancesPath())); + .arg(InstanceManager::singleton().instancesPath())); ui->createPortable->setDescription( ui->createPortable->description() .arg(InstanceManager::portablePath())); - if (InstanceManager::instance().portableInstanceExists()) { + if (InstanceManager::singleton().portableInstanceExists()) { ui->createPortable->setEnabled(false); ui->portableExistsLabel->setVisible(true); } else { @@ -722,7 +722,7 @@ void NamePage::activated() m_label.setText(g->gameName()); if (!m_modified || ui->instanceName->text().isEmpty()) { - const auto n = InstanceManager::instance().makeUniqueName(g->gameName()); + const auto n = InstanceManager::singleton().makeUniqueName(g->gameName()); ui->instanceName->setText(n); m_modified = false; } @@ -737,7 +737,7 @@ QString NamePage::selectedInstanceName() const } const auto text = ui->instanceName->text().trimmed(); - return InstanceManager::instance().sanitizeInstanceName(text); + return InstanceManager::singleton().sanitizeInstanceName(text); } void NamePage::onChanged() @@ -748,7 +748,7 @@ void NamePage::onChanged() void NamePage::updateWarnings() { - const auto root = InstanceManager::instance().instancesPath(); + const auto root = InstanceManager::singleton().instancesPath(); m_okay = checkName(root, ui->instanceName->text()); updateNavigation(); @@ -765,7 +765,7 @@ bool NamePage::checkName(QString parentDir, QString name) if (name.isEmpty()) { empty = true; } else { - if (InstanceManager::instance().validInstanceName(name)) { + if (InstanceManager::singleton().validInstanceName(name)) { exists = QDir(parentDir).exists(name); } else { invalid = true; @@ -901,7 +901,7 @@ void PathsPage::setPaths(const QString& name, bool force) if (m_dlg.instanceType() == CreateInstanceDialog::Portable) { path = InstanceManager::portablePath(); } else { - const auto root = InstanceManager::instance().instancesPath(); + const auto root = InstanceManager::singleton().instancesPath(); path = root + "/" + name; } @@ -938,11 +938,11 @@ bool PathsPage::checkPath( } else { const QDir d(path); - if (InstanceManager::instance().validInstanceName(d.dirName())) { + if (InstanceManager::singleton().validInstanceName(d.dirName())) { if (m_dlg.instanceType() == CreateInstanceDialog::Portable) { // the default data path for a portable instance is the application // directory, so it's not an error if it exists - if (QDir(path) != InstanceManager::instance().portablePath()) { + if (QDir(path) != InstanceManager::singleton().portablePath()) { exists = QDir(path).exists(); } } else { |
