diff --git a/macosx/AddMagnetWindowController.mm b/macosx/AddMagnetWindowController.mm index d8a389d58..a197074ee 100644 --- a/macosx/AddMagnetWindowController.mm +++ b/macosx/AddMagnetWindowController.mm @@ -75,7 +75,7 @@ self.fNameField.toolTip = name; //disable fullscreen support - [self.window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenNone]; + self.window.collectionBehavior = NSWindowCollectionBehaviorFullScreenNone; [self setGroupsMenu]; [self.fGroupPopUp selectItemWithTag:self.fGroupValue]; diff --git a/macosx/AddWindowController.mm b/macosx/AddWindowController.mm index dcfbe5cb8..027e4efb1 100644 --- a/macosx/AddWindowController.mm +++ b/macosx/AddWindowController.mm @@ -107,7 +107,7 @@ self.fNameField.toolTip = name; //disable fullscreen support - [self.window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenNone]; + self.window.collectionBehavior = NSWindowCollectionBehaviorFullScreenNone; self.fIconView.image = self.torrent.icon; @@ -233,7 +233,7 @@ [alert addButtonWithTitle:NSLocalizedString(@"Add", "Add torrent -> same name -> button")]; alert.showsSuppressionButton = YES; - [alert beginSheetModalForWindow:[self window] completionHandler:^(NSModalResponse returnCode) { + [alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) { if (alert.suppressionButton.state == NSControlStateValueOn) { [NSUserDefaults.standardUserDefaults setBool:NO forKey:@"WarningFolderDataSameName"]; diff --git a/macosx/BlocklistDownloader.mm b/macosx/BlocklistDownloader.mm index a327ebb9f..e912bcdf0 100644 --- a/macosx/BlocklistDownloader.mm +++ b/macosx/BlocklistDownloader.mm @@ -249,7 +249,7 @@ BlocklistDownloader* fBLDownloader = nil; return NO; } - NSURL* destinationDir = [destination URLByDeletingLastPathComponent]; + NSURL* destinationDir = destination.URLByDeletingLastPathComponent; NSTask* untar = [[NSTask alloc] init]; untar.launchPath = @"/usr/bin/tar"; @@ -279,7 +279,7 @@ BlocklistDownloader* fBLDownloader = nil; - (BOOL)gunzipFrom:(NSURL*)file to:(NSURL*)destination { - NSURL* destinationDir = [destination URLByDeletingLastPathComponent]; + NSURL* destinationDir = destination.URLByDeletingLastPathComponent; NSTask* gunzip = [[NSTask alloc] init]; gunzip.launchPath = @"/usr/bin/gunzip"; @@ -301,7 +301,7 @@ BlocklistDownloader* fBLDownloader = nil; return NO; } - NSURL* result = [file URLByDeletingPathExtension]; + NSURL* result = file.URLByDeletingPathExtension; [NSFileManager.defaultManager moveItemAtURL:result toURL:destination error:nil]; return YES; @@ -348,7 +348,7 @@ BlocklistDownloader* fBLDownloader = nil; return NO; } - NSURL* destinationDir = [destination URLByDeletingLastPathComponent]; + NSURL* destinationDir = destination.URLByDeletingLastPathComponent; NSTask* unzip = [[NSTask alloc] init]; unzip.launchPath = @"/usr/bin/unzip"; diff --git a/macosx/BlocklistDownloaderViewController.mm b/macosx/BlocklistDownloaderViewController.mm index 2c847c5fc..3d618b12a 100644 --- a/macosx/BlocklistDownloaderViewController.mm +++ b/macosx/BlocklistDownloaderViewController.mm @@ -133,7 +133,7 @@ BlocklistDownloaderViewController* fBLViewController = nil; [NSBundle.mainBundle loadNibNamed:@"BlocklistStatusWindow" owner:self topLevelObjects:NULL]; BlocklistDownloader* downloader = [BlocklistDownloader downloader]; - [downloader setViewController:self]; //do before showing the sheet to ensure it doesn't slide out with placeholder text + downloader.viewController = self; //do before showing the sheet to ensure it doesn't slide out with placeholder text [self.fPrefsController.window beginSheet:self.fStatusWindow completionHandler:nil]; } diff --git a/macosx/Controller.h b/macosx/Controller.h index cb134391d..f178f9f25 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -168,7 +168,7 @@ typedef NS_ENUM(unsigned int, addType) { // @property(nonatomic, readonly) CGFloat toolbarHeight; @property(nonatomic, readonly) CGFloat mainWindowComponentHeight; @property(nonatomic, readonly) CGFloat scrollViewHeight; -- (BOOL)isFullScreen; +@property(nonatomic, getter=isFullScreen, readonly) BOOL fullScreen; - (void)updateForExpandCollapse; diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 1cfb0d432..c0b127b5f 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -122,7 +122,7 @@ typedef NS_ENUM(unsigned int, sortOrderTag) { // static void altSpeedToggledCallback([[maybe_unused]] tr_session* handle, bool active, bool byUser, void* controller) { - NSDictionary* dict = [[NSDictionary alloc] initWithObjects:@[ @(active), @(byUser) ] forKeys:@[ @"Active", @"ByUser" ]]; + NSDictionary* dict = @{@"Active" : @(active), @"ByUser" : @(byUser)}; [(__bridge Controller*)controller performSelectorOnMainThread:@selector(altSpeedToggledCallbackIsLimited:) withObject:dict waitUntilDone:NO]; } @@ -512,7 +512,7 @@ static void removeKeRangerRansomware() _fLib = tr_sessionInit(configDir, YES, &settings); tr_variantFree(&settings); - _fConfigDirectory = [[NSString alloc] initWithUTF8String:configDir]; + _fConfigDirectory = @(configDir); NSApp.delegate = self; @@ -569,7 +569,7 @@ static void removeKeRangerRansomware() self.fWindow.excludedFromWindowsMenu = YES; //make window primary view in fullscreen - [self.fWindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; + self.fWindow.collectionBehavior = NSWindowCollectionBehaviorFullScreenPrimary; //set table size BOOL const small = [self.fDefaults boolForKey:@"SmallView"]; @@ -1021,7 +1021,7 @@ static void removeKeRangerRansomware() NSString* message = [NSString stringWithFormat:NSLocalizedString(@"It appears that the file \"%@\" from %@ is not a torrent file.", "Download not a torrent -> message"), suggestedName, - [download.request.URL.absoluteString stringByRemovingPercentEncoding]]; + download.request.URL.absoluteString.stringByRemovingPercentEncoding]; NSAlert* alert = [[NSAlert alloc] init]; [alert addButtonWithTitle:NSLocalizedString(@"OK", "Download not a torrent -> button")]; @@ -1046,7 +1046,7 @@ static void removeKeRangerRansomware() { NSString* message = [NSString stringWithFormat:NSLocalizedString(@"The torrent could not be downloaded from %@: %@.", "Torrent download failed -> message"), - [download.request.URL.absoluteString stringByRemovingPercentEncoding], + download.request.URL.absoluteString.stringByRemovingPercentEncoding, error.localizedDescription]; NSAlert* alert = [[NSAlert alloc] init]; @@ -1351,7 +1351,7 @@ static void removeKeRangerRansomware() //called on by applescript - (void)open:(NSArray*)files { - NSDictionary* dict = [[NSDictionary alloc] initWithObjects:@[ files, @(ADD_MANUAL) ] forKeys:@[ @"Filenames", @"AddType" ]]; + NSDictionary* dict = @{ @"Filenames" : files, @"AddType" : @(ADD_MANUAL) }; [self performSelectorOnMainThread:@selector(openFilesWithDict:) withObject:dict waitUntilDone:NO]; } @@ -1374,9 +1374,10 @@ static void removeKeRangerRansomware() [filenames addObject:url.path]; } - NSDictionary* dictionary = [[NSDictionary alloc] - initWithObjects:@[ filenames, sender == self.fOpenIgnoreDownloadFolder ? @(ADD_SHOW_OPTIONS) : @(ADD_MANUAL) ] - forKeys:@[ @"Filenames", @"AddType" ]]; + NSDictionary* dictionary = @{ + @"Filenames" : filenames, + @"AddType" : sender == self.fOpenIgnoreDownloadFolder ? @(ADD_SHOW_OPTIONS) : @(ADD_MANUAL) + }; [self performSelectorOnMainThread:@selector(openFilesWithDict:) withObject:dictionary waitUntilDone:NO]; } }]; @@ -1552,7 +1553,7 @@ static void removeKeRangerRansomware() [self.fWindow beginSheet:self.fUrlSheetController.window completionHandler:^(NSModalResponse returnCode) { if (returnCode == 1) { - NSString* urlString = [self.fUrlSheetController urlString]; + NSString* urlString = self.fUrlSheetController.urlString; urlString = [urlString stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet]; dispatch_async(dispatch_get_main_queue(), ^{ [self openURL:urlString]; diff --git a/macosx/CreatorWindowController.mm b/macosx/CreatorWindowController.mm index 081373466..960b2f4cf 100644 --- a/macosx/CreatorWindowController.mm +++ b/macosx/CreatorWindowController.mm @@ -141,7 +141,7 @@ NSMutableSet* creatorWindowControllerSet = nil; //remove potentially invalid addresses for (NSInteger i = _fTrackers.count - 1; i >= 0; i--) { - if (!tr_urlIsValidTracker([_fTrackers[i] UTF8String])) + if (!tr_urlIsValidTracker(_fTrackers[i].UTF8String)) { [_fTrackers removeObjectAtIndex:i]; } @@ -161,7 +161,7 @@ NSMutableSet* creatorWindowControllerSet = nil; self.window.title = name; //disable fullscreen support - [self.window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenNone]; + self.window.collectionBehavior = NSWindowCollectionBehaviorFullScreenNone; self.fNameField.stringValue = name; self.fNameField.toolTip = self.fPath.path; @@ -191,7 +191,7 @@ NSMutableSet* creatorWindowControllerSet = nil; self.fStatusField.stringValue = statusString; [self updatePiecesField]; - [self.fPieceSizeStepper setIntValue:(int)log2((double)self.fInfo->pieceSize)]; + self.fPieceSizeStepper.intValue = (int)log2((double)self.fInfo->pieceSize); self.fLocation = [[self.fDefaults URLForKey:@"CreatorLocationURL"] URLByAppendingPathComponent:[name stringByAppendingPathExtension:@"torrent"]]; @@ -601,14 +601,14 @@ NSMutableSet* creatorWindowControllerSet = nil; for (NSUInteger i = 0; i < self.fTrackers.count; i++) { - trackerInfo[i].announce = (char*)[self.fTrackers[i] UTF8String]; + trackerInfo[i].announce = (char*)(self.fTrackers[i]).UTF8String; trackerInfo[i].tier = i; } //store values [self.fDefaults setObject:self.fTrackers forKey:@"CreatorTrackers"]; [self.fDefaults setBool:self.fPrivateCheck.state == NSControlStateValueOn forKey:@"CreatorPrivate"]; - [self.fDefaults setObject:[self.fSource stringValue] forKey:@"CreatorSource"]; + [self.fDefaults setObject:self.fSource.stringValue forKey:@"CreatorSource"]; [self.fDefaults setBool:self.fOpenCheck.state == NSControlStateValueOn forKey:@"CreatorOpen"]; self.fOpenWhenCreated = self.fOpenCheck.state == NSControlStateValueOn; //need this since the check box might not exist, and value in prefs might have changed from another creator window diff --git a/macosx/MessageWindowController.mm b/macosx/MessageWindowController.mm index 925bd54d2..5dff80b11 100644 --- a/macosx/MessageWindowController.mm +++ b/macosx/MessageWindowController.mm @@ -67,7 +67,7 @@ self.window.title = NSLocalizedString(@"Message Log", "Message window -> title"); //disable fullscreen support - [window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenNone]; + window.collectionBehavior = NSWindowCollectionBehaviorFullScreenNone; //set images and text for popup button items [self.fLevelButton itemAtIndex:LEVEL_ERROR].title = NSLocalizedString(@"Error", "Message window -> level string"); diff --git a/macosx/NSImageAdditions.mm b/macosx/NSImageAdditions.mm index e63d5bbc2..c03c9c8d8 100644 --- a/macosx/NSImageAdditions.mm +++ b/macosx/NSImageAdditions.mm @@ -21,7 +21,7 @@ bp.lineWidth = BORDER_WIDTH; //border - CGFloat fractionOfBlendedColor = [NSApp isDarkMode] ? 0.15 : 0.3; + CGFloat fractionOfBlendedColor = NSApp.darkMode ? 0.15 : 0.3; NSColor* borderColor = [color blendedColorWithFraction:fractionOfBlendedColor ofColor:NSColor.controlTextColor]; [borderColor setStroke]; [bp stroke]; diff --git a/macosx/NSStringAdditions.h b/macosx/NSStringAdditions.h index 7cccef392..aa6b195a8 100644 --- a/macosx/NSStringAdditions.h +++ b/macosx/NSStringAdditions.h @@ -7,7 +7,7 @@ @interface NSString (NSStringAdditions) @property(nonatomic, class, readonly) NSString* ellipsis; -- (NSString*)stringByAppendingEllipsis; +@property(nonatomic, readonly, copy) NSString* stringByAppendingEllipsis; + (NSString*)formattedUInteger:(NSUInteger)value; diff --git a/macosx/PiecesView.mm b/macosx/PiecesView.mm index df9855682..a50af2e94 100644 --- a/macosx/PiecesView.mm +++ b/macosx/PiecesView.mm @@ -51,7 +51,7 @@ enum - (void)viewDidChangeEffectiveAppearance { - [self setTorrent:_torrent]; + self.torrent = _torrent; [self updateView]; } @@ -122,7 +122,7 @@ enum NSRect fillRects[self.fNumPieces]; NSColor* fillColors[self.fNumPieces]; - NSColor* defaultColor = [NSApp isDarkMode] ? NSColor.blackColor : NSColor.whiteColor; + NSColor* defaultColor = NSApp.darkMode ? NSColor.blackColor : NSColor.whiteColor; NSInteger usedCount = 0; diff --git a/macosx/PrefsController.mm b/macosx/PrefsController.mm index dd14479fe..59bbf4bc0 100644 --- a/macosx/PrefsController.mm +++ b/macosx/PrefsController.mm @@ -199,7 +199,7 @@ self.window.restorationClass = [self class]; //disable fullscreen support - [self.window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenNone]; + self.window.collectionBehavior = NSWindowCollectionBehaviorFullScreenNone; NSToolbar* toolbar = [[NSToolbar alloc] initWithIdentifier:@"Preferences Toolbar"]; toolbar.delegate = self; @@ -1119,7 +1119,7 @@ tr_sessionSetRPCPassword(self.fHandle, fullPassword); - self.fRPCPassword = [[NSString alloc] initWithUTF8String:fullPassword]; + self.fRPCPassword = @(fullPassword); self.fRPCPasswordField.stringValue = self.fRPCPassword; } else diff --git a/macosx/ProgressGradients.mm b/macosx/ProgressGradients.mm index 702d806aa..4efca4ba4 100644 --- a/macosx/ProgressGradients.mm +++ b/macosx/ProgressGradients.mm @@ -9,7 +9,7 @@ + (NSGradient*)progressWhiteGradient { - if ([NSApp isDarkMode]) + if (NSApp.darkMode) { return [[self class] progressGradientForRed:0.1 green:0.1 blue:0.1]; } @@ -21,7 +21,7 @@ + (NSGradient*)progressGrayGradient { - if ([NSApp isDarkMode]) + if (NSApp.darkMode) { return [[self class] progressGradientForRed:0.35 green:0.35 blue:0.35]; } @@ -33,7 +33,7 @@ + (NSGradient*)progressLightGrayGradient { - if ([NSApp isDarkMode]) + if (NSApp.darkMode) { return [[self class] progressGradientForRed:0.2 green:0.2 blue:0.2]; } @@ -45,7 +45,7 @@ + (NSGradient*)progressBlueGradient { - if ([NSApp isDarkMode]) + if (NSApp.darkMode) { return [[self class] progressGradientForRed:0.35 * 2.0 / 3.0 green:0.67 * 2.0 / 3.0 blue:0.98 * 2.0 / 3.0]; } @@ -57,7 +57,7 @@ + (NSGradient*)progressDarkBlueGradient { - if ([NSApp isDarkMode]) + if (NSApp.darkMode) { return [[self class] progressGradientForRed:0.616 * 2.0 / 3.0 green:0.722 * 2.0 / 3.0 blue:0.776 * 2.0 / 3.0]; } @@ -69,7 +69,7 @@ + (NSGradient*)progressGreenGradient { - if ([NSApp isDarkMode]) + if (NSApp.darkMode) { return [[self class] progressGradientForRed:0.44 * 2.0 / 3.0 green:0.89 * 2.0 / 3.0 blue:0.40 * 2.0 / 3.0]; } @@ -81,7 +81,7 @@ + (NSGradient*)progressLightGreenGradient { - if ([NSApp isDarkMode]) + if (NSApp.darkMode) { return [[self class] progressGradientForRed:0.62 * 3.0 / 4.0 green:0.99 * 3.0 / 4.0 blue:0.58 * 3.0 / 4.0]; } @@ -93,7 +93,7 @@ + (NSGradient*)progressDarkGreenGradient { - if ([NSApp isDarkMode]) + if (NSApp.darkMode) { return [[self class] progressGradientForRed:0.627 * 2.0 / 3.0 green:0.714 * 2.0 / 3.0 blue:0.639 * 2.0 / 3.0]; } @@ -105,7 +105,7 @@ + (NSGradient*)progressRedGradient { - if ([NSApp isDarkMode]) + if (NSApp.darkMode) { return [[self class] progressGradientForRed:0.902 * 2.0 / 3.0 green:0.439 * 2.0 / 3.0 blue:0.451 * 2.0 / 3.0]; } @@ -117,7 +117,7 @@ + (NSGradient*)progressYellowGradient { - if ([NSApp isDarkMode]) + if (NSApp.darkMode) { return [[self class] progressGradientForRed:0.933 * 0.8 green:0.890 * 0.8 blue:0.243 * 0.8]; } diff --git a/macosx/QuickLookPlugin/GeneratePreviewForURL.mm b/macosx/QuickLookPlugin/GeneratePreviewForURL.mm index 3e56b85bb..e88038ecc 100644 --- a/macosx/QuickLookPlugin/GeneratePreviewForURL.mm +++ b/macosx/QuickLookPlugin/GeneratePreviewForURL.mm @@ -19,7 +19,7 @@ NSString* generateIconData(NSString* fileExtension, NSUInteger width, NSMutableD // we need to do this once per file extension, per size NSString* iconFileName = [NSString stringWithFormat:@"%ldx%@.tiff", width, rawFilename]; - if (![allImgProps objectForKey:iconFileName]) + if (!allImgProps[iconFileName]) { NSImage* icon = [[NSWorkspace sharedWorkspace] iconForFileType:fileExtension]; @@ -29,13 +29,13 @@ NSString* generateIconData(NSString* fileExtension, NSUInteger width, NSMutableD [icon drawInRect:iconFrame fromRect:NSZeroRect operation:NSCompositingOperationCopy fraction:1.0]; [renderedIcon unlockFocus]; - NSData* iconData = [renderedIcon TIFFRepresentation]; + NSData* iconData = renderedIcon.TIFFRepresentation; NSDictionary* imgProps = @{ (NSString*)kQLPreviewPropertyMIMETypeKey : @"image/png", (NSString*)kQLPreviewPropertyAttachmentDataKey : iconData }; - [allImgProps setObject:imgProps forKey:iconFileName]; + allImgProps[iconFileName] = imgProps; } return [@"cid:" stringByAppendingString:iconFileName]; @@ -54,7 +54,7 @@ OSStatus GeneratePreviewForURL(void* thisInterface, QLPreviewRequestRef preview, //try to parse the torrent file auto metainfo = tr_torrent_metainfo{}; - if (!metainfo.parseTorrentFile([[(__bridge NSURL*)url path] UTF8String])) + if (!metainfo.parseTorrentFile(((__bridge NSURL*)url).path.UTF8String)) { return noErr; } @@ -69,11 +69,11 @@ OSStatus GeneratePreviewForURL(void* thisInterface, QLPreviewRequestRef preview, NSMutableDictionary* allImgProps = [NSMutableDictionary dictionary]; - NSString* name = [NSString stringWithUTF8String:metainfo.name().c_str()]; + NSString* name = @(metainfo.name().c_str()); auto const n_files = metainfo.fileCount(); auto const is_multifile = n_files > 1; - NSString* fileTypeString = is_multifile ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) : [name pathExtension]; + NSString* fileTypeString = is_multifile ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) : name.pathExtension; NSUInteger const width = 32; [htmlString appendFormat:@"

