File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -699,14 +699,14 @@ void SidebarModel::saveSelectionToConfig(const QModelIndex& index) {
699699 }
700700}
701701
702- void SidebarModel::restoreLastSelection () {
702+ bool SidebarModel::restoreLastSelection () {
703703 if (!m_pConfig) {
704- return ;
704+ return false ;
705705 }
706706
707707 QString savedFeatureIcon = m_pConfig->getValue (kLastSelectedFeatureConfigKey );
708708 if (savedFeatureIcon.isEmpty ()) {
709- return ;
709+ return false ;
710710 }
711711
712712 QString savedChildDataStr = m_pConfig->getValue (kLastSelectedChildConfigKey );
@@ -734,7 +734,7 @@ void SidebarModel::restoreLastSelection() {
734734 }
735735
736736 if (!pTargetFeature) {
737- return ;
737+ return false ;
738738 }
739739
740740 QModelIndex targetIndex = index (featureIndex, 0 );
@@ -752,7 +752,7 @@ void SidebarModel::restoreLastSelection() {
752752 VERIFY_OR_DEBUG_ASSERT (!matches.isEmpty () && matches.first ().isValid ()) {
753753 // Child not found, select feature root
754754 emit selectIndex (targetIndex, true );
755- return ;
755+ return true ;
756756 }
757757
758758 // Translate child index to sidebar index
@@ -764,4 +764,5 @@ void SidebarModel::restoreLastSelection() {
764764 }
765765
766766 emit selectIndex (targetIndex, true );
767+ return true ;
767768}
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ class SidebarModel : public QAbstractItemModel {
8383 void slotModelAboutToBeReset ();
8484 void slotModelReset ();
8585 void slotFeatureIsLoading (LibraryFeature*, bool selectFeature);
86- void restoreLastSelection ();
86+ bool restoreLastSelection ();
8787 void slotFeatureLoadingFinished (LibraryFeature*);
8888
8989 signals:
You can’t perform that action at this time.
0 commit comments