[vlc-commits] [Git][videolan/vlc][master] macosx: Prevent unnecessary reloadData calls in VLCLibraryAudioDataSource
    Jean-Baptiste Kempf (@jbk) 
    gitlab at videolan.org
       
    Sat Jul 23 08:52:39 UTC 2022
    
    
  
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
38b05b5f by Claudio Cambra at 2022-07-23T08:52:32+00:00
macosx: Prevent unnecessary reloadData calls in VLCLibraryAudioDataSource
- - - - -
1 changed file:
- modules/gui/macosx/library/VLCLibraryAudioDataSource.m
Changes:
=====================================
modules/gui/macosx/library/VLCLibraryAudioDataSource.m
=====================================
@@ -115,7 +115,8 @@
 
 - (IBAction)segmentedControlAction:(id)sender
 {
-    [_collectionViewFlowLayout resetLayout];
+    enum vlc_ml_parent_type oldParentType = _currentParentType;
+
     _currentSelectedSegment = _segmentedControl.selectedSegment;
     switch (_currentSelectedSegment) {
         case 0:
@@ -144,9 +145,14 @@
         [self reloadEmptyViewAppearance];
         return;
     }
+
+    if(oldParentType == _currentParentType) {
+        return;
+    }
+
+    [_collectionViewFlowLayout resetLayout];
     
     [self.collectionView reloadData];
-
     [self.collectionSelectionTableView reloadData];
     [self.groupSelectionTableView reloadData];
 }
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/38b05b5f1b950d7dd489b4580f2aa1bd395820da
-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/38b05b5f1b950d7dd489b4580f2aa1bd395820da
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
    
    
More information about the vlc-commits
mailing list