%@

", @@ -97,7 +97,7 @@ OSStatus GeneratePreviewForURL(void* thisInterface, QLPreviewRequestRef preview, timeStyle:NSDateFormatterShortStyle] : nil; auto const& creator = metainfo.creator(); - NSString* creatorString = !std::empty(creator) ? [NSString stringWithUTF8String:creator.c_str()] : nil; + NSString* creatorString = !std::empty(creator) ? @(creator.c_str()) : nil; if ([creatorString isEqualToString:@""]) { creatorString = nil; @@ -128,7 +128,7 @@ OSStatus GeneratePreviewForURL(void* thisInterface, QLPreviewRequestRef preview, auto const& commentStr = metainfo.comment(); if (!std::empty(commentStr)) { - NSString* comment = [NSString stringWithUTF8String:commentStr.c_str()]; + NSString* comment = @(commentStr.c_str()); if (![comment isEqualToString:@""]) [htmlString appendFormat:@"

%@

", comment]; } @@ -191,16 +191,16 @@ OSStatus GeneratePreviewForURL(void* thisInterface, QLPreviewRequestRef preview, #warning display folders? for (auto const& [path, size] : metainfo.files().sortedByPath()) { - NSString* fullFilePath = [NSString stringWithUTF8String:path.c_str()]; + NSString* fullFilePath = @(path.c_str()); NSCAssert([fullFilePath hasPrefix:[name stringByAppendingString:@"/"]], @"Expected file path %@ to begin with %@/", fullFilePath, name); - NSString* shortenedFilePath = [fullFilePath substringFromIndex:[name length] + 1]; + NSString* shortenedFilePath = [fullFilePath substringFromIndex:name.length + 1]; NSString* shortenedFilePathAndSize = [NSString stringWithFormat:@"%@ - %@", shortenedFilePath, [NSString stringForFileSize:size]]; NSUInteger const width = 16; [listSection appendFormat:@"%@", - generateIconData([shortenedFilePath pathExtension], width, allImgProps), + generateIconData(shortenedFilePath.pathExtension, width, allImgProps), width, width, shortenedFilePathAndSize]; @@ -211,7 +211,7 @@ OSStatus GeneratePreviewForURL(void* thisInterface, QLPreviewRequestRef preview, [lists addObject:listSection]; } - if ([lists count] > 0) + if (lists.count > 0) { [htmlString appendFormat:@"

