3030
3131#include " ui_projectfile.h"
3232
33+ #include < array>
3334#include < list>
3435#include < string>
3536#include < utility>
@@ -79,7 +80,7 @@ static QStringList getPaths(const QListWidget *list)
7980}
8081
8182/* * Platforms shown in the platform combobox */
82- static constexpr Platform::Type builtinPlatforms[] = {
83+ static const std::array< Platform::Type, 6 > builtinPlatforms = {
8384 Platform::Type::Native,
8485 Platform::Type::Win32A,
8586 Platform::Type::Win32W,
@@ -88,8 +89,6 @@ static constexpr Platform::Type builtinPlatforms[] = {
8889 Platform::Type::Unix64
8990};
9091
91- static constexpr int numberOfBuiltinPlatforms = sizeof (builtinPlatforms) / sizeof (builtinPlatforms[0 ]);
92-
9392QStringList ProjectFileDialog::getProjectConfigs (const QString &fileName)
9493{
9594 if (!fileName.endsWith (" .sln" ) && !fileName.endsWith (" .vcxproj" ))
@@ -336,7 +335,7 @@ void ProjectFileDialog::loadFromProjectFile(const ProjectFile *projectFile)
336335 const QString& platform = projectFile->getPlatform ();
337336 if (platform.endsWith (" .xml" )) {
338337 int i;
339- for (i = numberOfBuiltinPlatforms ; i < mUI ->mComboBoxPlatform ->count (); ++i) {
338+ for (i = builtinPlatforms. size () ; i < mUI ->mComboBoxPlatform ->count (); ++i) {
340339 if (mUI ->mComboBoxPlatform ->itemText (i) == platform)
341340 break ;
342341 }
@@ -348,12 +347,12 @@ void ProjectFileDialog::loadFromProjectFile(const ProjectFile *projectFile)
348347 }
349348 } else {
350349 int i;
351- for (i = 0 ; i < numberOfBuiltinPlatforms ; ++i) {
350+ for (i = 0 ; i < builtinPlatforms. size () ; ++i) {
352351 const Platform::Type p = builtinPlatforms[i];
353352 if (platform == Platform::toString (p))
354353 break ;
355354 }
356- if (i < numberOfBuiltinPlatforms )
355+ if (i < builtinPlatforms. size () )
357356 mUI ->mComboBoxPlatform ->setCurrentIndex (i);
358357 else
359358 mUI ->mComboBoxPlatform ->setCurrentIndex (-1 );
@@ -482,7 +481,7 @@ void ProjectFileDialog::saveToProjectFile(ProjectFile *projectFile) const
482481 projectFile->setPlatform (mUI ->mComboBoxPlatform ->currentText ());
483482 else {
484483 const int i = mUI ->mComboBoxPlatform ->currentIndex ();
485- if (i>=0 && i < numberOfBuiltinPlatforms )
484+ if (i>=0 && i < builtinPlatforms. size () )
486485 projectFile->setPlatform (Platform::toString (builtinPlatforms[i]));
487486 else
488487 projectFile->setPlatform (QString ());
0 commit comments