Skip to content
Snippets Groups Projects
Commit 42953e87 authored by Claudio Cambra's avatar Claudio Cambra Committed by Steve Lhomme
Browse files

macosx: Move all the connect/disconnect related properties and method to the...

macosx: Move all the connect/disconnect related properties and method to the abstract media library segment view controller

These methods are not useful for the media source view controller

Signed-off-by: default avatarClaudio Cambra <developer@claudiocambra.com>
parent 90071878
No related branches found
No related tags found
1 merge request!6820macosx: Do not try to connect or disconnect the media source view controller
......@@ -24,8 +24,19 @@
NS_ASSUME_NONNULL_BEGIN
@protocol VLCLibraryDataSource;
@interface VLCLibraryAbstractMediaLibrarySegmentViewController : VLCLibraryAbstractSegmentViewController
@property (readonly) BOOL connected; // Meaning to library model notifications
// Implement getters for these properties in subclass
@property (readonly) NSArray<NSLayoutConstraint *> *placeholderImageViewSizeConstraints;
@property (readonly) id<VLCLibraryDataSource> currentDataSource;
- (void)connect;
- (void)disconnect;
@end
NS_ASSUME_NONNULL_END
......@@ -22,6 +22,32 @@
#import "VLCLibraryAbstractMediaLibrarySegmentViewController.h"
#import "library/VLCLibraryDataSource.h"
@implementation VLCLibraryAbstractMediaLibrarySegmentViewController
- (id<VLCLibraryDataSource>)currentDataSource
{
return nil;
}
// A note on the connected property.
// This does not necessarily reflect the connection state of the data sources themselves.
// We may disconnect the data sources via the view controllers when we detect that long loads are
// taking place. However, keeping the connection state in the view controller allows us to
// reconnect the data sources once the long loads are over (or not reconnect them, if the view
// controller was originally disconnected, for example if the embedded video view is open)
- (void)connect
{
[self.currentDataSource connect];
_connected = YES;
}
- (void)disconnect
{
[self.currentDataSource disconnect];
_connected = NO;
}
@end
......@@ -25,7 +25,6 @@
NS_ASSUME_NONNULL_BEGIN
@class VLCLibraryWindow;
@protocol VLCLibraryDataSource;
@interface VLCLibraryAbstractSegmentViewController : NSObject
......@@ -35,16 +34,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (readonly, weak) NSImageView *placeholderImageView;
@property (readonly, weak) NSTextField *placeholderLabel;
// Implement getters for these properties in subclass
@property (readonly) NSArray<NSLayoutConstraint *> *placeholderImageViewSizeConstraints;
@property (readonly) id<VLCLibraryDataSource> currentDataSource;
@property (readonly) BOOL connected; // Meaning to library model notifications
- (instancetype)initWithLibraryWindow:(VLCLibraryWindow *)libraryWindow;
- (void)connect;
- (void)disconnect;
@end
NS_ASSUME_NONNULL_END
......@@ -22,7 +22,6 @@
#import "VLCLibraryAbstractSegmentViewController.h"
#import "library/VLCLibraryDataSource.h"
#import "library/VLCLibraryWindow.h"
@implementation VLCLibraryAbstractSegmentViewController
......@@ -41,29 +40,4 @@
return self;
}
- (id<VLCLibraryDataSource>)currentDataSource
{
[self doesNotRecognizeSelector:_cmd];
return nil;
}
// A note on the connected property.
// This does not necessarily reflect the connection state of the data sources themselves.
// We may disconnect the data sources via the view controllers when we detect that long loads are
// taking place. However, keeping the connection state in the view controller allows us to
// reconnect the data sources once the long loads are over (or not reconnect them, if the view
// controller was originally disconnected, for example if the embedded video view is open)
- (void)connect
{
[self.currentDataSource connect];
_connected = YES;
}
- (void)disconnect
{
[self.currentDataSource disconnect];
_connected = NO;
}
@end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment