1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-22 07:42:37 +00:00

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;
}