mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
migrateAwayFromDeprecatedIconForFileType
This commit is contained in:
parent
7c443b0c3b
commit
ecc66cace0
1 changed files with 2 additions and 1 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include "macutilities.h"
|
#include "macutilities.h"
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
|
||||||
#include <objc/message.h>
|
#include <objc/message.h>
|
||||||
|
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
@ -45,7 +46,7 @@ namespace MacUtils
|
||||||
{
|
{
|
||||||
@autoreleasepool
|
@autoreleasepool
|
||||||
{
|
{
|
||||||
NSImage *image = [[NSWorkspace sharedWorkspace] iconForFileType:ext.toNSString()];
|
NSImage *image = [[NSWorkspace sharedWorkspace] iconForContentType:[UTType typeWithFilenameExtension:ext.toNSString()]];
|
||||||
if (image)
|
if (image)
|
||||||
{
|
{
|
||||||
NSRect rect = NSMakeRect(0, 0, size.width(), size.height());
|
NSRect rect = NSMakeRect(0, 0, size.width(), size.height());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue