Check-in [a3ac45a8a2]

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

Overview
SHA1 Hash:a3ac45a8a2f407e82ead292682b82acbc171455b
Date: 2009-11-21 17:52:57
User: dmitry
Comment:Add counts to the bottom of preview
Tags And Properties
Changes

Changes to TimelineGenerator.m

Old (d84de01edd288ce4) New (ee40a6aca97242ad)
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, int limit) 4 NSMutableString *HTMLTimelineForDatabase(const char *database, int limit)
5 { 5 {
27 hidden lines
33 ".w .uuid { background: #FC6 } " 33 ".w .uuid { background: #FC6 } "
34 ".comment { margin-left: 5px } " 34 ".comment { margin-left: 5px } "
35 ".user { color: #777; background: #f4f4f4; " 35 ".user { color: #777; background: #f4f4f4; "
36 " font-style: oblique; padding: 0 5px } " 36 " font-style: oblique; padding: 0 5px } "
37 ".odd { background: #E9F0FC } " 37 ".odd { background: #E9F0FC } "
> 38 ".count { padding: 10px; color: #777 } "
38 "</style>" 39 "</style>"
39 ]; 40 ];
40 41
41 sql = "SELECT name, value from config"; 42 sql = "SELECT name, value from config";
42 43
59 hidden lines
102 fprintf(stderr, "QLFossil: SQL error (2)"); 103 fprintf(stderr, "QLFossil: SQL error (2)");
103 goto out; 104 goto out;
104 } 105 }
105 106
106 BOOL isOdd = NO; 107 BOOL isOdd = NO;
> 108 uint64 num = 0;
107 while (sqlite3_step(st) == SQLITE_ROW) { 109 while (sqlite3_step(st) == SQLITE_ROW) {
108 // 0 - bgcolor 110 // 0 - bgcolor
109 [html appendString:@"<div "]; 111 [html appendString:@"<div "];
110 value = (char *)sqlite3_column_text(st, 0); 112 value = (char *)sqlite3_column_text(st, 0);
111 if (value) 113 if (value)
22 hidden lines
134 value = (char *)sqlite3_column_text(st, 5); 136 value = (char *)sqlite3_column_text(st, 5);
135 if (value) 137 if (value)
136 [html appendFormat:@"<span class=user>%s</span>\n", value]; 138 [html appendFormat:@"<span class=user>%s</span>\n", value];
137 [html appendString:@"</div>\n\n"]; 139 [html appendString:@"</div>\n\n"];
138 isOdd = !isOdd; 140 isOdd = !isOdd;
> 141 num++;
> 142 }
> 143
> 144 sqlite3_finalize(st);
> 145
> 146
> 147 sql = "SELECT count(*) FROM event";
> 148
> 149 rc = sqlite3_prepare_v2(db, sql, -1, &st, 0);
> 150 if (rc != SQLITE_OK) {
> 151 fprintf(stderr, "QLFossil: SQL error (1)");
> 152 goto out;
139 } 153 }
140 154
> 155 while (sqlite3_step(st) == SQLITE_ROW) {
> 156 uint64 count = sqlite3_column_int64(st, 0);
> 157 [html appendFormat:@"<div class='count'>Showed %d of %d events.</div>",
> 158 num, count];
> 159 }
141 sqlite3_finalize(st); 160 sqlite3_finalize(st);
142 161
143 out: 162 out:
144 sqlite3_close(db); 163 sqlite3_close(db);
145 return html; 164 return html;
146 } 165 }

Changes to www/index.wiki

Old (a7aa1f2faa921893) New (9c237602559d9e32)
1 <title>QLFossil Home Page</title> 1 <title>QLFossil Home Page</title>
2 2
3 <img src="screenshot.jpg" align="right" hspace=10> 3 <img src="screenshot.jpg" align="right" hspace=10>
4 4
5 <h3>About QLFossil</h3> 5 <h3>About QLFossil</h3>
11 hidden lines
17 </tr> 17 </tr>
18 </table> 18 </table>
19 19
20 <h3>Download</h3> 20 <h3>Download</h3>
21 21
22 [http://c0043312.cdn.cloudfiles.rackspacecloud.com/QLFossil.zip | QLFossil.zip] (18 KB, Version 1.3) | 22 [http://c0043312.cdn.cloudfiles.rackspacecloud.com/QLFossil.zip | QLFossil.zip] (18 KB, Version 1.4, 2009-11-21)
23 23
24 <h3>Installation</h3> 24 <h3>Installation</h3>
25 25
26 Unzip, then copy <i>QLFossil.qlgenerator</i> to <i>~/Library/QuickLook/</i> (create this 26 Unzip, then copy <i>QLFossil.qlgenerator</i> to <i>~/Library/QuickLook/</i> (create this
27 folder if it doesn't exist) or <i>/Library/QuickLook/</i>. Probably, you'll 27 folder if it doesn't exist) or <i>/Library/QuickLook/</i>. Probably, you'll
11 hidden lines
39 39
40 <h3>Contact</h3> 40 <h3>Contact</h3>
41 41
42 I want to hear your feedback! [mailto:dmitry@codingrobots.com | Email me] or 42 I want to hear your feedback! [mailto:dmitry@codingrobots.com | Email me] or
43 use the built-in ticket tracker. 43 use the built-in ticket tracker.