%@", [lists componentsJoinedByString:@"
"]]; } diff --git a/macosx/StatsWindowController.mm b/macosx/StatsWindowController.mm index 750d26e7b..6db268cdb 100644 --- a/macosx/StatsWindowController.mm +++ b/macosx/StatsWindowController.mm @@ -70,7 +70,7 @@ tr_session* fLib = NULL; self.window.title = NSLocalizedString(@"Statistics", "Stats window -> title"); //disable fullscreen support - [self.window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenNone]; + self.window.collectionBehavior = NSWindowCollectionBehaviorFullScreenNone; //set label text self.fUploadedLabelField.stringValue = [NSLocalizedString(@"Uploaded", "Stats window -> label") stringByAppendingString:@":"]; diff --git a/macosx/Toolbar.mm b/macosx/Toolbar.mm index 587df9d74..06efd4e86 100644 --- a/macosx/Toolbar.mm +++ b/macosx/Toolbar.mm @@ -12,7 +12,7 @@ //otherwise we get strange drawing issues, leading to a potential crash [NSNotificationCenter.defaultCenter postNotificationName:@"ToolbarDidChange" object:nil]; - [super setVisible:visible]; + super.visible = visible; } @end diff --git a/macosx/Torrent.h b/macosx/Torrent.h index fc645ff85..b59aec71b 100644 --- a/macosx/Torrent.h +++ b/macosx/Torrent.h @@ -83,7 +83,7 @@ typedef NS_ENUM(unsigned int, TorrentDeterminationType) { - (void)moveTorrentDataFileTo:(NSString*)folder; - (void)copyTorrentFileTo:(NSString*)path; -- (BOOL)alertForRemainingDiskSpace; +@property(nonatomic, readonly) BOOL alertForRemainingDiskSpace; @property(nonatomic, readonly) NSImage* icon; diff --git a/macosx/TrackerCell.mm b/macosx/TrackerCell.mm index a235e3935..3ee042a8b 100644 --- a/macosx/TrackerCell.mm +++ b/macosx/TrackerCell.mm @@ -199,7 +199,7 @@ NSMutableSet* fTrackerIconLoading; NSImage* result = [NSImage imageWithSystemSymbolName:@"globe" accessibilityDescription:nil]; [result lockFocus]; [NSColor.textColor set]; - NSRect imageRect = { NSZeroPoint, [result size] }; + NSRect imageRect = { NSZeroPoint, result.size }; NSRectFillUsingOperation(imageRect, NSCompositingOperationSourceIn); [result unlockFocus]; return result; @@ -235,7 +235,7 @@ NSMutableSet* fTrackerIconLoading; { [fTrackerIconCache setObject:icon forKey:baseAddress]; - [[self controlView] setNeedsDisplay:YES]; + [self.controlView setNeedsDisplay:YES]; } else {