Revision: 3253
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3253&view=rev
Author:   hofman
Date:     2007-11-24 12:10:44 -0800 (Sat, 24 Nov 2007)

Log Message:
-----------
Add all images used in quicklook html instead of overwriting them all.

Modified Paths:
--------------
    trunk/QuickLook-Skim/GeneratePreviewForURL.m

Modified: trunk/QuickLook-Skim/GeneratePreviewForURL.m
===================================================================
--- trunk/QuickLook-Skim/GeneratePreviewForURL.m        2007-11-24 19:42:23 UTC 
(rev 3252)
+++ trunk/QuickLook-Skim/GeneratePreviewForURL.m        2007-11-24 20:10:44 UTC 
(rev 3253)
@@ -123,69 +123,71 @@
             [htmlString appendString:@"</dl></body></html>"];
             
             NSMutableDictionary *props = [[NSMutableDictionary alloc] init];
-            [props setObject:@"UTF-8" forKey:(NSString 
*)kQLPreviewPropertyTextEncodingNameKey];
-            [props setObject:@"text/html" forKey:(NSString 
*)kQLPreviewPropertyMIMETypeKey];            
-            
+            NSMutableDictionary *attachmentProps = [[NSMutableDictionary 
alloc] init];
+            NSMutableDictionary *imgProps;
             NSBundle *bundle = [NSBundle 
bundleWithIdentifier:@"net.sourceforge.skim-app.quicklookgenerator"];
-            NSMutableDictionary *imgProps;
             NSImage *image;
             
             imgProps = [[NSMutableDictionary alloc] init];
             image = [NSData dataWithContentsOfFile:[bundle 
pathForResource:@"FreeText" ofType:@"png"]];
             [imgProps setObject:@"image/png" forKey:(NSString 
*)kQLPreviewPropertyMIMETypeKey];
             [imgProps setObject:image forKey:(NSString 
*)kQLPreviewPropertyAttachmentDataKey];
-            [props setObject:[NSDictionary dictionaryWithObject:imgProps 
forKey:@"FreeText.png"] forKey:(NSString *)kQLPreviewPropertyAttachmentsKey];
+            [attachmentProps setObject:imgProps forKey:@"FreeText.png"];
             [imgProps release];
             
             imgProps = [[NSMutableDictionary alloc] init];
             image = [NSData dataWithContentsOfFile:[bundle 
pathForResource:@"Note" ofType:@"png"]];
             [imgProps setObject:@"image/png" forKey:(NSString 
*)kQLPreviewPropertyMIMETypeKey];
             [imgProps setObject:image forKey:(NSString 
*)kQLPreviewPropertyAttachmentDataKey];
-            [props setObject:[NSDictionary dictionaryWithObject:imgProps 
forKey:@"Note.png"] forKey:(NSString *)kQLPreviewPropertyAttachmentsKey];
+            [attachmentProps setObject:imgProps forKey:@"Note.png"];
             [imgProps release];
             
             imgProps = [[NSMutableDictionary alloc] init];
             image = [NSData dataWithContentsOfFile:[bundle 
pathForResource:@"Circle" ofType:@"png"]];
             [imgProps setObject:@"image/png" forKey:(NSString 
*)kQLPreviewPropertyMIMETypeKey];
             [imgProps setObject:image forKey:(NSString 
*)kQLPreviewPropertyAttachmentDataKey];
-            [props setObject:[NSDictionary dictionaryWithObject:imgProps 
forKey:@"Circle.png"] forKey:(NSString *)kQLPreviewPropertyAttachmentsKey];
+            [attachmentProps setObject:imgProps forKey:@"Circle.png"];
             [imgProps release];
             
             imgProps = [[NSMutableDictionary alloc] init];
             image = [NSData dataWithContentsOfFile:[bundle 
pathForResource:@"Square" ofType:@"png"]];
             [imgProps setObject:@"image/png" forKey:(NSString 
*)kQLPreviewPropertyMIMETypeKey];
             [imgProps setObject:image forKey:(NSString 
*)kQLPreviewPropertyAttachmentDataKey];
-            [props setObject:[NSDictionary dictionaryWithObject:imgProps 
forKey:@"Square.png"] forKey:(NSString *)kQLPreviewPropertyAttachmentsKey];
+            [attachmentProps setObject:imgProps forKey:@"Square.png"];
             [imgProps release];
             
             imgProps = [[NSMutableDictionary alloc] init];
             image = [NSData dataWithContentsOfFile:[bundle 
pathForResource:@"Highlight" ofType:@"png"]];
             [imgProps setObject:@"image/png" forKey:(NSString 
*)kQLPreviewPropertyMIMETypeKey];
             [imgProps setObject:image forKey:(NSString 
*)kQLPreviewPropertyAttachmentDataKey];
-            [props setObject:[NSDictionary dictionaryWithObject:imgProps 
forKey:@"Highlight.png"] forKey:(NSString *)kQLPreviewPropertyAttachmentsKey];
+            [attachmentProps setObject:imgProps forKey:@"Highlight.png"];
             [imgProps release];
             
             imgProps = [[NSMutableDictionary alloc] init];
             image = [NSData dataWithContentsOfFile:[bundle 
pathForResource:@"Underline" ofType:@"png"]];
             [imgProps setObject:@"image/png" forKey:(NSString 
*)kQLPreviewPropertyMIMETypeKey];
             [imgProps setObject:image forKey:(NSString 
*)kQLPreviewPropertyAttachmentDataKey];
-            [props setObject:[NSDictionary dictionaryWithObject:imgProps 
forKey:@"Underline.png"] forKey:(NSString *)kQLPreviewPropertyAttachmentsKey];
+            [attachmentProps setObject:imgProps forKey:@"Underline.png"];
             [imgProps release];
             
             imgProps = [[NSMutableDictionary alloc] init];
             image = [NSData dataWithContentsOfFile:[bundle 
pathForResource:@"StrikeOut" ofType:@"png"]];
             [imgProps setObject:@"image/png" forKey:(NSString 
*)kQLPreviewPropertyMIMETypeKey];
             [imgProps setObject:image forKey:(NSString 
*)kQLPreviewPropertyAttachmentDataKey];
-            [props setObject:[NSDictionary dictionaryWithObject:imgProps 
forKey:@"StrikeOut.png"] forKey:(NSString *)kQLPreviewPropertyAttachmentsKey];
+            [attachmentProps setObject:imgProps forKey:@"StrikeOut.png"];
             [imgProps release];
             
             imgProps = [[NSMutableDictionary alloc] init];
             image = [NSData dataWithContentsOfFile:[bundle 
pathForResource:@"Line" ofType:@"png"]];
             [imgProps setObject:@"image/png" forKey:(NSString 
*)kQLPreviewPropertyMIMETypeKey];
             [imgProps setObject:image forKey:(NSString 
*)kQLPreviewPropertyAttachmentDataKey];
-            [props setObject:[NSDictionary dictionaryWithObject:imgProps 
forKey:@"Line.png"] forKey:(NSString *)kQLPreviewPropertyAttachmentsKey];
+            [attachmentProps setObject:imgProps forKey:@"Line.png"];
             [imgProps release];
             
+            [props setObject:attachmentProps forKey:(NSString 
*)kQLPreviewPropertyAttachmentsKey];
+            [props setObject:@"UTF-8" forKey:(NSString 
*)kQLPreviewPropertyTextEncodingNameKey];
+            [props setObject:@"text/html" forKey:(NSString 
*)kQLPreviewPropertyMIMETypeKey];            
+            
             
QLPreviewRequestSetDataRepresentation(preview,(CFDataRef)[htmlString 
dataUsingEncoding:NSUTF8StringEncoding], kUTTypeHTML, (CFDictionaryRef)props);
             
             [htmlString release];
@@ -195,6 +197,7 @@
             err = 2;
         }
         
+static OSStatus hotKeyEventHandler(EventHandlerCallRef inHandlerRef, EventRef 
inEvent, void* refCon );
     }
     
     [pool release];


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to