From 43413601d40538e7670037a15a486e50098bf842 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 25 Jul 2021 01:31:45 -0500 Subject: [PATCH] Fix not to set service to song 0 on opening --- SlideController.pro.user | 321 --------------------------------------- slideview.cpp | 10 +- 2 files changed, 8 insertions(+), 323 deletions(-) delete mode 100644 SlideController.pro.user diff --git a/SlideController.pro.user b/SlideController.pro.user deleted file mode 100644 index 98d8b4b..0000000 --- a/SlideController.pro.user +++ /dev/null @@ -1,321 +0,0 @@ - - - - - - EnvironmentId - {08334014-cc98-402b-addd-6d89112df7cb} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - *.md, *.MD, Makefile - false - true - - - - ProjectExplorer.Project.PluginSettings - - - true - true - true - true - true - - - 0 - true - - -fno-delayed-template-parsing - - true - Builtin.Questionable - - true - true - Builtin.DefaultTidyAndClazy - 2 - - - - true - - - - - ProjectExplorer.Project.Target.0 - - Desktop - Desktop Qt 5.15.2 MSVC2019 64bit - Desktop Qt 5.15.2 MSVC2019 64bit - qt.qt5.5152.win64_msvc2019_64_kit - 1 - 0 - 0 - - 0 - C:\Users\avuser\Documents\build-SlideController-Desktop_Qt_5_15_2_MSVC2019_64bit-Debug - C:/Users/avuser/Documents/build-SlideController-Desktop_Qt_5_15_2_MSVC2019_64bit-Debug - - - true - QtProjectManager.QMakeBuildStep - - false - - - - true - Qt4ProjectManager.MakeStep - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - clean - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - 0 - - - C:\Users\avuser\Documents\build-SlideController-Desktop_Qt_5_15_2_MSVC2019_64bit-Release - C:/Users/avuser/Documents/build-SlideController-Desktop_Qt_5_15_2_MSVC2019_64bit-Release - - - true - QtProjectManager.QMakeBuildStep - - false - - - - true - Qt4ProjectManager.MakeStep - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - clean - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - 0 - 0 - - - 0 - C:\Users\avuser\Documents\build-SlideController-Desktop_Qt_5_15_2_MSVC2019_64bit-Profile - C:/Users/avuser/Documents/build-SlideController-Desktop_Qt_5_15_2_MSVC2019_64bit-Profile - - - true - QtProjectManager.QMakeBuildStep - - false - - - - true - Qt4ProjectManager.MakeStep - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - clean - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - 0 - 0 - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - - false - ProjectExplorer.DefaultDeployConfiguration - - 1 - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:C:/Users/avuser/Documents/SlideController/SlideController.pro - C:/Users/avuser/Documents/SlideController/SlideController.pro - false - true - true - false - true - C:/Users/avuser/Documents/build-SlideController-Desktop_Qt_5_15_2_MSVC2019_64bit-Release - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/slideview.cpp b/slideview.cpp index a70fcc4..5e2a59f 100644 --- a/slideview.cpp +++ b/slideview.cpp @@ -42,7 +42,7 @@ void SlideView::changeSong(int song) { } void SlideView::slideListUpdate(QStringList tagList, QStringList slideList) { - m_currentSlide = -1; + m_currentSlide = 0; m_slideTable->setRowCount(slideList.size()); for (int i = 0; i < slideList.size(); ++i) { auto txt = slideList[i]; @@ -54,9 +54,15 @@ void SlideView::slideListUpdate(QStringList tagList, QStringList slideList) { } void SlideView::songListUpdate(QStringList songList) { + // Is this replacing an existing song list or is it the initial song list? + // We want to reset the song to 0 upon replacement, + // but leave it alone upon initialization. + auto isReplacement = m_songSelector->count() > 0; disconnect(m_songSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSong(int))); m_songSelector->clear(); m_songSelector->addItems(songList); - changeSong(0); + if (isReplacement) { + changeSong(0); + } connect(m_songSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSong(int))); }