From 3d4f9a140cdb870245e738320de6328abcc60c15 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 12 Aug 2012 16:19:06 +0000 Subject: [PATCH] modify the Quick Look plugin's main.c --- Transmission.xcodeproj/project.pbxproj | 2 +- macosx/QuickLookPlugin/main.c | 44 +++++++++++++------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index 022d6c5fe..143e777c2 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -1108,7 +1108,7 @@ A2F35BC715C5A0A100EBF632 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; A2F35BC915C5A0A100EBF632 /* GenerateThumbnailForURL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = GenerateThumbnailForURL.m; path = macosx/QuickLookPlugin/GenerateThumbnailForURL.m; sourceTree = SOURCE_ROOT; }; A2F35BCB15C5A0A100EBF632 /* GeneratePreviewForURL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = GeneratePreviewForURL.m; path = macosx/QuickLookPlugin/GeneratePreviewForURL.m; sourceTree = SOURCE_ROOT; }; - A2F35BCD15C5A0A100EBF632 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = main.c; path = macosx/QuickLookPlugin/main.c; sourceTree = SOURCE_ROOT; }; + A2F35BCD15C5A0A100EBF632 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = main.c; path = macosx/QuickLookPlugin/main.c; sourceTree = ""; }; A2F35BCF15C5A0A100EBF632 /* QuickLookPlugin-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "QuickLookPlugin-Prefix.pch"; path = "macosx/QuickLookPlugin/QuickLookPlugin-Prefix.pch"; sourceTree = SOURCE_ROOT; }; A2F35BE015C5A7ED00EBF632 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; A2F35BE215C5A7F900EBF632 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; diff --git a/macosx/QuickLookPlugin/main.c b/macosx/QuickLookPlugin/main.c index 7345f8fc2..5f23c2161 100644 --- a/macosx/QuickLookPlugin/main.c +++ b/macosx/QuickLookPlugin/main.c @@ -92,19 +92,19 @@ static QLGeneratorInterfaceStruct myInterfaceFtbl = { 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 */ + + /* 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. */ + + /* 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. */ + + /* This function returns the IUnknown interface so set the refCount to one. */ theNewInstance->refCount = 1; return theNewInstance; } @@ -120,12 +120,12 @@ QuickLookGeneratorPluginType *AllocQuickLookGeneratorPluginType(CFUUIDRef inFact void DeallocQuickLookGeneratorPluginType(QuickLookGeneratorPluginType *thisInstance) { CFUUIDRef theFactoryID; - + theFactoryID = thisInstance->factoryID; - /* Free the conduitInterface table up */ + /* Free the conduitInterface table up */ free(thisInstance->conduitInterface); - - /* Free the instance structure */ + + /* Free the instance structure */ free(thisInstance); if (theFactoryID){ CFPlugInRemoveInstanceForFactory(theFactoryID); @@ -141,14 +141,14 @@ void DeallocQuickLookGeneratorPluginType(QuickLookGeneratorPluginType *thisInsta 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. - */ + /* 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; @@ -202,17 +202,17 @@ 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 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. */ + /* If the requested type is incorrect, return NULL. */ return NULL; } -- 2.40.0