209 Public method to add a history entry. |
209 Public method to add a history entry. |
210 |
210 |
211 @param url URL to be added (string) |
211 @param url URL to be added (string) |
212 """ |
212 """ |
213 cleanurl = QUrl(url) |
213 cleanurl = QUrl(url) |
214 cleanurl.setPassword("") |
214 if cleanurl.scheme() not in ["eric", "about"]: |
215 if cleanurl.host(): |
215 cleanurl.setPassword("") |
216 cleanurl.setHost(cleanurl.host().lower()) |
216 if cleanurl.host(): |
217 itm = HistoryEntry(cleanurl.toString(), QDateTime.currentDateTime()) |
217 cleanurl.setHost(cleanurl.host().lower()) |
218 self._addHistoryEntry(itm) |
218 itm = HistoryEntry(cleanurl.toString(), QDateTime.currentDateTime()) |
|
219 self._addHistoryEntry(itm) |
219 |
220 |
220 def updateHistoryEntry(self, url, title): |
221 def updateHistoryEntry(self, url, title): |
221 """ |
222 """ |
222 Public method to update a history entry. |
223 Public method to update a history entry. |
223 |
224 |
224 @param url URL of the entry to update (string) |
225 @param url URL of the entry to update (string) |
225 @param title title of the entry to update (string) |
226 @param title title of the entry to update (string) |
226 """ |
227 """ |
227 for index in range(len(self.__history)): |
228 cleanurl = QUrl(url) |
228 if url == self.__history[index].url: |
229 if cleanurl.scheme() not in ["eric", "about"]: |
229 self.__history[index].title = title |
230 for index in range(len(self.__history)): |
230 self.__saveTimer.changeOccurred() |
231 if url == self.__history[index].url: |
231 if not self.__lastSavedUrl: |
232 self.__history[index].title = title |
232 self.__lastSavedUrl = self.__history[index].url |
233 self.__saveTimer.changeOccurred() |
233 self.entryUpdated.emit(index) |
234 if not self.__lastSavedUrl: |
234 break |
235 self.__lastSavedUrl = self.__history[index].url |
|
236 self.entryUpdated.emit(index) |
|
237 break |
235 |
238 |
236 def removeHistoryEntry(self, url, title=""): |
239 def removeHistoryEntry(self, url, title=""): |
237 """ |
240 """ |
238 Public method to remove a history entry. |
241 Public method to remove a history entry. |
239 |
242 |