Merge pull request #967 from manongjohn/fix_startup_browser_cannot_reopen

Fix brower from startup not reopening
This commit is contained in:
manongjohn 2022-04-17 16:09:29 -04:00 committed by GitHub
commit 1b02cd9d5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -453,7 +453,7 @@ void StartupPopup::updateProjectCB() {
RecentFiles::instance()->addFilePath(currentProjectPath, RecentFiles::instance()->addFilePath(currentProjectPath,
RecentFiles::Project); RecentFiles::Project);
TFilePath sandboxFp = pm->getSandboxProjectFolder() + "sandbox_otprj.xml"; TFilePath sandboxFp = pm->getSandboxProjectFolder() + "tahomaproject.xml";
m_projectPaths.push_back(sandboxFp); m_projectPaths.push_back(sandboxFp);
m_projectsCB->addItem("sandbox"); m_projectsCB->addItem("sandbox");
m_projectsCB->setItemData(0, pm->getSandboxProjectFolder().getQString(), m_projectsCB->setItemData(0, pm->getSandboxProjectFolder().getQString(),
@ -503,12 +503,14 @@ void StartupPopup::onProjectComboChanged(int index) {
// The last index is Browse. . . // The last index is Browse. . .
if (index == m_projectsCB->count() - 1) { if (index == m_projectsCB->count() - 1) {
m_projectsCB->blockSignals(true); m_projectsCB->blockSignals(true);
for (int i = 0; i < m_projectPaths.size(); i++) { int i;
for (i = 0; i < m_projectPaths.size(); i++) {
if (pm->getCurrentProjectPath() == m_projectPaths[i]) { if (pm->getCurrentProjectPath() == m_projectPaths[i]) {
m_projectsCB->setCurrentIndex(i); m_projectsCB->setCurrentIndex(i);
break; break;
} }
} }
if (i >= m_projectPaths.size()) m_projectsCB->setCurrentIndex(0);
m_projectsCB->blockSignals(false); m_projectsCB->blockSignals(false);
m_projectLocationFld->setPath( m_projectLocationFld->setPath(
Preferences::instance()->getDefaultProjectPath()); Preferences::instance()->getDefaultProjectPath());