Changeset 13430


Ignore:
Timestamp:
Aug 12, 2012, 4:19:06 PM (9 years ago)
Author:
livings124
Message:

modify the Quick Look plugin's main.c

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r13429 r13430  
    11091109                A2F35BC915C5A0A100EBF632 /* GenerateThumbnailForURL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = GenerateThumbnailForURL.m; path = macosx/QuickLookPlugin/GenerateThumbnailForURL.m; sourceTree = SOURCE_ROOT; };
    11101110                A2F35BCB15C5A0A100EBF632 /* GeneratePreviewForURL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = GeneratePreviewForURL.m; path = macosx/QuickLookPlugin/GeneratePreviewForURL.m; sourceTree = SOURCE_ROOT; };
    1111                 A2F35BCD15C5A0A100EBF632 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = main.c; path = macosx/QuickLookPlugin/main.c; sourceTree = SOURCE_ROOT; };
     1111                A2F35BCD15C5A0A100EBF632 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = main.c; path = macosx/QuickLookPlugin/main.c; sourceTree = "<group>"; };
    11121112                A2F35BCF15C5A0A100EBF632 /* QuickLookPlugin-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "QuickLookPlugin-Prefix.pch"; path = "macosx/QuickLookPlugin/QuickLookPlugin-Prefix.pch"; sourceTree = SOURCE_ROOT; };
    11131113                A2F35BE015C5A7ED00EBF632 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
  • trunk/macosx/QuickLookPlugin/main.c

    r13423 r13430  
    9393{
    9494    QuickLookGeneratorPluginType *theNewInstance;
    95 
     95   
    9696    theNewInstance = (QuickLookGeneratorPluginType *)malloc(sizeof(QuickLookGeneratorPluginType));
    9797    memset(theNewInstance,0,sizeof(QuickLookGeneratorPluginType));
    98 
    99         /* Point to the function table Malloc enough to store the stuff and copy the filler from myInterfaceFtbl over */
     98   
     99    /* Point to the function table Malloc enough to store the stuff and copy the filler from myInterfaceFtbl over */
    100100    theNewInstance->conduitInterface = malloc(sizeof(QLGeneratorInterfaceStruct));
    101101    memcpy(theNewInstance->conduitInterface,&myInterfaceFtbl,sizeof(QLGeneratorInterfaceStruct));
    102 
    103         /*  Retain and keep an open instance refcount for each factory. */
     102   
     103    /*  Retain and keep an open instance refcount for each factory. */
    104104    theNewInstance->factoryID = CFRetain(inFactoryID);
    105105    CFPlugInAddInstanceForFactory(inFactoryID);
    106 
    107         /* This function returns the IUnknown interface so set the refCount to one. */
     106   
     107    /* This function returns the IUnknown interface so set the refCount to one. */
    108108    theNewInstance->refCount = 1;
    109109    return theNewInstance;
     
    121121{
    122122    CFUUIDRef theFactoryID;
    123 
     123   
    124124    theFactoryID = thisInstance->factoryID;
    125         /* Free the conduitInterface table up */
     125    /* Free the conduitInterface table up */
    126126    free(thisInstance->conduitInterface);
    127 
    128         /* Free the instance structure */
     127   
     128    /* Free the instance structure */
    129129    free(thisInstance);
    130130    if (theFactoryID){
     
    142142{
    143143    CFUUIDRef interfaceID;
    144 
     144   
    145145    interfaceID = CFUUIDCreateFromUUIDBytes(kCFAllocatorDefault,iid);
    146 
     146   
    147147    if (CFEqual(interfaceID,kQLGeneratorCallbacksInterfaceID)){
    148             /* If the Right interface was requested, bump the ref count,
    149              * set the ppv parameter equal to the instance, and
    150              * return good status.
    151              */
     148        /* If the Right interface was requested, bump the ref count,
     149         * set the ppv parameter equal to the instance, and
     150         * return good status.
     151         */
    152152        ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->GenerateThumbnailForURL = GenerateThumbnailForURL;
    153153        ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->CancelThumbnailGeneration = CancelThumbnailGeneration;
     
    203203    QuickLookGeneratorPluginType *result;
    204204    CFUUIDRef                 uuid;
    205 
    206         /* If correct type is being requested, allocate an
    207          * instance of kQLGeneratorTypeID and return the IUnknown interface.
    208          */
     205   
     206    /* If correct type is being requested, allocate an
     207     * instance of kQLGeneratorTypeID and return the IUnknown interface.
     208     */
    209209    if (CFEqual(typeID,kQLGeneratorTypeID)){
    210210        uuid = CFUUIDCreateFromString(kCFAllocatorDefault,CFSTR(PLUGIN_ID));
     
    213213        return result;
    214214    }
    215         /* If the requested type is incorrect, return NULL. */
     215    /* If the requested type is incorrect, return NULL. */
    216216    return NULL;
    217217}
Note: See TracChangeset for help on using the changeset viewer.