Documentation/Source/eric6.WebBrowser.History.HistoryManager.html

branch
maintenance
changeset 6989
8b8cadf8d7e9
parent 6938
7926553b7509
parent 6987
3371a03ed0a7
child 6990
82f703b8b525
equal deleted inserted replaced
6938:7926553b7509 6989:8b8cadf8d7e9
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric6.WebBrowser.History.HistoryManager</title>
4 <meta charset="UTF-8">
5 <style>
6 body {
7 background: #EDECE6;
8 margin: 0em 1em 10em 1em;
9 color: black;
10 }
11
12 h1 { color: white; background: #85774A; }
13 h2 { color: white; background: #85774A; }
14 h3 { color: white; background: #9D936E; }
15 h4 { color: white; background: #9D936E; }
16
17 a { color: #BA6D36; }
18
19 </style>
20 </head>
21 <body><a NAME="top" ID="top"></a>
22 <h1>eric6.WebBrowser.History.HistoryManager</h1>
23 <p>
24 Module implementing the history manager.
25 </p>
26 <h3>Global Attributes</h3>
27 <table>
28 <tr><td>HISTORY_VERSIONS</td></tr><tr><td>HISTORY_VERSION_42</td></tr><tr><td>HISTORY_VERSION_60</td></tr>
29 </table>
30 <h3>Classes</h3>
31 <table>
32 <tr>
33 <td><a href="#HistoryEntry">HistoryEntry</a></td>
34 <td>Class implementing a history entry.</td>
35 </tr><tr>
36 <td><a href="#HistoryManager">HistoryManager</a></td>
37 <td>Class implementing the history manager.</td>
38 </tr>
39 </table>
40 <h3>Functions</h3>
41 <table>
42 <tr><td>None</td></tr>
43 </table>
44 <hr /><hr />
45 <a NAME="HistoryEntry" ID="HistoryEntry"></a>
46 <h2>HistoryEntry</h2>
47 <p>
48 Class implementing a history entry.
49 </p>
50 <h3>Derived from</h3>
51 object
52 <h3>Class Attributes</h3>
53 <table>
54 <tr><td>None</td></tr>
55 </table>
56 <h3>Class Methods</h3>
57 <table>
58 <tr><td>None</td></tr>
59 </table>
60 <h3>Methods</h3>
61 <table>
62 <tr>
63 <td><a href="#HistoryEntry.__init__">HistoryEntry</a></td>
64 <td>Constructor</td>
65 </tr><tr>
66 <td><a href="#HistoryEntry.__eq__">__eq__</a></td>
67 <td>Special method determining equality.</td>
68 </tr><tr>
69 <td><a href="#HistoryEntry.__lt__">__lt__</a></td>
70 <td>Special method determining less relation.</td>
71 </tr><tr>
72 <td><a href="#HistoryEntry.isValid">isValid</a></td>
73 <td>Public method to determine validity.</td>
74 </tr><tr>
75 <td><a href="#HistoryEntry.userTitle">userTitle</a></td>
76 <td>Public method to get the title of the history entry.</td>
77 </tr>
78 </table>
79 <h3>Static Methods</h3>
80 <table>
81 <tr><td>None</td></tr>
82 </table>
83 <a NAME="HistoryEntry.__init__" ID="HistoryEntry.__init__"></a>
84 <h4>HistoryEntry (Constructor)</h4>
85 <b>HistoryEntry</b>(<i>url=None, dateTime=None, title=None, visitCount=None</i>)
86 <p>
87 Constructor
88 </p><dl>
89 <dt><i>url</i></dt>
90 <dd>
91 URL of the history entry (string)
92 </dd><dt><i>dateTime</i></dt>
93 <dd>
94 date and time this entry was created (QDateTime)
95 </dd><dt><i>title</i></dt>
96 <dd>
97 title string for the history entry (string)
98 </dd><dt><i>visitCount</i></dt>
99 <dd>
100 number of visits of this URL (int)
101 </dd>
102 </dl><a NAME="HistoryEntry.__eq__" ID="HistoryEntry.__eq__"></a>
103 <h4>HistoryEntry.__eq__</h4>
104 <b>__eq__</b>(<i>other</i>)
105 <p>
106 Special method determining equality.
107 </p><dl>
108 <dt><i>other</i></dt>
109 <dd>
110 reference to the history entry to compare against
111 (HistoryEntry)
112 </dd>
113 </dl><dl>
114 <dt>Returns:</dt>
115 <dd>
116 flag indicating equality (boolean)
117 </dd>
118 </dl><a NAME="HistoryEntry.__lt__" ID="HistoryEntry.__lt__"></a>
119 <h4>HistoryEntry.__lt__</h4>
120 <b>__lt__</b>(<i>other</i>)
121 <p>
122 Special method determining less relation.
123 </p><p>
124 Note: History is sorted in reverse order by date and time
125 </p><dl>
126 <dt><i>other</i></dt>
127 <dd>
128 reference to the history entry to compare against
129 (HistoryEntry)
130 </dd>
131 </dl><dl>
132 <dt>Returns:</dt>
133 <dd>
134 flag indicating less (boolean)
135 </dd>
136 </dl><a NAME="HistoryEntry.isValid" ID="HistoryEntry.isValid"></a>
137 <h4>HistoryEntry.isValid</h4>
138 <b>isValid</b>(<i></i>)
139 <p>
140 Public method to determine validity.
141 </p><dl>
142 <dt>Returns:</dt>
143 <dd>
144 flag indicating validity
145 </dd>
146 </dl><dl>
147 <dt>Return Type:</dt>
148 <dd>
149 bool
150 </dd>
151 </dl><a NAME="HistoryEntry.userTitle" ID="HistoryEntry.userTitle"></a>
152 <h4>HistoryEntry.userTitle</h4>
153 <b>userTitle</b>(<i></i>)
154 <p>
155 Public method to get the title of the history entry.
156 </p><dl>
157 <dt>Returns:</dt>
158 <dd>
159 title of the entry (string)
160 </dd>
161 </dl>
162 <div align="right"><a href="#top">Up</a></div>
163 <hr /><hr />
164 <a NAME="HistoryManager" ID="HistoryManager"></a>
165 <h2>HistoryManager</h2>
166 <p>
167 Class implementing the history manager.
168 </p><h3>Signals</h3>
169 <dl>
170 <dt>entryAdded(HistoryEntry)</dt>
171 <dd>
172 emitted after a history entry has been
173 added
174 </dd><dt>entryRemoved(HistoryEntry)</dt>
175 <dd>
176 emitted after a history entry has been
177 removed
178 </dd><dt>entryUpdated(int)</dt>
179 <dd>
180 emitted after a history entry has been updated
181 </dd><dt>historyCleared()</dt>
182 <dd>
183 emitted after the history has been cleared
184 </dd><dt>historyReset()</dt>
185 <dd>
186 emitted after the history has been reset
187 </dd><dt>historySaved()</dt>
188 <dd>
189 emitted after the history was saved
190 </dd>
191 </dl>
192 <h3>Derived from</h3>
193 QObject
194 <h3>Class Attributes</h3>
195 <table>
196 <tr><td>None</td></tr>
197 </table>
198 <h3>Class Methods</h3>
199 <table>
200 <tr><td>None</td></tr>
201 </table>
202 <h3>Methods</h3>
203 <table>
204 <tr>
205 <td><a href="#HistoryManager.__init__">HistoryManager</a></td>
206 <td>Constructor</td>
207 </tr><tr>
208 <td><a href="#HistoryManager.__checkForExpired">__checkForExpired</a></td>
209 <td>Private slot to check entries for expiration.</td>
210 </tr><tr>
211 <td><a href="#HistoryManager.__cleanUrl">__cleanUrl</a></td>
212 <td>Private method to generate a clean URL usable for the history entry.</td>
213 </tr><tr>
214 <td><a href="#HistoryManager.__cleanUrlStr">__cleanUrlStr</a></td>
215 <td>Private method to generate a clean URL usable for the history entry.</td>
216 </tr><tr>
217 <td><a href="#HistoryManager.__findFirstHistoryEntry">__findFirstHistoryEntry</a></td>
218 <td>Private method to find the first entry for the given URL.</td>
219 </tr><tr>
220 <td><a href="#HistoryManager.__load">__load</a></td>
221 <td>Private method to load the saved history entries from disk.</td>
222 </tr><tr>
223 <td><a href="#HistoryManager.__refreshFrequencies">__refreshFrequencies</a></td>
224 <td>Private slot to recalculate the refresh frequencies.</td>
225 </tr><tr>
226 <td><a href="#HistoryManager.__startFrequencyTimer">__startFrequencyTimer</a></td>
227 <td>Private method to start the timer to recalculate the frequencies.</td>
228 </tr><tr>
229 <td><a href="#HistoryManager.__updateVisitCount">__updateVisitCount</a></td>
230 <td>Private method to update the visit count for all entries of the given URL.</td>
231 </tr><tr>
232 <td><a href="#HistoryManager.addHistoryEntry">addHistoryEntry</a></td>
233 <td>Public method to add a history entry.</td>
234 </tr><tr>
235 <td><a href="#HistoryManager.clear">clear</a></td>
236 <td>Public slot to clear the complete history.</td>
237 </tr><tr>
238 <td><a href="#HistoryManager.close">close</a></td>
239 <td>Public method to close the history manager.</td>
240 </tr><tr>
241 <td><a href="#HistoryManager.daysToExpire">daysToExpire</a></td>
242 <td>Public method to get the days for entry expiration.</td>
243 </tr><tr>
244 <td><a href="#HistoryManager.getFileName">getFileName</a></td>
245 <td>Public method to get the file name of the history file.</td>
246 </tr><tr>
247 <td><a href="#HistoryManager.history">history</a></td>
248 <td>Public method to return the history.</td>
249 </tr><tr>
250 <td><a href="#HistoryManager.historyFilterModel">historyFilterModel</a></td>
251 <td>Public method to get a reference to the history filter model.</td>
252 </tr><tr>
253 <td><a href="#HistoryManager.historyModel">historyModel</a></td>
254 <td>Public method to get a reference to the history model.</td>
255 </tr><tr>
256 <td><a href="#HistoryManager.historyTreeModel">historyTreeModel</a></td>
257 <td>Public method to get a reference to the history tree model.</td>
258 </tr><tr>
259 <td><a href="#HistoryManager.preferencesChanged">preferencesChanged</a></td>
260 <td>Public method to indicate a change of preferences.</td>
261 </tr><tr>
262 <td><a href="#HistoryManager.reload">reload</a></td>
263 <td>Public method to reload the history.</td>
264 </tr><tr>
265 <td><a href="#HistoryManager.removeHistoryEntry">removeHistoryEntry</a></td>
266 <td>Public method to remove a history entry.</td>
267 </tr><tr>
268 <td><a href="#HistoryManager.save">save</a></td>
269 <td>Public slot to save the history entries to disk.</td>
270 </tr><tr>
271 <td><a href="#HistoryManager.setDaysToExpire">setDaysToExpire</a></td>
272 <td>Public method to set the days for entry expiration.</td>
273 </tr><tr>
274 <td><a href="#HistoryManager.setHistory">setHistory</a></td>
275 <td>Public method to set a new history.</td>
276 </tr><tr>
277 <td><a href="#HistoryManager.siteVisitsCount">siteVisitsCount</a></td>
278 <td>Public method to get the visit count for a web site using the given scheme.</td>
279 </tr><tr>
280 <td><a href="#HistoryManager.updateHistoryEntry">updateHistoryEntry</a></td>
281 <td>Public method to update a history entry.</td>
282 </tr>
283 </table>
284 <h3>Static Methods</h3>
285 <table>
286 <tr><td>None</td></tr>
287 </table>
288 <a NAME="HistoryManager.__init__" ID="HistoryManager.__init__"></a>
289 <h4>HistoryManager (Constructor)</h4>
290 <b>HistoryManager</b>(<i>parent=None</i>)
291 <p>
292 Constructor
293 </p><dl>
294 <dt><i>parent</i></dt>
295 <dd>
296 reference to the parent object (QObject)
297 </dd>
298 </dl><a NAME="HistoryManager.__checkForExpired" ID="HistoryManager.__checkForExpired"></a>
299 <h4>HistoryManager.__checkForExpired</h4>
300 <b>__checkForExpired</b>(<i></i>)
301 <p>
302 Private slot to check entries for expiration.
303 </p><a NAME="HistoryManager.__cleanUrl" ID="HistoryManager.__cleanUrl"></a>
304 <h4>HistoryManager.__cleanUrl</h4>
305 <b>__cleanUrl</b>(<i>url</i>)
306 <p>
307 Private method to generate a clean URL usable for the history entry.
308 </p><dl>
309 <dt><i>url</i> (QUrl)</dt>
310 <dd>
311 original URL
312 </dd>
313 </dl><dl>
314 <dt>Returns:</dt>
315 <dd>
316 cleaned URL
317 </dd>
318 </dl><dl>
319 <dt>Return Type:</dt>
320 <dd>
321 QUrl
322 </dd>
323 </dl><a NAME="HistoryManager.__cleanUrlStr" ID="HistoryManager.__cleanUrlStr"></a>
324 <h4>HistoryManager.__cleanUrlStr</h4>
325 <b>__cleanUrlStr</b>(<i>url</i>)
326 <p>
327 Private method to generate a clean URL usable for the history entry.
328 </p><dl>
329 <dt><i>url</i> (QUrl)</dt>
330 <dd>
331 original URL
332 </dd>
333 </dl><dl>
334 <dt>Returns:</dt>
335 <dd>
336 cleaned URL
337 </dd>
338 </dl><dl>
339 <dt>Return Type:</dt>
340 <dd>
341 str
342 </dd>
343 </dl><a NAME="HistoryManager.__findFirstHistoryEntry" ID="HistoryManager.__findFirstHistoryEntry"></a>
344 <h4>HistoryManager.__findFirstHistoryEntry</h4>
345 <b>__findFirstHistoryEntry</b>(<i>url</i>)
346 <p>
347 Private method to find the first entry for the given URL.
348 </p><dl>
349 <dt><i>url</i> (str)</dt>
350 <dd>
351 URL to search for
352 </dd>
353 </dl><dl>
354 <dt>Returns:</dt>
355 <dd>
356 first entry for the given URL
357 </dd>
358 </dl><dl>
359 <dt>Return Type:</dt>
360 <dd>
361 HistoryEntry
362 </dd>
363 </dl><a NAME="HistoryManager.__load" ID="HistoryManager.__load"></a>
364 <h4>HistoryManager.__load</h4>
365 <b>__load</b>(<i></i>)
366 <p>
367 Private method to load the saved history entries from disk.
368 </p><a NAME="HistoryManager.__refreshFrequencies" ID="HistoryManager.__refreshFrequencies"></a>
369 <h4>HistoryManager.__refreshFrequencies</h4>
370 <b>__refreshFrequencies</b>(<i></i>)
371 <p>
372 Private slot to recalculate the refresh frequencies.
373 </p><a NAME="HistoryManager.__startFrequencyTimer" ID="HistoryManager.__startFrequencyTimer"></a>
374 <h4>HistoryManager.__startFrequencyTimer</h4>
375 <b>__startFrequencyTimer</b>(<i></i>)
376 <p>
377 Private method to start the timer to recalculate the frequencies.
378 </p><a NAME="HistoryManager.__updateVisitCount" ID="HistoryManager.__updateVisitCount"></a>
379 <h4>HistoryManager.__updateVisitCount</h4>
380 <b>__updateVisitCount</b>(<i>url, count</i>)
381 <p>
382 Private method to update the visit count for all entries of the
383 given URL.
384 </p><dl>
385 <dt><i>url</i> (str)</dt>
386 <dd>
387 URL to be updated
388 </dd><dt><i>count</i> (int)</dt>
389 <dd>
390 new visit count
391 </dd>
392 </dl><a NAME="HistoryManager.addHistoryEntry" ID="HistoryManager.addHistoryEntry"></a>
393 <h4>HistoryManager.addHistoryEntry</h4>
394 <b>addHistoryEntry</b>(<i>view</i>)
395 <p>
396 Public method to add a history entry.
397 </p><dl>
398 <dt><i>view</i> (WebBrowserView)</dt>
399 <dd>
400 reference to the view to add an entry for
401 </dd>
402 </dl><a NAME="HistoryManager.clear" ID="HistoryManager.clear"></a>
403 <h4>HistoryManager.clear</h4>
404 <b>clear</b>(<i>period=0</i>)
405 <p>
406 Public slot to clear the complete history.
407 </p><dl>
408 <dt><i>period</i></dt>
409 <dd>
410 history period in milliseconds to be cleared (integer)
411 </dd>
412 </dl><a NAME="HistoryManager.close" ID="HistoryManager.close"></a>
413 <h4>HistoryManager.close</h4>
414 <b>close</b>(<i></i>)
415 <p>
416 Public method to close the history manager.
417 </p><a NAME="HistoryManager.daysToExpire" ID="HistoryManager.daysToExpire"></a>
418 <h4>HistoryManager.daysToExpire</h4>
419 <b>daysToExpire</b>(<i></i>)
420 <p>
421 Public method to get the days for entry expiration.
422 </p><dl>
423 <dt>Returns:</dt>
424 <dd>
425 days for entry expiration (integer)
426 </dd>
427 </dl><a NAME="HistoryManager.getFileName" ID="HistoryManager.getFileName"></a>
428 <h4>HistoryManager.getFileName</h4>
429 <b>getFileName</b>(<i></i>)
430 <p>
431 Public method to get the file name of the history file.
432 </p><dl>
433 <dt>Returns:</dt>
434 <dd>
435 name of the history file (string)
436 </dd>
437 </dl><a NAME="HistoryManager.history" ID="HistoryManager.history"></a>
438 <h4>HistoryManager.history</h4>
439 <b>history</b>(<i></i>)
440 <p>
441 Public method to return the history.
442 </p><dl>
443 <dt>Returns:</dt>
444 <dd>
445 reference to the list of history entries (list of HistoryEntry)
446 </dd>
447 </dl><a NAME="HistoryManager.historyFilterModel" ID="HistoryManager.historyFilterModel"></a>
448 <h4>HistoryManager.historyFilterModel</h4>
449 <b>historyFilterModel</b>(<i></i>)
450 <p>
451 Public method to get a reference to the history filter model.
452 </p><dl>
453 <dt>Returns:</dt>
454 <dd>
455 reference to the history filter model (HistoryFilterModel)
456 </dd>
457 </dl><a NAME="HistoryManager.historyModel" ID="HistoryManager.historyModel"></a>
458 <h4>HistoryManager.historyModel</h4>
459 <b>historyModel</b>(<i></i>)
460 <p>
461 Public method to get a reference to the history model.
462 </p><dl>
463 <dt>Returns:</dt>
464 <dd>
465 reference to the history model (HistoryModel)
466 </dd>
467 </dl><a NAME="HistoryManager.historyTreeModel" ID="HistoryManager.historyTreeModel"></a>
468 <h4>HistoryManager.historyTreeModel</h4>
469 <b>historyTreeModel</b>(<i></i>)
470 <p>
471 Public method to get a reference to the history tree model.
472 </p><dl>
473 <dt>Returns:</dt>
474 <dd>
475 reference to the history tree model (HistoryTreeModel)
476 </dd>
477 </dl><a NAME="HistoryManager.preferencesChanged" ID="HistoryManager.preferencesChanged"></a>
478 <h4>HistoryManager.preferencesChanged</h4>
479 <b>preferencesChanged</b>(<i></i>)
480 <p>
481 Public method to indicate a change of preferences.
482 </p><a NAME="HistoryManager.reload" ID="HistoryManager.reload"></a>
483 <h4>HistoryManager.reload</h4>
484 <b>reload</b>(<i></i>)
485 <p>
486 Public method to reload the history.
487 </p><a NAME="HistoryManager.removeHistoryEntry" ID="HistoryManager.removeHistoryEntry"></a>
488 <h4>HistoryManager.removeHistoryEntry</h4>
489 <b>removeHistoryEntry</b>(<i>url, title=""</i>)
490 <p>
491 Public method to remove a history entry.
492 </p><dl>
493 <dt><i>url</i></dt>
494 <dd>
495 URL of the entry to remove (QUrl)
496 </dd><dt><i>title</i></dt>
497 <dd>
498 title of the entry to remove (string)
499 </dd>
500 </dl><a NAME="HistoryManager.save" ID="HistoryManager.save"></a>
501 <h4>HistoryManager.save</h4>
502 <b>save</b>(<i></i>)
503 <p>
504 Public slot to save the history entries to disk.
505 </p><a NAME="HistoryManager.setDaysToExpire" ID="HistoryManager.setDaysToExpire"></a>
506 <h4>HistoryManager.setDaysToExpire</h4>
507 <b>setDaysToExpire</b>(<i>limit</i>)
508 <p>
509 Public method to set the days for entry expiration.
510 </p><dl>
511 <dt><i>limit</i></dt>
512 <dd>
513 days for entry expiration (integer)
514 </dd>
515 </dl><a NAME="HistoryManager.setHistory" ID="HistoryManager.setHistory"></a>
516 <h4>HistoryManager.setHistory</h4>
517 <b>setHistory</b>(<i>history, loadedAndSorted=False</i>)
518 <p>
519 Public method to set a new history.
520 </p><dl>
521 <dt><i>history</i></dt>
522 <dd>
523 reference to the list of history entries to be set
524 (list of HistoryEntry)
525 </dd><dt><i>loadedAndSorted</i></dt>
526 <dd>
527 flag indicating that the list is sorted
528 (boolean)
529 </dd>
530 </dl><a NAME="HistoryManager.siteVisitsCount" ID="HistoryManager.siteVisitsCount"></a>
531 <h4>HistoryManager.siteVisitsCount</h4>
532 <b>siteVisitsCount</b>(<i>scheme, host</i>)
533 <p>
534 Public method to get the visit count for a web site using the given
535 scheme.
536 </p><dl>
537 <dt><i>scheme</i> (str)</dt>
538 <dd>
539 scheme to look for
540 </dd><dt><i>host</i> (str)</dt>
541 <dd>
542 host to look for
543 </dd>
544 </dl><dl>
545 <dt>Returns:</dt>
546 <dd>
547 number of visits to this site
548 </dd>
549 </dl><dl>
550 <dt>Return Type:</dt>
551 <dd>
552 int
553 </dd>
554 </dl><a NAME="HistoryManager.updateHistoryEntry" ID="HistoryManager.updateHistoryEntry"></a>
555 <h4>HistoryManager.updateHistoryEntry</h4>
556 <b>updateHistoryEntry</b>(<i>url, title</i>)
557 <p>
558 Public method to update a history entry.
559 </p><dl>
560 <dt><i>url</i></dt>
561 <dd>
562 URL of the entry to update (string)
563 </dd><dt><i>title</i></dt>
564 <dd>
565 title of the entry to update (string)
566 </dd>
567 </dl>
568 <div align="right"><a href="#top">Up</a></div>
569 <hr />
570 </body></html>

eric ide

mercurial