chore: replace deprecated NSNamePboardType with NSPasteboardTypeName (#6107)

* chore: replace deprecated NSNamePboardType with NSPasteboardTypeName

* chore: remove NSServices section from Info.plist

It appears to be noop on modern macOS if no action specified.
This commit is contained in:
Dzmitry Neviadomski 2023-11-03 08:22:45 +03:00 committed by GitHub
parent 2df67c1a73
commit 1b53226853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 27 deletions

View File

@ -75,18 +75,6 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSServices</key>
<array>
<dict>
<key>NSPortName</key>
<string>Transmission</string>
<key>NSSendTypes</key>
<array>
<string>NSStringPboardType</string>
<string>NSURLPboardType</string>
</array>
</dict>
</array>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>SUAllowsAutomaticUpdates</key>

View File

@ -79,18 +79,6 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSServices</key>
<array>
<dict>
<key>NSPortName</key>
<string>Transmission</string>
<key>NSSendTypes</key>
<array>
<string>NSStringPboardType</string>
<string>NSURLPboardType</string>
</array>
</dict>
</array>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>SUAllowsAutomaticUpdates</key>

View File

@ -659,8 +659,8 @@ static NSTimeInterval const kToggleProgressSeconds = 0.175;
}
NSPasteboard* pasteBoard = NSPasteboard.generalPasteboard;
NSString* links = [[selectedTorrents valueForKeyPath:@"magnetLink"] componentsJoinedByString:@"\n"];
[pasteBoard declareTypes:@[ NSStringPboardType ] owner:nil];
[pasteBoard setString:links forType:NSStringPboardType];
[pasteBoard declareTypes:@[ NSPasteboardTypeString ] owner:nil];
[pasteBoard setString:links forType:NSPasteboardTypeString];
}
- (void)paste:(id)sender
@ -706,7 +706,7 @@ static NSTimeInterval const kToggleProgressSeconds = 0.175;
if (action == @selector(paste:))
{
if ([NSPasteboard.generalPasteboard.types containsObject:NSURLPboardType])
if ([NSPasteboard.generalPasteboard.types containsObject:NSPasteboardTypeURL])
{
return YES;
}