Revision: 16026
http://sourceforge.net/p/skim-app/code/16026
Author: hofman
Date: 2026-01-27 22:25:05 +0000 (Tue, 27 Jan 2026)
Log Message:
-----------
reuse bundle variable, get image from url
Modified Paths:
--------------
trunk/QuickLook-Skim/GenerateThumbnailForURL.m
Modified: trunk/QuickLook-Skim/GenerateThumbnailForURL.m
===================================================================
--- trunk/QuickLook-Skim/GenerateThumbnailForURL.m 2026-01-26 23:22:54 UTC
(rev 16025)
+++ trunk/QuickLook-Skim/GenerateThumbnailForURL.m 2026-01-27 22:25:05 UTC
(rev 16026)
@@ -47,14 +47,14 @@
static const NSRect _iconRect = (NSRect) { { 50, 140 }, { 512, 512 } };
// wash the app icon over a white page background
-static void
drawBackgroundAndApplicationIconInCurrentContext(QLThumbnailRequestRef
thumbnail)
+static void drawBackgroundAndApplicationIconInCurrentContext(CFBundleRef
bundle)
{
[[NSColor whiteColor] setFill];
NSRect pageRect = { NSZeroPoint, _paperSize };
NSRectFillUsingOperation(pageRect, NSCompositingOperationSourceOver);
- NSURL *iconURL = (NSURL
*)CFBridgingRelease(CFBundleCopyResourceURL(QLThumbnailRequestGetGeneratorBundle(thumbnail),
CFSTR("Skim"), CFSTR("png"), NULL));
- NSImage *appIcon = [[NSImage alloc] initWithContentsOfFile:[iconURL path]];
+ NSURL *iconURL = (NSURL
*)CFBridgingRelease(CFBundleCopyResourceURL(bundle, CFSTR("Skim"),
CFSTR("png"), NULL));
+ NSImage *appIcon = [[NSImage alloc] initWithContentsOfURL:iconURL];
[appIcon drawInRect:_iconRect fromRect:NSZeroRect
operation:NSCompositingOperationSourceOver fraction:0.3];
}
@@ -202,8 +202,9 @@
NSData *data = [[NSData alloc] initWithContentsOfURL:(__bridge
NSURL *)url options:NSDataReadingUncached error:NULL];
if (data) {
+ CFBundleRef bundle =
QLThumbnailRequestGetGeneratorBundle(thumbnail);
NSArray *notes = [SKQLConverter notesWithData:data];
- NSAttributedString *attrString = [SKQLConverter
attributedStringWithNotes:notes
bundle:QLThumbnailRequestGetGeneratorBundle(thumbnail)];
+ NSAttributedString *attrString = [SKQLConverter
attributedStringWithNotes:notes bundle:bundle];
if (attrString) {
CGContextRef ctxt =
QLThumbnailRequestCreateContext(thumbnail, *(CGSize *)&_paperSize, FALSE, NULL);
@@ -211,7 +212,7 @@
[NSGraphicsContext saveGraphicsState];
[NSGraphicsContext setCurrentContext:nsContext];
-
drawBackgroundAndApplicationIconInCurrentContext(thumbnail);
+ drawBackgroundAndApplicationIconInCurrentContext(bundle);
drawAttributedStringInCurrentContext(attrString);
QLThumbnailRequestFlushContext(thumbnail, ctxt);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit