1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Apply suggestions from code review

Co-authored-by: Andrey Filipenkov <kambaladecapitator@gmail.com>
This commit is contained in:
Laserlicht
2024-01-06 22:34:02 +01:00
committed by GitHub
parent 89236987ce
commit 152a43abe0
2 changed files with 4 additions and 4 deletions

View File

@@ -140,8 +140,7 @@ void FirstLaunchView::activateTabHeroesData()
QString installPath = getHeroesInstallDir(); QString installPath = getHeroesInstallDir();
if(!installPath.isEmpty()) if(!installPath.isEmpty())
{ {
QMessageBox::StandardButton reply; auto reply = QMessageBox::question(this, tr("Heroes III installation found!"), tr("Copy data to VCMI folder?"), QMessageBox::Yes | QMessageBox::No);
reply = QMessageBox::question(this, tr("Heroes III installation found!"), tr("Copy data to VCMI folder?"), QMessageBox::Yes|QMessageBox::No);
if(reply == QMessageBox::Yes) if(reply == QMessageBox::Yes)
copyHeroesData(installPath); copyHeroesData(installPath);
} }
@@ -272,6 +271,7 @@ QString FirstLaunchView::getHeroesInstallDir()
QString gogPath = QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\GOG.com\\Games\\1207658787", QSettings::NativeFormat).value("path").toString(); QString gogPath = QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\GOG.com\\Games\\1207658787", QSettings::NativeFormat).value("path").toString();
if(!gogPath.isEmpty()) if(!gogPath.isEmpty())
return gogPath; return gogPath;
QString cdPath = QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\New World Computing\\Heroes of Might and Magic® III\\1.0", QSettings::NativeFormat).value("AppPath").toString(); QString cdPath = QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\New World Computing\\Heroes of Might and Magic® III\\1.0", QSettings::NativeFormat).value("AppPath").toString();
if(!cdPath.isEmpty()) if(!cdPath.isEmpty())
return cdPath; return cdPath;
@@ -284,7 +284,7 @@ void FirstLaunchView::copyHeroesData(const QString & path)
QDir sourceRoot = QDir(path); QDir sourceRoot = QDir(path);
if(path.isEmpty()) if(path.isEmpty())
sourceRoot.setPath(QFileDialog::getExistingDirectory(this, "", "", QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks)); sourceRoot.setPath(QFileDialog::getExistingDirectory(this, {}, {}, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks));
if(!sourceRoot.exists()) if(!sourceRoot.exists())
return; return;

View File

@@ -52,7 +52,7 @@ class FirstLaunchView : public QWidget
void forceHeroesLanguage(const QString & language); void forceHeroesLanguage(const QString & language);
QString getHeroesInstallDir(); QString getHeroesInstallDir();
void copyHeroesData(const QString & path = ""); void copyHeroesData(const QString & path = {});
// Tab Mod Preset // Tab Mod Preset
void modPresetUpdate(); void modPresetUpdate();