mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-27 18:28:18 +03:00
parent
062e35e6b0
commit
2b69cabc2c
1 changed files with 10 additions and 4 deletions
|
@ -1411,7 +1411,8 @@ bool Preferences::isTorrentFileAssocSet()
|
||||||
if (defaultHandlerId != NULL)
|
if (defaultHandlerId != NULL)
|
||||||
{
|
{
|
||||||
const CFStringRef myBundleId = CFBundleGetIdentifier(CFBundleGetMainBundle());
|
const CFStringRef myBundleId = CFBundleGetIdentifier(CFBundleGetMainBundle());
|
||||||
isSet = CFStringCompare(myBundleId, defaultHandlerId, 0) == kCFCompareEqualTo;
|
if (myBundleId != NULL)
|
||||||
|
isSet = CFStringCompare(myBundleId, defaultHandlerId, 0) == kCFCompareEqualTo;
|
||||||
CFRelease(defaultHandlerId);
|
CFRelease(defaultHandlerId);
|
||||||
}
|
}
|
||||||
CFRelease(torrentId);
|
CFRelease(torrentId);
|
||||||
|
@ -1423,11 +1424,13 @@ void Preferences::setTorrentFileAssoc()
|
||||||
{
|
{
|
||||||
if (isTorrentFileAssocSet())
|
if (isTorrentFileAssocSet())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const CFStringRef torrentId = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, torrentExtension, NULL);
|
const CFStringRef torrentId = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, torrentExtension, NULL);
|
||||||
if (torrentId != NULL)
|
if (torrentId != NULL)
|
||||||
{
|
{
|
||||||
const CFStringRef myBundleId = CFBundleGetIdentifier(CFBundleGetMainBundle());
|
const CFStringRef myBundleId = CFBundleGetIdentifier(CFBundleGetMainBundle());
|
||||||
LSSetDefaultRoleHandlerForContentType(torrentId, kLSRolesViewer, myBundleId);
|
if (myBundleId != NULL)
|
||||||
|
LSSetDefaultRoleHandlerForContentType(torrentId, kLSRolesViewer, myBundleId);
|
||||||
CFRelease(torrentId);
|
CFRelease(torrentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1439,7 +1442,8 @@ bool Preferences::isMagnetLinkAssocSet()
|
||||||
if (defaultHandlerId != NULL)
|
if (defaultHandlerId != NULL)
|
||||||
{
|
{
|
||||||
const CFStringRef myBundleId = CFBundleGetIdentifier(CFBundleGetMainBundle());
|
const CFStringRef myBundleId = CFBundleGetIdentifier(CFBundleGetMainBundle());
|
||||||
isSet = CFStringCompare(myBundleId, defaultHandlerId, 0) == kCFCompareEqualTo;
|
if (myBundleId != NULL)
|
||||||
|
isSet = CFStringCompare(myBundleId, defaultHandlerId, 0) == kCFCompareEqualTo;
|
||||||
CFRelease(defaultHandlerId);
|
CFRelease(defaultHandlerId);
|
||||||
}
|
}
|
||||||
return isSet;
|
return isSet;
|
||||||
|
@ -1449,8 +1453,10 @@ void Preferences::setMagnetLinkAssoc()
|
||||||
{
|
{
|
||||||
if (isMagnetLinkAssocSet())
|
if (isMagnetLinkAssocSet())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const CFStringRef myBundleId = CFBundleGetIdentifier(CFBundleGetMainBundle());
|
const CFStringRef myBundleId = CFBundleGetIdentifier(CFBundleGetMainBundle());
|
||||||
LSSetDefaultHandlerForURLScheme(magnetUrlScheme, myBundleId);
|
if (myBundleId != NULL)
|
||||||
|
LSSetDefaultHandlerForURLScheme(magnetUrlScheme, myBundleId);
|
||||||
}
|
}
|
||||||
#endif // Q_OS_MACOS
|
#endif // Q_OS_MACOS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue