WebBrowser/Bookmarks/BookmarksManager.py

changeset 5015
ca1d44f0f6b2
parent 4913
e16573640cb8
child 5039
200f12184a43
diff -r 337f4a8fe6bb -r ca1d44f0f6b2 WebBrowser/Bookmarks/BookmarksManager.py
--- a/WebBrowser/Bookmarks/BookmarksManager.py	Sun Jul 03 15:51:26 2016 +0200
+++ b/WebBrowser/Bookmarks/BookmarksManager.py	Sun Jul 03 16:34:45 2016 +0200
@@ -304,6 +304,33 @@
             node.visited = timestamp
         self.__saveTimer.changeOccurred()
     
+    def incVisitCount(self, node):
+        """
+        Public method to increment the visit count of a bookmark.
+        
+        @param node reference to the node to be changed (BookmarkNode)
+        """
+        if not self.__loaded:
+            return
+        
+        if node:
+            node.visitCount += 1
+            self.__saveTimer.changeOccurred()
+    
+    def setVisitCount(self, node, count):
+        """
+        Public method to set the visit count of a bookmark.
+        
+        @param node reference to the node to be changed (BookmarkNode)
+        @param count visit count to be set (int or str)
+        """
+        try:
+            node.visitCount = int(count)
+            self.__saveTimer.changeOccurred()
+        except ValueError:
+            # ignore invalid values
+            pass
+    
     def bookmarks(self):
         """
         Public method to get a reference to the root bookmark node.

eric ide

mercurial