Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
macos: remove quicklook generator
Ivan Yossifff020791acd
diff --git a/krita/integration/CMakeLists.txt b/krita/integration/CMakeLists.txtindex 4a08520820..09d54575d1 100644--- a/krita/integration/CMakeLists.txt+++ b/krita/integration/CMakeLists.txt@@ -7,16 +7,12 @@ endif()add_custom_target( kritaintegration ALL xcodebuild archive-project "${CMAKE_CURRENT_SOURCE_DIR}/integration.xcodeproj" ${XCODEBUILD_ARCHS}- -target kritaquicklook-target kritaspotlight-target krita-thumbnailer-target krita-preview-configuration Release COMMENT build all macOS plugins)-# TODO kritaquicklook should be removed once 10.x series is unsupported by krita-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Build/UninstalledProducts/macosx/kritaquicklook.qlgenerator DESTINATION ${KDE_INSTALL_PLUGINDIR})-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Build/UninstalledProducts/macosx/kritaspotlight.mdimporter DESTINATION ${KDE_INSTALL_PLUGINDIR})install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Build/UninstalledProducts/macosx/krita-thumbnailer.appex DESTINATION ${KDE_INSTALL_PLUGINDIR})diff --git a/krita/integration/integration.xcodeproj/project.pbxproj b/krita/integration/integration.xcodeproj/project.pbxprojindex 69d2b762b4..9dfb18a377 100644--- a/krita/integration/integration.xcodeproj/project.pbxproj+++ b/krita/integration/integration.xcodeproj/project.pbxproj@@ -17,6 +17,7 @@110986472ED0DE4400C1ECC8 /* PreviewProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1109863E2ED0DE4400C1ECC8 /* PreviewProvider.swift */; };110986482ED0DE4400C1ECC8 /* PreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1109863F2ED0DE4400C1ECC8 /* PreviewViewController.swift */; };1109864A2ED0DE4400C1ECC8 /* PreviewViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 110986412ED0DE4400C1ECC8 /* PreviewViewController.xib */; };+ 1136A44C2FE1B8F700AF40E8 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 1136A44B2FE1B8F700AF40E8 /* main.c */; };114946422EA3FACB00515C4C /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 114946412EA3FACB00515C4C /* AppKit.framework */; };1149465C2EA6B34D00515C4C /* ThumbnailProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B7B62D25619404003662DB /* ThumbnailProvider.swift */; };1149465E2EA6B34D00515C4C /* QuickLookThumbnailing.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84B7B62825619404003662DB /* QuickLookThumbnailing.framework */; };@@ -42,12 +43,7 @@84D505DF256086C1005AFC55 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 84D5059C256056BF005AFC55 /* ioapi.c */; };84D505E0256086C1005AFC55 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = 84D505972560520B005AFC55 /* unzip.c */; };84D505E2256086CA005AFC55 /* libunziptask.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84D505D725608693005AFC55 /* libunziptask.a */; };- 84D505E5256086D0005AFC55 /* libunziptask.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84D505D725608693005AFC55 /* libunziptask.a */; };- 84D6510E2560370B00CC2E75 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 84D6510D2560370B00CC2E75 /* main.c */; };- 84D6511B2560371600CC2E75 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 84D6511A2560371600CC2E75 /* main.c */; };84D6511D2560371600CC2E75 /* GetMetadataForFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D6511C2560371600CC2E75 /* GetMetadataForFile.m */; };- 84D6513025603A1E00CC2E75 /* GenerateThumbnailForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D6512E25603A1E00CC2E75 /* GenerateThumbnailForURL.m */; };- 84D6513125603A1E00CC2E75 /* GeneratePreviewForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D6512F25603A1E00CC2E75 /* GeneratePreviewForURL.m */; };/* End PBXBuildFile section *//* Begin PBXContainerItemProxy section */@@ -100,13 +96,6 @@remoteGlobalIDString = 84D505D625608693005AFC55;remoteInfo = unziptask;};- 84D505E6256086D0005AFC55 /* PBXContainerItemProxy */ = {- isa = PBXContainerItemProxy;- containerPortal = 84D650F0256036F000CC2E75 /* Project object */;- proxyType = 1;- remoteGlobalIDString = 84D505D625608693005AFC55;- remoteInfo = unziptask;- };/* End PBXContainerItemProxy section *//* Begin PBXCopyFilesBuildPhase section */@@ -132,16 +121,6 @@name = "Embed Libraries";runOnlyForDeploymentPostprocessing = 0;};- 84D505B925607381005AFC55 /* Embed Libraries */ = {- isa = PBXCopyFilesBuildPhase;- buildActionMask = 2147483647;- dstPath = "";- dstSubfolderSpec = 10;- files = (- );- name = "Embed Libraries";- runOnlyForDeploymentPostprocessing = 0;- };/* End PBXCopyFilesBuildPhase section *//* Begin PBXFileReference section */@@ -153,6 +132,7 @@1109863E2ED0DE4400C1ECC8 /* PreviewProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviewProvider.swift; sourceTree = "<group>"; };1109863F2ED0DE4400C1ECC8 /* PreviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviewViewController.swift; sourceTree = "<group>"; };110986402ED0DE4400C1ECC8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PreviewViewController.xib; sourceTree = "<group>"; };+ 1136A44B2FE1B8F700AF40E8 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };114946412EA3FACB00515C4C /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };114946472EA5593D00515C4C /* previewHelper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = previewHelper.app; sourceTree = BUILT_PRODUCTS_DIR; };114946662EA6B34D00515C4C /* krita-thumbnailer_helper.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "krita-thumbnailer_helper.appex"; sourceTree = BUILT_PRODUCTS_DIR; };@@ -175,15 +155,9 @@84D5059C256056BF005AFC55 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ioapi.c; sourceTree = "<group>"; };84D5059D256056BF005AFC55 /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ioapi.h; sourceTree = "<group>"; };84D505D725608693005AFC55 /* libunziptask.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libunziptask.a; sourceTree = BUILT_PRODUCTS_DIR; };- 84D651072560370B00CC2E75 /* kritaquicklook.qlgenerator */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = kritaquicklook.qlgenerator; sourceTree = BUILT_PRODUCTS_DIR; };- 84D6510D2560370B00CC2E75 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };- 84D6510F2560370B00CC2E75 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };84D651172560371600CC2E75 /* kritaspotlight.mdimporter */ = {isa = PBXFileReference; explicitFileType = "wrapper.spotlight-importer"; includeInIndex = 0; path = kritaspotlight.mdimporter; sourceTree = BUILT_PRODUCTS_DIR; };- 84D6511A2560371600CC2E75 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = main.c; path = ../main.c; sourceTree = "<group>"; };84D6511C2560371600CC2E75 /* GetMetadataForFile.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GetMetadataForFile.m; sourceTree = "<group>"; };84D651222560371600CC2E75 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };- 84D6512E25603A1E00CC2E75 /* GenerateThumbnailForURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GenerateThumbnailForURL.m; sourceTree = "<group>"; };- 84D6512F25603A1E00CC2E75 /* GeneratePreviewForURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratePreviewForURL.m; sourceTree = "<group>"; };84D65139256043A000CC2E75 /* UnzipTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UnzipTask.m; sourceTree = "<group>"; };84D6513A256043A000CC2E75 /* UnzipTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnzipTask.h; sourceTree = "<group>"; };/* End PBXFileReference section */@@ -245,14 +219,6 @@);runOnlyForDeploymentPostprocessing = 0;};- 84D651032560370B00CC2E75 /* Frameworks */ = {- isa = PBXFrameworksBuildPhase;- buildActionMask = 2147483647;- files = (- 84D505E5256086D0005AFC55 /* libunziptask.a in Frameworks */,- );- runOnlyForDeploymentPostprocessing = 0;- };84D651142560371600CC2E75 /* Frameworks */ = {isa = PBXFrameworksBuildPhase;buildActionMask = 2147483647;@@ -350,7 +316,6 @@114946682EA6B42B00515C4C /* krita-thumbnailer_helper */,84D505AC2560726A005AFC55 /* unzipTask */,84D6512A2560379A00CC2E75 /* 3rdparty */,- 84D651082560370B00CC2E75 /* quicklook */,84D651182560371600CC2E75 /* spotlight */,84B7B62C25619404003662DB /* krita-thumbnailer */,110986382ED0DE3F00C1ECC8 /* previewHelper */,@@ -363,7 +328,6 @@84D650F9256036F000CC2E75 /* Products */ = {isa = PBXGroup;children = (- 84D651072560370B00CC2E75 /* kritaquicklook.qlgenerator */,84D651172560371600CC2E75 /* kritaspotlight.mdimporter */,84D505D725608693005AFC55 /* libunziptask.a */,84B7B62725619404003662DB /* krita-thumbnailer.appex */,@@ -375,35 +339,16 @@name = Products;sourceTree = "<group>";};- 84D651082560370B00CC2E75 /* quicklook */ = {- isa = PBXGroup;- children = (- 84D6512F25603A1E00CC2E75 /* GeneratePreviewForURL.m */,- 84D6512E25603A1E00CC2E75 /* GenerateThumbnailForURL.m */,- 84D6510F2560370B00CC2E75 /* Info.plist */,- 84D6513F256043CC00CC2E75 /* Supporting Files */,- );- path = quicklook;- sourceTree = "<group>";- };84D651182560371600CC2E75 /* spotlight */ = {isa = PBXGroup;children = (+ 1136A44B2FE1B8F700AF40E8 /* main.c */,84D6511C2560371600CC2E75 /* GetMetadataForFile.m */,84D651222560371600CC2E75 /* Info.plist */,- 84D651192560371600CC2E75 /* Supporting Files */,);path = spotlight;sourceTree = "<group>";};- 84D651192560371600CC2E75 /* Supporting Files */ = {- isa = PBXGroup;- children = (- 84D6511A2560371600CC2E75 /* main.c */,- );- path = "Supporting Files";- sourceTree = "<group>";- };84D6512A2560379A00CC2E75 /* 3rdparty */ = {isa = PBXGroup;children = (@@ -415,14 +360,6 @@path = 3rdparty;sourceTree = "<group>";};- 84D6513F256043CC00CC2E75 /* Supporting Files */ = {- isa = PBXGroup;- children = (- 84D6510D2560370B00CC2E75 /* main.c */,- );- name = "Supporting Files";- sourceTree = "<group>";- };/* End PBXGroup section *//* Begin PBXHeadersBuildPhase section */@@ -436,13 +373,6 @@);runOnlyForDeploymentPostprocessing = 0;};- 84D651042560370B00CC2E75 /* Headers */ = {- isa = PBXHeadersBuildPhase;- buildActionMask = 2147483647;- files = (- );- runOnlyForDeploymentPostprocessing = 0;- };84D6512B256037CE00CC2E75 /* Headers */ = {isa = PBXHeadersBuildPhase;buildActionMask = 2147483647;@@ -568,26 +498,6 @@productReference = 84D505D725608693005AFC55 /* libunziptask.a */;productType = "com.apple.product-type.library.static";};- 84D651062560370B00CC2E75 /* kritaquicklook */ = {- isa = PBXNativeTarget;- buildConfigurationList = 84D651102560370B00CC2E75 /* Build configuration list for PBXNativeTarget "kritaquicklook" */;- buildPhases = (- 84D651042560370B00CC2E75 /* Headers */,- 84D651022560370B00CC2E75 /* Sources */,- 84D651032560370B00CC2E75 /* Frameworks */,- 84D651052560370B00CC2E75 /* Resources */,- 84D505B925607381005AFC55 /* Embed Libraries */,- );- buildRules = (- );- dependencies = (- 84D505E7256086D0005AFC55 /* PBXTargetDependency */,- );- name = kritaquicklook;- productName = quicklook;- productReference = 84D651072560370B00CC2E75 /* kritaquicklook.qlgenerator */;- productType = "com.apple.product-type.bundle";- };84D651162560371600CC2E75 /* kritaspotlight */ = {isa = PBXNativeTarget;buildConfigurationList = 84D651232560371600CC2E75 /* Build configuration list for PBXNativeTarget "kritaspotlight" */;@@ -632,9 +542,6 @@84D505D625608693005AFC55 = {CreatedOnToolsVersion = 11.3.1;};- 84D651062560370B00CC2E75 = {- CreatedOnToolsVersion = 11.3.1;- };84D651162560371600CC2E75 = {CreatedOnToolsVersion = 11.3.1;};@@ -653,7 +560,6 @@projectDirPath = "";projectRoot = "";targets = (- 84D651062560370B00CC2E75 /* kritaquicklook */,84D651162560371600CC2E75 /* kritaspotlight */,84D505D625608693005AFC55 /* unziptask */,114946462EA5593D00515C4C /* previewHelper */,@@ -705,13 +611,6 @@);runOnlyForDeploymentPostprocessing = 0;};- 84D651052560370B00CC2E75 /* Resources */ = {- isa = PBXResourcesBuildPhase;- buildActionMask = 2147483647;- files = (- );- runOnlyForDeploymentPostprocessing = 0;- };84D651152560371600CC2E75 /* Resources */ = {isa = PBXResourcesBuildPhase;buildActionMask = 2147483647;@@ -775,22 +674,12 @@);runOnlyForDeploymentPostprocessing = 0;};- 84D651022560370B00CC2E75 /* Sources */ = {- isa = PBXSourcesBuildPhase;- buildActionMask = 2147483647;- files = (- 84D6513025603A1E00CC2E75 /* GenerateThumbnailForURL.m in Sources */,- 84D6513125603A1E00CC2E75 /* GeneratePreviewForURL.m in Sources */,- 84D6510E2560370B00CC2E75 /* main.c in Sources */,- );- runOnlyForDeploymentPostprocessing = 0;- };84D651132560371600CC2E75 /* Sources */ = {isa = PBXSourcesBuildPhase;buildActionMask = 2147483647;files = (84D6511D2560371600CC2E75 /* GetMetadataForFile.m in Sources */,- 84D6511B2560371600CC2E75 /* main.c in Sources */,+ 1136A44C2FE1B8F700AF40E8 /* main.c in Sources */,);runOnlyForDeploymentPostprocessing = 0;};@@ -832,11 +721,6 @@target = 84D505D625608693005AFC55 /* unziptask */;targetProxy = 84D505E3256086CA005AFC55 /* PBXContainerItemProxy */;};- 84D505E7256086D0005AFC55 /* PBXTargetDependency */ = {- isa = PBXTargetDependency;- target = 84D505D625608693005AFC55 /* unziptask */;- targetProxy = 84D505E6256086D0005AFC55 /* PBXContainerItemProxy */;- };/* End PBXTargetDependency section *//* Begin PBXVariantGroup section */@@ -1394,32 +1278,6 @@};name = Release;};- 84D651112560370B00CC2E75 /* Debug */ = {- isa = XCBuildConfiguration;- buildSettings = {- CODE_SIGN_STYLE = Automatic;- COMBINE_HIDPI_IMAGES = YES;- INFOPLIST_FILE = quicklook/Info.plist;- MARKETING_VERSION = 4.4.0;- PRODUCT_BUNDLE_IDENTIFIER = org.krita.quicklook;- PRODUCT_NAME = "$(TARGET_NAME)";- WRAPPER_EXTENSION = qlgenerator;- };- name = Debug;- };- 84D651122560370B00CC2E75 /* Release */ = {- isa = XCBuildConfiguration;- buildSettings = {- CODE_SIGN_STYLE = Automatic;- COMBINE_HIDPI_IMAGES = YES;- INFOPLIST_FILE = quicklook/Info.plist;- MARKETING_VERSION = 4.4.0;- PRODUCT_BUNDLE_IDENTIFIER = org.krita.quicklook;- PRODUCT_NAME = "$(TARGET_NAME)";- WRAPPER_EXTENSION = qlgenerator;- };- name = Release;- };84D651242560371600CC2E75 /* Debug */ = {isa = XCBuildConfiguration;buildSettings = {@@ -1518,15 +1376,6 @@defaultConfigurationIsVisible = 0;defaultConfigurationName = Release;};- 84D651102560370B00CC2E75 /* Build configuration list for PBXNativeTarget "kritaquicklook" */ = {- isa = XCConfigurationList;- buildConfigurations = (- 84D651112560370B00CC2E75 /* Debug */,- 84D651122560370B00CC2E75 /* Release */,- );- defaultConfigurationIsVisible = 0;- defaultConfigurationName = Release;- };84D651232560371600CC2E75 /* Build configuration list for PBXNativeTarget "kritaspotlight" */ = {isa = XCConfigurationList;buildConfigurations = (diff --git a/krita/integration/quicklook/GeneratePreviewForURL.m b/krita/integration/quicklook/GeneratePreviewForURL.mdeleted file mode 100644index e9ba387d05..0000000000--- a/krita/integration/quicklook/GeneratePreviewForURL.m+++ /dev/null@@ -1,85 +0,0 @@-/*- * This file is part of Krita- *- * Copyright (c) 2015 Algorithmus <[email protected]>- * Copyright (c) 2015 beelzy <[email protected]>- * Copyright (c) 2020 L. E. Segovia <[email protected]>- *- * This program is free software; you can redistribute it and/or modify- * it under the terms of the GNU General Public License as published by- * the Free Software Foundation; either version 2 of the License, or- * (at your option) any later version.- *- * This program is distributed in the hope that it will be useful,- * but WITHOUT ANY WARRANTY; without even the implied warranty of- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- * GNU General Public License for more details.- *- * You should have received a copy of the GNU General Public License- * along with this program; if not, write to the Free Software- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,- * USA.- */--#include "UnzipTask.h"-#import <Cocoa/Cocoa.h>-#include <CoreFoundation/CoreFoundation.h>-#include <CoreServices/CoreServices.h>-#include <QuickLook/QuickLook.h>--OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,- CFURLRef url, CFStringRef contentTypeUTI,- CFDictionaryRef options);-void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview);--/* ------------------------------------------------------------------------------ Generate a preview for file-- This function's job is to create preview for designated file- ------------------------------------------------------------------------------ */--OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,- CFURLRef url, CFStringRef contentTypeUTI,- CFDictionaryRef options) {- @autoreleasepool {- NSData *appPlist =- UnzipTask([(__bridge NSURL *)url path], @"mergedimage.png");-- if (QLPreviewRequestIsCancelled(preview)) {- return noErr;- }-- if ([appPlist length]) {- NSImage *appIcon = [[NSImage alloc] initWithData:appPlist];-- NSImageRep *rep = [[appIcon representations] objectAtIndex:0];-- NSSize canvasSize = NSMakeSize(rep.pixelsWide, rep.pixelsHigh);- NSRect renderRect = NSMakeRect(0.0, 0.0, rep.pixelsWide, rep.pixelsHigh);-- CGContextRef _context =- QLPreviewRequestCreateContext(preview, canvasSize, true, NULL);-- if (_context) {- NSGraphicsContext *_graphicsContext =- [NSGraphicsContext graphicsContextWithGraphicsPort:_context- flipped:NO];-- [NSGraphicsContext setCurrentContext:_graphicsContext];- [appIcon drawInRect:renderRect];-- QLPreviewRequestFlushContext(preview, _context);- CFRelease(_context);- }-- return noErr;- }-- return NSFileNoSuchFileError;- }-}--void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview) {- // Implement only if supported-}diff --git a/krita/integration/quicklook/GenerateThumbnailForURL.m b/krita/integration/quicklook/GenerateThumbnailForURL.mdeleted file mode 100644index fc8c044bf3..0000000000--- a/krita/integration/quicklook/GenerateThumbnailForURL.m+++ /dev/null@@ -1,111 +0,0 @@-/*- * This file is part of Krita- *- * Copyright (c) 2015 Algorithmus <[email protected]>- * Copyright (c) 2015 beelzy <[email protected]>- * Copyright (c) 2020 L. E. Segovia <[email protected]>- *- * This program is free software; you can redistribute it and/or modify- * it under the terms of the GNU General Public License as published by- * the Free Software Foundation; either version 2 of the License, or- * (at your option) any later version.- *- * This program is distributed in the hope that it will be useful,- * but WITHOUT ANY WARRANTY; without even the implied warranty of- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- * GNU General Public License for more details.- *- * You should have received a copy of the GNU General Public License- * along with this program; if not, write to the Free Software- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,- * USA.- */--#include "UnzipTask.h"-#import <Cocoa/Cocoa.h>-#include <CoreFoundation/CoreFoundation.h>-#include <CoreServices/CoreServices.h>-#include <QuickLook/QuickLook.h>--OSStatus GenerateThumbnailForURL(void *thisInterface,- QLThumbnailRequestRef thumbnail, CFURLRef url,- CFStringRef contentTypeUTI,- CFDictionaryRef options, CGSize maxSize);-void CancelThumbnailGeneration(void *thisInterface,- QLThumbnailRequestRef thumbnail);--/* ------------------------------------------------------------------------------ Generate a thumbnail for file-- This function's job is to create thumbnail for designated file as fast as- possible- ------------------------------------------------------------------------------ */--OSStatus GenerateThumbnailForURL(void *thisInterface,- QLThumbnailRequestRef thumbnail, CFURLRef url,- CFStringRef contentTypeUTI,- CFDictionaryRef options, CGSize maxSize) {- @autoreleasepool {- // Allows you to print the name of the extension on top of the thumbnail- // preview. Uncomment and change NULL to properties in- // QLThumbnailRequestSetImage down below to use it.- /*- // Get the UTI properties- NSDictionary* uti_declarations = (- NSDictionary*)UTTypeCopyDeclaration(contentTypeUTI);-- // Get the extensions corresponding to the image UTI, for some UTI there- can be more than 1 extension (ex image.jpeg = jpeg, jpg...)- // If it fails for whatever reason fallback to the filename extension- id extensions = uti_declarations[(__bridge- NSString*)kUTTypeTagSpecificationKey][(__bridge- NSString*)kUTTagClassFilenameExtension]; NSString* extension = ([extensions- isKindOfClass:[NSArray class]]) ? extensions[0] : extensions; if (nil ==- extension) extension = ([(__bridge NSURL*)url pathExtension] != nil) ?- [(__bridge NSURL*)url pathExtension] : @""; extension = [extension- lowercaseString];-- // Create the properties dic- CFTypeRef keys[1] = {kQLThumbnailPropertyExtensionKey};- CFTypeRef values[1] = {(__bridge CFStringRef)extension};- CFDictionaryRef properties = CFDictionaryCreate(kCFAllocatorDefault, (const- void**)keys, (const void**)values, 1, &kCFTypeDictionaryKeyCallBacks,- &kCFTypeDictionaryValueCallBacks);- */-- NSData *appPlist = UnzipTask([(__bridge NSURL *)url path], @"preview.png");-- // Not made with Krita. Find ORA thumbnail instead.- if (appPlist == nil || [appPlist length] == 0) {- appPlist =- UnzipTask([(__bridge NSURL *)url path], @"Thumbnails/thumbnail.png");- }-- if (QLThumbnailRequestIsCancelled(thumbnail)) {- return noErr;- }-- if ([appPlist length]) {- NSImage *appIcon = [[NSImage alloc] initWithData:appPlist];-- NSImageRep *rep = [[appIcon representations] objectAtIndex:0];-- NSRect renderRect = NSMakeRect(0.0, 0.0, rep.pixelsWide, rep.pixelsHigh);-- CGImageRef cgImage =- [appIcon CGImageForProposedRect:&renderRect context:NULL hints:nil];-- QLThumbnailRequestSetImage(thumbnail, cgImage, NULL);- } else {- return NSFileNoSuchFileError;- }-- return noErr;- }-}--void CancelThumbnailGeneration(void *thisInterface,- QLThumbnailRequestRef thumbnail) {- // Implement only if supported-}diff --git a/krita/integration/quicklook/Info.plist b/krita/integration/quicklook/Info.plistdeleted file mode 100644index 9c1a153c4d..0000000000--- a/krita/integration/quicklook/Info.plist+++ /dev/null@@ -1,161 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">-<plist version="1.0">-<dict>- <key>CFBundleDevelopmentRegion</key>- <string>en</string>- <key>CFBundleDocumentTypes</key>- <array>- <dict>- <key>CFBundleTypeRole</key>- <string>QLGenerator</string>- <key>LSItemContentTypes</key>- <array>- <string>dyn.ah62d4rv4ge8006xb</string>- <string>org.krita.kra</string>- <string>org.krita.ora</string>- </array>- </dict>- </array>- <key>CFBundleExecutable</key>- <string>$(EXECUTABLE_NAME)</string>- <key>CFBundleIdentifier</key>- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>- <key>CFBundlePackageType</key>- <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>- <key>CFBundleInfoDictionaryVersion</key>- <string>6.0</string>- <key>CFBundleName</key>- <string>$(PRODUCT_NAME)</string>- <key>CFBundleShortVersionString</key>- <string>$(MARKETING_VERSION)</string>- <key>CFBundleSignature</key>- <string>????</string>- <key>CFBundleVersion</key>- <string>1</string>- <key>CFPlugInDynamicRegisterFunction</key>- <string></string>- <key>CFPlugInDynamicRegistration</key>- <string>NO</string>- <key>CFPlugInFactories</key>- <dict>- <key>292DC9CD-1640-49AE-B0C1-308ED88E6677</key>- <string>QuickLookGeneratorPluginFactory</string>- </dict>- <key>CFPlugInTypes</key>- <dict>- <key>5E2D9680-5022-40FA-B806-43349622E5B9</key>- <array>- <string>292DC9CD-1640-49AE-B0C1-308ED88E6677</string>- </array>- </dict>- <key>CFPlugInUnloadFunction</key>- <string></string>- <key>NSHumanReadableCopyright</key>- <string>Copyright © 2015-2020 Stichting Krita Foundation. All rights reserved.</string>- <key>QLNeedsToBeRunInMainThread</key>- <false/>- <key>QLPreviewHeight</key>- <real>600</real>- <key>QLPreviewWidth</key>- <real>800</real>- <key>QLSupportsConcurrentRequests</key>- <false/>- <key>QLThumbnailMinimumSize</key>- <real>17</real>- <key>UTExportedTypeDeclarations</key>- <array>- <dict>- <key>UTTypeConformsTo</key>- <array>- <string>public.image</string>- </array>- <key>UTTypeDescription</key>- <string>Krita 3.0 Image</string>- <key>UTTypeIdentifier</key>- <string>dyn.ah62d4rv4ge8006xb</string>- <key>UTTypeTagSpecification</key>- <dict>- <key>public.filename-extension</key>- <array>- <string>kra</string>- <string>KRA</string>- </array>- <key>public.mime-type</key>- <array>- <string>application/x-krita</string>- </array>- </dict>- </dict>- <dict>- <key>UTTypeConformsTo</key>- <array>- <string>public.image</string>- </array>- <key>UTTypeDescription</key>- <string>Open Raster Image</string>- <key>UTTypeIdentifier</key>- <string>dyn.ah62d4rv4ge8006xb</string>- <key>UTTypeTagSpecification</key>- <dict>- <key>public.filename-extension</key>- <array>- <string>ora</string>- <string>ORA</string>- </array>- <key>public.mime-type</key>- <array>- <string>image/openraster</string>- </array>- </dict>- </dict>- </array>- <key>UTImportedTypeDeclarations</key>- <array>- <dict>- <key>UTTypeConformsTo</key>- <array>- <string>public.image</string>- </array>- <key>UTTypeDescription</key>- <string>Krita 3.0 Image</string>- <key>UTTypeIdentifier</key>- <string>org.krita.kra</string>- <key>UTTypeTagSpecification</key>- <dict>- <key>public.filename-extension</key>- <array>- <string>kra</string>- <string>KRA</string>- </array>- <key>public.mime-type</key>- <array>- <string>application/x-krita</string>- </array>- </dict>- </dict>- <dict>- <key>UTTypeConformsTo</key>- <array>- <string>public.image</string>- </array>- <key>UTTypeDescription</key>- <string>Open Raster Image</string>- <key>UTTypeIdentifier</key>- <string>org.krita.ora</string>- <key>UTTypeTagSpecification</key>- <dict>- <key>public.filename-extension</key>- <array>- <string>ora</string>- <string>ORA</string>- </array>- <key>public.mime-type</key>- <array>- <string>image/openraster</string>- </array>- </dict>- </dict>- </array>-</dict>-</plist>diff --git a/krita/integration/quicklook/main.c b/krita/integration/quicklook/main.cdeleted file mode 100644index 448f116978..0000000000--- a/krita/integration/quicklook/main.c+++ /dev/null@@ -1,231 +0,0 @@-/*- * This file is part of Krita- *- * SPDX-FileCopyrightText: 2015 Algorithmus <[email protected]>- * SPDX-FileCopyrightText: 2015 beelzy <[email protected]>- * SPDX-FileCopyrightText: 2020 L. E. Segovia <[email protected]>- *- * SPDX-License-Identifier: GPL-2.0-or-later- *- */--/* clang-format off */--//==============================================================================-//-// DO NO MODIFY THE CONTENT OF THIS FILE-//-// This file contains the generic CFPlug-in code necessary for your generator-// To complete your generator implement the function in GenerateThumbnailForURL/GeneratePreviewForURL.c-//-//==============================================================================-------#include <CoreFoundation/CoreFoundation.h>-#include <CoreFoundation/CFPlugInCOM.h>-#include <CoreServices/CoreServices.h>-#include <QuickLook/QuickLook.h>--// ------------------------------------------------------------------------------// constants-// -------------------------------------------------------------------------------// Don't modify this line-#define PLUGIN_ID "292DC9CD-1640-49AE-B0C1-308ED88E6677"--//-// Below is the generic glue code for all plug-ins.-//-// You should not have to modify this code aside from changing-// names if you decide to change the names defined in the Info.plist-//---// ------------------------------------------------------------------------------// typedefs-// -------------------------------------------------------------------------------// The thumbnail generation function to be implemented in GenerateThumbnailForURL.c-OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thumbnail, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options, CGSize maxSize);-void CancelThumbnailGeneration(void* thisInterface, QLThumbnailRequestRef thumbnail);--// The preview generation function to be implemented in GeneratePreviewForURL.c-OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options);-void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview);--// The layout for an instance of QuickLookGeneratorPlugIn-typedef struct __QuickLookGeneratorPluginType-{- void *conduitInterface;- CFUUIDRef factoryID;- UInt32 refCount;-} QuickLookGeneratorPluginType;--// ------------------------------------------------------------------------------// prototypes-// ------------------------------------------------------------------------------// Forward declaration for the IUnknown implementation.-//--QuickLookGeneratorPluginType *AllocQuickLookGeneratorPluginType(CFUUIDRef inFactoryID);-void DeallocQuickLookGeneratorPluginType(QuickLookGeneratorPluginType *thisInstance);-HRESULT QuickLookGeneratorQueryInterface(void *thisInstance,REFIID iid,LPVOID *ppv);-void *QuickLookGeneratorPluginFactory(CFAllocatorRef allocator,CFUUIDRef typeID);-ULONG QuickLookGeneratorPluginAddRef(void *thisInstance);-ULONG QuickLookGeneratorPluginRelease(void *thisInstance);--// ------------------------------------------------------------------------------// myInterfaceFtbl definition-// ------------------------------------------------------------------------------// The QLGeneratorInterfaceStruct function table.-//-static QLGeneratorInterfaceStruct myInterfaceFtbl = {- NULL,- QuickLookGeneratorQueryInterface,- QuickLookGeneratorPluginAddRef,- QuickLookGeneratorPluginRelease,- NULL,- NULL,- NULL,- NULL-};---// ------------------------------------------------------------------------------// AllocQuickLookGeneratorPluginType-// ------------------------------------------------------------------------------// Utility function that allocates a new instance.-// You can do some initial setup for the generator here if you wish-// like allocating globals etc...-//-QuickLookGeneratorPluginType *AllocQuickLookGeneratorPluginType(CFUUIDRef inFactoryID)-{- QuickLookGeneratorPluginType *theNewInstance;-- theNewInstance = (QuickLookGeneratorPluginType *)malloc(sizeof(QuickLookGeneratorPluginType));- memset(theNewInstance,0,sizeof(QuickLookGeneratorPluginType));-- /* Point to the function table Malloc enough to store the stuff and copy the filler from myInterfaceFtbl over */- theNewInstance->conduitInterface = malloc(sizeof(QLGeneratorInterfaceStruct));- memcpy(theNewInstance->conduitInterface,&myInterfaceFtbl,sizeof(QLGeneratorInterfaceStruct));-- /* Retain and keep an open instance refcount for each factory. */- theNewInstance->factoryID = CFRetain(inFactoryID);- CFPlugInAddInstanceForFactory(inFactoryID);-- /* This function returns the IUnknown interface so set the refCount to one. */- theNewInstance->refCount = 1;- return theNewInstance;-}--// ------------------------------------------------------------------------------// DeallocQuickLookGeneratorPluginType-// ------------------------------------------------------------------------------// Utility function that deallocates the instance when-// the refCount goes to zero.-// In the current implementation generator interfaces are never deallocated-// but implement this as this might change in the future-//-void DeallocQuickLookGeneratorPluginType(QuickLookGeneratorPluginType *thisInstance)-{- CFUUIDRef theFactoryID;-- theFactoryID = thisInstance->factoryID;- /* Free the conduitInterface table up */- free(thisInstance->conduitInterface);-- /* Free the instance structure */- free(thisInstance);- if (theFactoryID){- CFPlugInRemoveInstanceForFactory(theFactoryID);- CFRelease(theFactoryID);- }-}--// ------------------------------------------------------------------------------// QuickLookGeneratorQueryInterface-// ------------------------------------------------------------------------------// Implementation of the IUnknown QueryInterface function.-//-HRESULT QuickLookGeneratorQueryInterface(void *thisInstance,REFIID iid,LPVOID *ppv)-{- CFUUIDRef interfaceID;-- interfaceID = CFUUIDCreateFromUUIDBytes(kCFAllocatorDefault,iid);-- if (CFEqual(interfaceID,kQLGeneratorCallbacksInterfaceID)){- /* If the Right interface was requested, bump the ref count,- * set the ppv parameter equal to the instance, and- * return good status.- */- ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->GenerateThumbnailForURL = GenerateThumbnailForURL;- ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->CancelThumbnailGeneration = CancelThumbnailGeneration;- ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->GeneratePreviewForURL = GeneratePreviewForURL;- ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->CancelPreviewGeneration = CancelPreviewGeneration;- ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType*)thisInstance)->conduitInterface)->AddRef(thisInstance);- *ppv = thisInstance;- CFRelease(interfaceID);- return S_OK;- }else{- /* Requested interface unknown, bail with error. */- *ppv = NULL;- CFRelease(interfaceID);- return E_NOINTERFACE;- }-}--// ------------------------------------------------------------------------------// QuickLookGeneratorPluginAddRef-// ------------------------------------------------------------------------------// Implementation of reference counting for this type. Whenever an interface-// is requested, bump the refCount for the instance. NOTE: returning the-// refcount is a convention but is not required so don't rely on it.-//-ULONG QuickLookGeneratorPluginAddRef(void *thisInstance)-{- ((QuickLookGeneratorPluginType *)thisInstance )->refCount += 1;- return ((QuickLookGeneratorPluginType*) thisInstance)->refCount;-}--// ------------------------------------------------------------------------------// QuickLookGeneratorPluginRelease-// ------------------------------------------------------------------------------// When an interface is released, decrement the refCount.-// If the refCount goes to zero, deallocate the instance.-//-ULONG QuickLookGeneratorPluginRelease(void *thisInstance)-{- ((QuickLookGeneratorPluginType*)thisInstance)->refCount -= 1;- if (((QuickLookGeneratorPluginType*)thisInstance)->refCount == 0){- DeallocQuickLookGeneratorPluginType((QuickLookGeneratorPluginType*)thisInstance );- return 0;- }else{- return ((QuickLookGeneratorPluginType*) thisInstance )->refCount;- }-}--// ------------------------------------------------------------------------------// QuickLookGeneratorPluginFactory-// ------------------------------------------------------------------------------void *QuickLookGeneratorPluginFactory(CFAllocatorRef allocator,CFUUIDRef typeID)-{- QuickLookGeneratorPluginType *result;- CFUUIDRef uuid;-- /* If correct type is being requested, allocate an- * instance of kQLGeneratorTypeID and return the IUnknown interface.- */- if (CFEqual(typeID,kQLGeneratorTypeID)){- uuid = CFUUIDCreateFromString(kCFAllocatorDefault,CFSTR(PLUGIN_ID));- result = AllocQuickLookGeneratorPluginType(uuid);- CFRelease(uuid);- return result;- }- /* If the requested type is incorrect, return NULL. */- return NULL;-}-diff --git a/packaging/macos/macos-deploy.py b/packaging/macos/macos-deploy.pyindex 51a9fff7c1..d3815e80d7 100644--- a/packaging/macos/macos-deploy.py+++ b/packaging/macos/macos-deploy.py@@ -429,19 +429,13 @@ def kritaDeploy(from_install: pathlib.Path, dst: pathlib.Path, source: pathlib.Pshutil.copy2(file,krita_app['frameworks'], follow_symlinks=False)print("Copying plugins...")- extra_args = '--delete --delete-excluded --exclude kritaquicklook.qlgenerator --exclude kritaspotlight.mdimporter'+ extra_args = '--delete --delete-excluded --exclude kritaspotlight.mdimporter'copyDirSub(krita_install_dir.joinpath('plugins'), krita_app['plugins'], extra_args=extra_args.split())plugins = []- krita_app_qlook = krita_app['contents'].joinpath('Library','QuickLook')krita_app_spotlight = krita_app['contents'].joinpath('Library', 'Spotlight')-- krita_app_qlook.mkdir(parents=True)krita_app_spotlight.mkdir(parents=True)- plugins.append('QuickLook')- copyDirSub(krita_install_dir.joinpath('plugins','kritaquicklook.qlgenerator'),krita_app_qlook,- only_contents=False)plugins.append('Spotlight')copyDirSub(krita_install_dir.joinpath('plugins', 'kritaspotlight.mdimporter'), krita_app_spotlight,only_contents=False)@@ -554,7 +548,7 @@ def kritaDeploy(from_install: pathlib.Path, dst: pathlib.Path, source: pathlib.P# TODO: remove after move to Qt6, those plugins are not compatible with macOS>=12- # fixes kritaspotlight and kritaquicklook binaries+ # fixes kritaspotlight binariesfilesToFix = [f for f in krita_app['contents'].joinpath('Library').rglob('*/Contents/MacOS/*') if(f.is_file() and stat.S_IMODE(f.stat().st_mode) & 0o111)]for f in filesToFix:diff --git a/packaging/macos/macos_signdmg.py b/packaging/macos/macos_signdmg.pyindex a9d8b4223b..370a13cdcd 100644--- a/packaging/macos/macos_signdmg.py+++ b/packaging/macos/macos_signdmg.py@@ -223,37 +223,28 @@ def fix_bundle(bundle_root: pathlib.Path, bundle_version: str="", for_store: boodef fix_krita_plists(krita_app: pathlib.Path, bundle_id: str, version: str, build_version: str):macosx_deployment_target = '10.15' if version.startswith('5') else '12'- appex_plugins_deployment_target = '10.15'kritaspotlight = pathlib.Path(krita_app, 'Contents', 'Library','Spotlight', 'kritaspotlight.mdimporter', 'Contents')- kritaquicklook = pathlib.Path(krita_app, 'Contents', 'Library', 'Quicklook', 'kritaquicklook.qlgenerator', 'Contents')krita_thumbnailer = pathlib.Path(krita_app, 'Contents', 'Plugins', 'krita-thumbnailer.appex', 'Contents')krita_preview = pathlib.Path(krita_app, 'Contents', 'Plugins', 'krita-preview.appex', 'Contents')plists = dict()plists['krita'] = PlistBuddyModifier(pathlib.Path(krita_app, 'Contents', 'Info.plist'))plists['spotlight'] = PlistBuddyModifier(pathlib.Path(kritaspotlight, 'Info.plist'))- plists['quicklook'] = PlistBuddyModifier(pathlib.Path(kritaquicklook, 'Info.plist'))plists['thumbnailer'] = PlistBuddyModifier(pathlib.Path(krita_thumbnailer, 'Info.plist'))plists['preview'] = PlistBuddyModifier(pathlib.Path(krita_preview, 'Info.plist'))# modify plist contentsplists['krita'].set('CFBundleIdentifier', bundle_id)plists['krita'].set('CFBundleLongVersionString', version)- plists['krita'].set('LSMinimumSystemVersion', macosx_deployment_target)plists['spotlight'].set('CFBundleIdentifier', bundle_id + '.spotlight')- plists['quicklook'].set('CFBundleIdentifier', bundle_id + '.kritaquicklook')plists['thumbnailer'].set('CFBundleIdentifier', bundle_id + '.krita-thumbnailer')plists['preview'].set('CFBundleIdentifier', bundle_id + '.krita-preview')- plists['spotlight'].set('LSMinimumSystemVersion', macosx_deployment_target)- plists['quicklook'].set('LSMinimumSystemVersion', macosx_deployment_target)- plists['thumbnailer'].set('LSMinimumSystemVersion', appex_plugins_deployment_target)- plists['preview'].set('LSMinimumSystemVersion', appex_plugins_deployment_target)-# common keysfor plist in plists.values():+ plist.set('LSMinimumSystemVersion', macosx_deployment_target)plist.set('CFBundleVersion', build_version)plist.set('CFBundleShortVersionString', version)@@ -298,7 +289,6 @@ def sign_bundle(bundle_root: pathlib.Path, signer: Codesigner, entitlements_pathresources_root = content_root.joinpath('Resources')targets.extend([f for f in resources_root.rglob('*') if f.is_file() and (stat.S_IMODE(f.stat().st_mode) & 0o111 > 0)])- targets.append(content_root.joinpath('Library', 'QuickLook', 'kritaquicklook.qlgenerator'))targets.append(content_root.joinpath('Library', 'Spotlight', 'kritaspotlight.mdimporter'))signer.add(targets, entitlements.general)@@ -350,7 +340,6 @@ def verify_bundle(bundle: pathlib.Path) -> bool:print(f'missing signature: {element}')check_pkg = [f for f in bundle.rglob('*.framework')]- check_pkg.append(bundle.joinpath('Contents', 'Library', 'Quicklook', 'kritaquicklook.qlgenerator'))check_pkg.append(bundle.joinpath('Contents', 'Library', 'Spotlight', 'kritaspotlight.mdimporter'))check_pkg.append(bundle.joinpath('Contents', 'PlugIns', 'krita-thumbnailer.appex'))check_pkg.append(bundle.joinpath('Contents', 'PlugIns', 'krita-preview.appex'))