mirror of
https://github.com/electron/electron.git
synced 2026-01-26 07:48:08 -05:00
Take const references
This commit is contained in:
@@ -18,8 +18,8 @@
|
||||
std::vector<mate::PersistentDictionary> items_;
|
||||
}
|
||||
|
||||
- (id)initWithItems:(std::vector<mate::PersistentDictionary>)items;
|
||||
- (void)setItems:(std::vector<mate::PersistentDictionary>)items;
|
||||
- (id)initWithItems:(const std::vector<mate::PersistentDictionary>&)items;
|
||||
- (void)setItems:(const std::vector<mate::PersistentDictionary>&)items;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -13,18 +13,19 @@
|
||||
static NSString* const TextItemIdentifier = @"scrubber.text.item";
|
||||
static NSString* const ImageItemIdentifier = @"scrubber.image.item";
|
||||
|
||||
- (id)initWithItems:(std::vector<mate::PersistentDictionary>)items {
|
||||
- (id)initWithItems:(const std::vector<mate::PersistentDictionary>&)items {
|
||||
if ((self = [super init])) {
|
||||
items_ = items;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfItemsForScrubber:(NSScrubber *)theScrubber {
|
||||
- (NSInteger)numberOfItemsForScrubber:(NSScrubber*)theScrubber {
|
||||
return items_.size();
|
||||
}
|
||||
|
||||
- (NSScrubberItemView *)scrubber:(NSScrubber *)scrubber viewForItemAtIndex:(NSInteger)index {
|
||||
- (NSScrubberItemView*)scrubber:(NSScrubber*)scrubber
|
||||
viewForItemAtIndex:(NSInteger)index {
|
||||
mate::PersistentDictionary item = items_[index];
|
||||
|
||||
NSScrubberItemView* itemView;
|
||||
@@ -48,7 +49,7 @@ static NSString* const ImageItemIdentifier = @"scrubber.image.item";
|
||||
return itemView;
|
||||
}
|
||||
|
||||
- (void)setItems:(std::vector<mate::PersistentDictionary>)items {
|
||||
- (void)setItems:(const std::vector<mate::PersistentDictionary>&)items {
|
||||
items_ = items;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user