Check-in [520d701489]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1 Hash:520d701489fef37b7e625430a80efb2038e0c18e
Date: 2009-10-30 23:28:50
User: dmitry
Comment:Increase number of displayed events in preview to 100, and decrease in thumbnail to 12.
Tags And Properties
Changes

Changes to GeneratePreviewForURL.m

Old (26f6a2542d64dd3b) New (3b9541ce512557be)
1 #import <QuickLook/QuickLook.h> 1 #import <QuickLook/QuickLook.h>
2 #import <Foundation/Foundation.h> 2 #import <Foundation/Foundation.h>
3 #import "TimelineGenerator.h" 3 #import "TimelineGenerator.h"
4 4
5 /* ----------------------------------------------------------------------------- 5 /* -----------------------------------------------------------------------------
10 hidden lines
16 return noErr; 16 return noErr;
17 17
18 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 18 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
19 19
20 NSString *html = HTMLTimelineForDatabase( 20 NSString *html = HTMLTimelineForDatabase(
21 [[(NSURL*)url path] fileSystemRepresentation]); | 21 [[(NSURL*)url path] fileSystemRepresentation], 100);
22 22
23 if (!html || [html isEqualToString:@""]) 23 if (!html || [html isEqualToString:@""])
24 goto out; 24 goto out;
25 25
26 CFDictionaryRef properties = 26 CFDictionaryRef properties =
11 hidden lines
38 38
39 void CancelPreviewGeneration(void* thisInterface, QLPreviewRequestRef preview) 39 void CancelPreviewGeneration(void* thisInterface, QLPreviewRequestRef preview)
40 { 40 {
41 // implement only if supported 41 // implement only if supported
42 } 42 }

Changes to GenerateThumbnailForURL.m

Old (59429ffa006ee0b0) New (940295dfbb3e7fc3)
1 #import <QuickLook/QuickLook.h> 1 #import <QuickLook/QuickLook.h>
2 #import <Foundation/Foundation.h> 2 #import <Foundation/Foundation.h>
3 #import <WebKit/WebKit.h> 3 #import <WebKit/WebKit.h>
4 #import <AppKit/AppKit.h> 4 #import <AppKit/AppKit.h>
5 #import "TimelineGenerator.h" 5 #import "TimelineGenerator.h"
13 hidden lines
19 19
20 20
21 // Use webkit render 21 // Use webkit render
22 22
23 NSMutableString *html = HTMLTimelineForDatabase( 23 NSMutableString *html = HTMLTimelineForDatabase(
24 [[(NSURL*)url path] fileSystemRepresentation]); | 24 [[(NSURL*)url path] fileSystemRepresentation],
| 25 12);
25 [html appendString:@"<div style='font-size: 120px; position: absolute; " 26 [html appendString:@"<div style='font-size: 120px; position: absolute; "
26 " bottom: 0; background: white; width: 100%; color: #555;" 27 " bottom: 0; background: white; width: 100%; color: #555;"
27 " font-weight: bold; " 28 " font-weight: bold; "
28 " text-align: center; padding: 30px 0'>FOSSIL</div>"]; 29 " text-align: center; padding: 30px 0'>FOSSIL</div>"];
29 30
48 hidden lines
78 79
79 void CancelThumbnailGeneration(void* thisInterface, QLThumbnailRequestRef thumbnail) 80 void CancelThumbnailGeneration(void* thisInterface, QLThumbnailRequestRef thumbnail)
80 { 81 {
81 // implement only if supported 82 // implement only if supported
82 } 83 }

Changes to Info.plist

Old (8a2025adb733a128) New (c8beeb10e04d676f)
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 <plist version="1.0"> 3 <plist version="1.0">
4 <dict> 4 <dict>
5 <key>CFBundleDevelopmentRegion</key> 5 <key>CFBundleDevelopmentRegion</key>
20 hidden lines
26 <key>CFBundleName</key> 26 <key>CFBundleName</key>
27 <string>${PRODUCT_NAME}</string> 27 <string>${PRODUCT_NAME}</string>
28 <key>CFBundleShortVersionString</key> 28 <key>CFBundleShortVersionString</key>
29 <string>1</string> 29 <string>1</string>
30 <key>CFBundleVersion</key> 30 <key>CFBundleVersion</key>
31 <string>1.0</string> | 31 <string>1.1</string>
32 <key>CFPlugInDynamicRegisterFunction</key> 32 <key>CFPlugInDynamicRegisterFunction</key>
33 <string></string> 33 <string></string>
34 <key>CFPlugInDynamicRegistration</key> 34 <key>CFPlugInDynamicRegistration</key>
35 <string>NO</string> 35 <string>NO</string>
36 <key>CFPlugInFactories</key> 36 <key>CFPlugInFactories</key>
43 hidden lines
80 </dict> 80 </dict>
81 </dict> 81 </dict>
82 </array> 82 </array>
83 </dict> 83 </dict>
84 </plist> 84 </plist>

Changes to TimelineGenerator.h

Old (5b8f65b69386c757) New (eaa8061ad831ede6)
1 1
2 NSMutableString *HTMLTimelineForDatabase(const char *database); | 2 NSMutableString *HTMLTimelineForDatabase(const char *database, int limit);

Changes to TimelineGenerator.m

Old (d5407ed3fc09483d) New (3bcebc4b752cbaeb)
1 #import <Foundation/Foundation.h> 1 #import <Foundation/Foundation.h>
2 #import <sqlite3.h> 2 #import <sqlite3.h>
3 3
4 NSMutableString *HTMLTimelineForDatabase(const char *database) | 4 NSMutableString *HTMLTimelineForDatabase(const char *database, int limit)
5 { 5 {
6 sqlite3 *db; 6 sqlite3 *db;
7 int rc; 7 int rc;
8 char *sql; | 8 const char *sql;
9 sqlite3_stmt *st; 9 sqlite3_stmt *st;
10 const char *key, *value; 10 const char *key, *value;
11 11
12 NSMutableString *html = [[[NSMutableString alloc] init] autorelease]; 12 NSMutableString *html = [[[NSMutableString alloc] init] autorelease];
13 13
51 hidden lines
65 } 65 }
66 sqlite3_finalize(st); 66 sqlite3_finalize(st);
67 67
68 [html appendString:@"</div>"]; 68 [html appendString:@"</div>"];
69 69
70 sql = "SELECT bgcolor, type, datetime(mtime,'localtime') AS timestamp, " | 70 sql = [[NSString stringWithFormat:
71 "substr(uuid,0,10) AS uuid, comment, user FROM event " | 71 @"SELECT bgcolor, type, datetime(mtime,'localtime') AS timestamp, "
72 "JOIN blob where blob.rid = event.objid " | 72 "substr(uuid,0,10) AS uuid, comment, user FROM event "
73 "ORDER BY mtime DESC limit 20"; | 73 "JOIN blob where blob.rid = event.objid "
| 74 "ORDER BY mtime DESC limit %d", limit] UTF8String];
74 75
> 76 NSLog(@"%s", sql);
75 rc = sqlite3_prepare_v2(db, sql, -1, &st, 0); 77 rc = sqlite3_prepare_v2(db, sql, -1, &st, 0);
76 78
77 BOOL isOdd = NO; 79 BOOL isOdd = NO;
78 while (sqlite3_step(st) == SQLITE_ROW) { 80 while (sqlite3_step(st) == SQLITE_ROW) {
79 // 0 - bgcolor 81 // 0 - bgcolor
35 hidden lines
115 117
116 out: 118 out:
117 sqlite3_close(db); 119 sqlite3_close(db);
118 return html; 120 return html;
119 } 121 }