vlc | branch: master | Felix Paul Kühne <[email protected]> | Sun Apr 28 15:41:20 2019 +0200| [e2e2b636162c221b84740193242c5a3672c25d05] | committer: Felix Paul Kühne
macosx/library management: make sure to show decoded URLs > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e2e2b636162c221b84740193242c5a3672c25d05 --- modules/gui/macosx/UI/VLCLibraryFolderManagementWindow.xib | 6 +++--- modules/gui/macosx/library/VLCLibraryDataTypes.h | 1 + modules/gui/macosx/library/VLCLibraryDataTypes.m | 4 ++++ modules/gui/macosx/library/VLCLibraryFolderManagementWindow.m | 7 +++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/gui/macosx/UI/VLCLibraryFolderManagementWindow.xib b/modules/gui/macosx/UI/VLCLibraryFolderManagementWindow.xib index bfb18204fa..aea4d05f9a 100644 --- a/modules/gui/macosx/UI/VLCLibraryFolderManagementWindow.xib +++ b/modules/gui/macosx/UI/VLCLibraryFolderManagementWindow.xib @@ -24,11 +24,11 @@ <scrollView autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cN4-CV-0ZY"> <rect key="frame" x="0.0" y="40" width="638" height="335"/> <clipView key="contentView" id="iBY-dM-gpy"> - <rect key="frame" x="1" y="0.0" width="636" height="334"/> + <rect key="frame" x="1" y="0.0" width="636" height="319"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" headerView="qUX-xV-r50" id="yXW-Oh-c8y"> - <rect key="frame" x="0.0" y="0.0" width="874" height="309"/> + <rect key="frame" x="0.0" y="0.0" width="874" height="294"/> <autoresizingMask key="autoresizingMask"/> <size key="intercellSpacing" width="3" height="2"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> @@ -95,7 +95,7 @@ </subviews> </clipView> <scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="AbQ-Qa-KFB"> - <rect key="frame" x="1" y="318" width="636" height="16"/> + <rect key="frame" x="1" y="319" width="636" height="15"/> <autoresizingMask key="autoresizingMask"/> </scroller> <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="wbF-0g-t3S"> diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.h b/modules/gui/macosx/library/VLCLibraryDataTypes.h index 2b366ffee8..c92b76480f 100644 --- a/modules/gui/macosx/library/VLCLibraryDataTypes.h +++ b/modules/gui/macosx/library/VLCLibraryDataTypes.h @@ -125,6 +125,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithEntryPoint:(struct vlc_ml_entry_point_t *)p_entryPoint; @property (readonly) NSString *MRL; +@property (readonly) NSString *decodedMRL; @property (readonly) BOOL isPresent; @property (readonly) BOOL isBanned; diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.m b/modules/gui/macosx/library/VLCLibraryDataTypes.m index e4e20a944c..9d682cff0c 100644 --- a/modules/gui/macosx/library/VLCLibraryDataTypes.m +++ b/modules/gui/macosx/library/VLCLibraryDataTypes.m @@ -24,6 +24,8 @@ #import "extensions/NSString+Helpers.h" +#import <vlc_url.h> + @implementation VLCMediaLibraryFile - (instancetype)initWithFile:(struct vlc_ml_file_t *)p_file @@ -194,7 +196,9 @@ { self = [super init]; if (self && p_entryPoint != NULL) { + _MRL = toNSStr(p_entryPoint->psz_mrl); + _decodedMRL = toNSStr(vlc_uri_decode(p_entryPoint->psz_mrl)); _isPresent = p_entryPoint->b_present; _isBanned = p_entryPoint->b_banned; } diff --git a/modules/gui/macosx/library/VLCLibraryFolderManagementWindow.m b/modules/gui/macosx/library/VLCLibraryFolderManagementWindow.m index 84c7b54459..097ab18c0d 100644 --- a/modules/gui/macosx/library/VLCLibraryFolderManagementWindow.m +++ b/modules/gui/macosx/library/VLCLibraryFolderManagementWindow.m @@ -93,6 +93,7 @@ [_libraryController addFolderWithFileURL:url]; } + _cachedFolderList = nil; [self.libraryFolderTableView reloadData]; } } @@ -106,6 +107,7 @@ [_libraryController banFolderWithFileURL:[NSURL URLWithString:entryPoint.MRL]]; } + _cachedFolderList = nil; [self.libraryFolderTableView reloadData]; } @@ -114,6 +116,7 @@ VLCMediaLibraryEntryPoint *entryPoint = _cachedFolderList[self.libraryFolderTableView.selectedRow]; [_libraryController removeFolderWithFileURL:[NSURL URLWithString:entryPoint.MRL]]; + _cachedFolderList = nil; [self.libraryFolderTableView reloadData]; } @@ -129,13 +132,13 @@ { VLCMediaLibraryEntryPoint *entryPoint = _cachedFolderList[row]; if (tableColumn == self.nameTableColumn) { - return [entryPoint.MRL lastPathComponent]; + return [entryPoint.decodedMRL lastPathComponent]; } else if (tableColumn == self.presentTableColumn) { return entryPoint.isPresent ? @"✔" : @"✘"; } else if (tableColumn == self.bannedTableColumn) { return entryPoint.isBanned ? @"✔" : @"✘"; } else { - return entryPoint.MRL; + return entryPoint.decodedMRL; } } _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
