File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -820,20 +820,24 @@ class WelcomePanel : public Component
820820 }
821821
822822 if (recentlyOpenedTree.isValid ()) {
823- // Place favourited patches at the top
824- for (int i = 0 ; i < recentlyOpenedTree.getNumChildren (); i++) {
825-
823+ for (int i = recentlyOpenedTree.getNumChildren () - 1 ; i >= 0 ; i--) {
826824 auto subTree = recentlyOpenedTree.getChild (i);
827825 auto patchFile = File (subTree.getProperty (" Path" ).toString ());
828-
829826 if (!File (patchFile).existsAsFile ())
830827 {
831828 if (!subTree.hasProperty (" Removable" ))
832829 {
833- recentlyOpenedTree.removeChild (subTree, nullptr );
830+ recentlyOpenedTree.removeChild (i, nullptr );
831+
834832 }
835- continue ;
836833 }
834+ }
835+
836+ // Place favourited patches at the top
837+ for (int i = 0 ; i < recentlyOpenedTree.getNumChildren (); i++) {
838+
839+ auto subTree = recentlyOpenedTree.getChild (i);
840+ auto patchFile = File (subTree.getProperty (" Path" ).toString ());
837841
838842 auto patchThumbnailBase = File (patchFile.getParentDirectory ().getFullPathName () + " \\ " + patchFile.getFileNameWithoutExtension () + " _thumb" );
839843
You can’t perform that action at this time.
0 commit comments