mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 14:08:03 -06:00
Migrate away from deprecated iconForFileType
Currently `iconForFileType` is used on macOS to display the file icons in the content tab. However this is marked as deprecated and should be replaced with `iconForContentType`. Related #15630. PR #22992.
This commit is contained in:
@@ -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,8 @@ namespace MacUtils
|
|||||||
{
|
{
|
||||||
@autoreleasepool
|
@autoreleasepool
|
||||||
{
|
{
|
||||||
NSImage *image = [[NSWorkspace sharedWorkspace] iconForFileType:ext.toNSString()];
|
const 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());
|
||||||
|
|||||||
Reference in New Issue
Block a user