Skip to content

Commit 69a55ea

Browse files
committed
Limit the Safari history to the most recent 200 items
Fixes quicksilver/Quicksilver#3085 NB: This is inentionally in the `remote-action` branch so I can test the new plugin release process.
1 parent 5733adb commit 69a55ea

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

Documentation.mdown

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ The Safari plug-in allows you to index your Safari bookmarks and history. You ca
44

55
It also provides access to all currently open pages. Select "Open Web Pages" in the first pane and hit → or /.
66

7+
As of 2.5.3 the history is limited by default to the most recent 200 items, which resolves an issue that results in tremendous memory consumption.
8+
9+
To adjust this number:
10+
11+
1. Go to ~/Library/Application Support/Quicksilver/PlugIns/
12+
1. find `Safari Plugin.qsplugin`
13+
1. right-click -> "Show Package Contents"
14+
1. then open `Contents/Info.plist`
15+
1. In there, find the entry QSPresetAdditions -> Item 0 -> children -> Item 1 -> settings -> historySize
16+
1. Change the number to something different
17+
1. Restart Quicksilver and rescan the catalog
18+
719
### Proxy Objects ###
820

921
There are two proxy objects: Current Web Page and Current Website

Info.plist

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<key>CFBundlePackageType</key>
1818
<string>BNDL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>2.5.2</string>
20+
<string>2.5.3</string>
2121
<key>CFBundleVersion</key>
22-
<string>150</string>
22+
<string>151</string>
2323
<key>QSActions</key>
2424
<dict>
2525
<key>QSSafariAddToReadingListAction</key>
@@ -126,6 +126,8 @@
126126
<string>~/Library/Safari/History.db-wal</string>
127127
<key>skipItem</key>
128128
<integer>1</integer>
129+
<key>historySize</key>
130+
<integer>1000</integer>
129131
</dict>
130132
<key>source</key>
131133
<string>QSFileSystemObjectSource</string>

QSSafariPlugin.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,9 @@ - (NSArray *)objectsFromPath:(NSString *)path withSettings:(NSDictionary *)setti
339339
if (!db) {
340340
return @[];
341341
}
342-
NSString *query = @"SELECT i.url AS url, v.title AS title FROM history_items i INNER JOIN history_visits v ON i.id=v.history_item ORDER BY v.visit_time DESC;";
343-
FMResultSet *rs = [db executeQuery:query];
344-
342+
NSString *query = @"SELECT i.url AS url, v.title AS title FROM history_items i INNER JOIN history_visits v ON i.id=v.history_item ORDER BY v.visit_time DESC LIMIT ?;";
343+
FMResultSet *rs = [db executeQuery:query, [settings objectForKey:@"historySize"]];
344+
345345
if ([db hadError]) {
346346
NSLog(@"Error while reading Safari history database. Error %d: %@", [db lastErrorCode], [db lastErrorMessage]);
347347
return @[];

0 commit comments

Comments
 (0)