[kupfer] firefox: new option "Include visited sites".



commit 0bb214564ddb599ca905ba9882320eb06c4c41f6
Author: Karol BÄ?dkowski <karol bedkowski gmail com>
Date:   Fri May 14 17:05:10 2010 +0200

    firefox: new option "Include visited sites".
    
    Options allow to significant decrease number of leaves generated
    by firefox plugin.

 kupfer/plugin/firefox.py |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/kupfer/plugin/firefox.py b/kupfer/plugin/firefox.py
index 7072fae..d43b7b0 100644
--- a/kupfer/plugin/firefox.py
+++ b/kupfer/plugin/firefox.py
@@ -4,7 +4,7 @@ from __future__ import with_statement
 __kupfer_name__ = _("Firefox Bookmarks")
 __kupfer_sources__ = ("BookmarksSource", )
 __description__ = _("Index of Firefox bookmarks")
-__version__ = "2010-01-23"
+__version__ = "2010-05-14"
 __author__ = "Ulrik, William Friesen, Karol BÄ?dkowski"
 
 from contextlib import closing
@@ -12,13 +12,24 @@ import os
 import itertools
 import sqlite3
 
-from kupfer.objects import Leaf, Action, Source
+from kupfer import plugin_support
+from kupfer.objects import Source
 from kupfer.objects import UrlLeaf
 from kupfer.obj.apps import AppLeafContentMixin
 from kupfer.obj.helplib import FilesystemWatchMixin
 from kupfer.plugin import firefox_support
 
 
+__kupfer_settings__ = plugin_support.PluginSettings(
+	{
+		"key": "load_history",
+		"label": _("Include visited sites"),
+		"type": bool,
+		"value": True,
+	},
+)
+
+
 class BookmarksSource (AppLeafContentMixin, Source, FilesystemWatchMixin):
 	appleaf_content_id = ("firefox", "iceweasel")
 	def __init__(self):
@@ -70,9 +81,12 @@ class BookmarksSource (AppLeafContentMixin, Source, FilesystemWatchMixin):
 
 	def get_items(self):
 		# try to update the history file
-		history_items = self._get_ffx3_history()
-		if history_items is not None:
-			self._history = history_items
+		if __kupfer_settings__['load_history']:
+			history_items = self._get_ffx3_history()
+			if history_items is not None:
+				self._history = history_items
+		else:
+			self._history = []
 
 		# now try reading JSON bookmark backups,
 		# with html bookmarks as backup



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]