42 self.__urlRx.setMinimal(True) |
42 self.__urlRx.setMinimal(True) |
43 |
43 |
44 self.__addedRx = QRegExp('ADD_DATE="(\d*)"', Qt.CaseInsensitive) |
44 self.__addedRx = QRegExp('ADD_DATE="(\d*)"', Qt.CaseInsensitive) |
45 self.__addedRx.setMinimal(True) |
45 self.__addedRx.setMinimal(True) |
46 |
46 |
47 self.__modifiedRx = QRegExp('LAST_MODIFIED="(\d*)"', Qt.CaseInsensitive) |
47 self.__modifiedRx = QRegExp( |
|
48 'LAST_MODIFIED="(\d*)"', Qt.CaseInsensitive) |
48 self.__modifiedRx.setMinimal(True) |
49 self.__modifiedRx.setMinimal(True) |
49 |
50 |
50 self.__visitedRx = QRegExp('LAST_VISIT="(\d*)"', Qt.CaseInsensitive) |
51 self.__visitedRx = QRegExp('LAST_VISIT="(\d*)"', Qt.CaseInsensitive) |
51 self.__visitedRx.setMinimal(True) |
52 self.__visitedRx.setMinimal(True) |
52 |
53 |
83 name = self.__folderRx.cap(2) |
84 name = self.__folderRx.cap(2) |
84 node = BookmarkNode(BookmarkNode.Folder, folders[-1]) |
85 node = BookmarkNode(BookmarkNode.Folder, folders[-1]) |
85 node.title = Utilities.html_udecode(name) |
86 node.title = Utilities.html_udecode(name) |
86 node.expanded = self.__foldedRx.indexIn(arguments) == -1 |
87 node.expanded = self.__foldedRx.indexIn(arguments) == -1 |
87 if self.__addedRx.indexIn(arguments) != -1: |
88 if self.__addedRx.indexIn(arguments) != -1: |
88 node.added = QDateTime.fromTime_t(int(self.__addedRx.cap(1))) |
89 node.added = QDateTime.fromTime_t( |
|
90 int(self.__addedRx.cap(1))) |
89 folders.append(node) |
91 folders.append(node) |
90 lastNode = node |
92 lastNode = node |
91 |
93 |
92 elif self.__endFolderRx.indexIn(line) != -1: |
94 elif self.__endFolderRx.indexIn(line) != -1: |
93 # end of folder definition |
95 # end of folder definition |
100 node = BookmarkNode(BookmarkNode.Bookmark, folders[-1]) |
102 node = BookmarkNode(BookmarkNode.Bookmark, folders[-1]) |
101 node.title = Utilities.html_udecode(name) |
103 node.title = Utilities.html_udecode(name) |
102 if self.__urlRx.indexIn(arguments) != -1: |
104 if self.__urlRx.indexIn(arguments) != -1: |
103 node.url = self.__urlRx.cap(1) |
105 node.url = self.__urlRx.cap(1) |
104 if self.__addedRx.indexIn(arguments) != -1: |
106 if self.__addedRx.indexIn(arguments) != -1: |
105 node.added = QDateTime.fromTime_t(int(self.__addedRx.cap(1))) |
107 node.added = QDateTime.fromTime_t( |
|
108 int(self.__addedRx.cap(1))) |
106 if self.__modifiedRx.indexIn(arguments) != -1: |
109 if self.__modifiedRx.indexIn(arguments) != -1: |
107 node.modified = QDateTime.fromTime_t(int(self.__modifiedRx.cap(1))) |
110 node.modified = QDateTime.fromTime_t( |
|
111 int(self.__modifiedRx.cap(1))) |
108 if self.__visitedRx.indexIn(arguments) != -1: |
112 if self.__visitedRx.indexIn(arguments) != -1: |
109 node.visited = QDateTime.fromTime_t(int(self.__visitedRx.cap(1))) |
113 node.visited = QDateTime.fromTime_t( |
|
114 int(self.__visitedRx.cap(1))) |
110 lastNode = node |
115 lastNode = node |
111 |
116 |
112 elif self.__descRx.indexIn(line) != -1: |
117 elif self.__descRx.indexIn(line) != -1: |
113 # description |
118 # description |
114 if lastNode: |
119 if lastNode: |
115 lastNode.desc = Utilities.html_udecode(self.__descRx.cap(1)) |
120 lastNode.desc = Utilities.html_udecode( |
|
121 self.__descRx.cap(1)) |
116 |
122 |
117 elif self.__separatorRx.indexIn(line) != -1: |
123 elif self.__separatorRx.indexIn(line) != -1: |
118 # separator definition |
124 # separator definition |
119 BookmarkNode(BookmarkNode.Separator, folders[-1]) |
125 BookmarkNode(BookmarkNode.Separator, folders[-1]) |
120 |
126 |