1729:66b9dc45f2bd | 1730:5d7ce61b64aa |
---|---|
4 # | 4 # |
5 | 5 |
6 """ | 6 """ |
7 Module implementing the bookmark node. | 7 Module implementing the bookmark node. |
8 """ | 8 """ |
9 | |
10 from PyQt4.QtCore import QDateTime | |
9 | 11 |
10 | 12 |
11 class BookmarkNode(object): | 13 class BookmarkNode(object): |
12 """ | 14 """ |
13 Class implementing the bookmark node type. | 15 Class implementing the bookmark node type. |
16 Root = 0 | 18 Root = 0 |
17 Folder = 1 | 19 Folder = 1 |
18 Bookmark = 2 | 20 Bookmark = 2 |
19 Separator = 3 | 21 Separator = 3 |
20 | 22 |
23 # possible timestamp types | |
24 TsAdded = 0 | |
25 TsModified = 1 | |
26 TsVisited = 2 | |
27 | |
21 def __init__(self, type_=Root, parent=None): | 28 def __init__(self, type_=Root, parent=None): |
22 """ | 29 """ |
23 Constructor | 30 Constructor |
24 | 31 |
25 @param type_ type of the bookmark node (BookmarkNode.Type) | 32 @param type_ type of the bookmark node (BookmarkNode.Type) |
27 """ | 34 """ |
28 self.url = "" | 35 self.url = "" |
29 self.title = "" | 36 self.title = "" |
30 self.desc = "" | 37 self.desc = "" |
31 self.expanded = False | 38 self.expanded = False |
39 self.added = QDateTime() | |
40 self.modified = QDateTime() | |
41 self.visited = QDateTime() | |
32 | 42 |
33 self._children = [] | 43 self._children = [] |
34 self._parent = parent | 44 self._parent = parent |
35 self._type = type_ | 45 self._type = type_ |
36 | 46 |