diff --git a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp index d109de44b2..b12193eef5 100644 --- a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp +++ b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp @@ -65,12 +65,31 @@ LauncherWindow::LauncherWindow(std::string basePath, bool profileEnabled, ui->comboBoxWindowConfigs->setDisabled(!_sgctConfigChangeAllowed); _fullyConfiguredViaCliArgs = (!profileEnabled && !sgctConfigEnabled); - std::random_device rd; - std::mt19937 rng(rd()); - std::uniform_int_distribution uni(0, 4); - auto random_integer = uni(rng); - QString filename = QString::fromStdString("/data/images/profile" + std::to_string(random_integer) + ".png"); - QString bgpath = QDir::fromNativeSeparators(_basePath)+ filename; + bool hasSyncFiles = false; + QString syncFilePath = QString(globalConfig.pathTokens["SYNC"].c_str()) + "/http/launcher_images/1/profile1.png"; + QFileInfo check_file(syncFilePath); + // check if file exists and if yes: Is it really a file and no directory? + if (check_file.exists() && check_file.isFile()) { + hasSyncFiles = true; + } + + + QString filename; + QString bgpath; + if (hasSyncFiles) { + std::random_device rd; + std::mt19937 rng(rd()); + std::uniform_int_distribution uni(0, 4); + auto random_integer = uni(rng); + filename = QString::fromStdString("/http/launcher_images/1/profile" + std::to_string(random_integer) + ".png"); + bgpath = QString(globalConfig.pathTokens["SYNC"].c_str()) + filename; + } + else { + filename = QString::fromStdString("/data/images/profile0.png"); + bgpath = QDir::fromNativeSeparators(_basePath) + filename; + } + + QPixmap bgpix(bgpath); ui->backgroundImage->setPixmap(bgpix); } diff --git a/data/images/profile1.png b/data/images/profile1.png deleted file mode 100644 index 0753744c2d..0000000000 Binary files a/data/images/profile1.png and /dev/null differ diff --git a/data/images/profile2.png b/data/images/profile2.png deleted file mode 100644 index e4d9fc8e51..0000000000 Binary files a/data/images/profile2.png and /dev/null differ diff --git a/data/images/profile3.png b/data/images/profile3.png deleted file mode 100644 index 3c336225b5..0000000000 Binary files a/data/images/profile3.png and /dev/null differ diff --git a/data/images/profile4.png b/data/images/profile4.png deleted file mode 100644 index 70c55bab8d..0000000000 Binary files a/data/images/profile4.png and /dev/null differ