src/eric7/Documentation/Source/eric7.WebBrowser.History.HistoryManager.html

branch
eric7
changeset 9209
b99e7fd55fd3
parent 8596
d64760b2da50
child 10436
f6881d10e995
equal deleted inserted replaced
9208:3fc8dfeb6ebe 9209:b99e7fd55fd3
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.WebBrowser.History.HistoryManager</title>
4 <meta charset="UTF-8">
5 <link rel="stylesheet" href="styles.css">
6 </head>
7 <body>
8 <a NAME="top" ID="top"></a>
9 <h1>eric7.WebBrowser.History.HistoryManager</h1>
10
11 <p>
12 Module implementing the history manager.
13 </p>
14 <h3>Global Attributes</h3>
15
16 <table>
17 <tr><td>HISTORY_VERSIONS</td></tr><tr><td>HISTORY_VERSION_42</td></tr><tr><td>HISTORY_VERSION_60</td></tr>
18 </table>
19 <h3>Classes</h3>
20
21 <table>
22
23 <tr>
24 <td><a href="#HistoryEntry">HistoryEntry</a></td>
25 <td>Class implementing a history entry.</td>
26 </tr>
27 <tr>
28 <td><a href="#HistoryManager">HistoryManager</a></td>
29 <td>Class implementing the history manager.</td>
30 </tr>
31 </table>
32 <h3>Functions</h3>
33
34 <table>
35 <tr><td>None</td></tr>
36 </table>
37 <hr />
38 <hr />
39 <a NAME="HistoryEntry" ID="HistoryEntry"></a>
40 <h2>HistoryEntry</h2>
41
42 <p>
43 Class implementing a history entry.
44 </p>
45 <h3>Derived from</h3>
46 None
47 <h3>Class Attributes</h3>
48
49 <table>
50 <tr><td>None</td></tr>
51 </table>
52 <h3>Class Methods</h3>
53
54 <table>
55 <tr><td>None</td></tr>
56 </table>
57 <h3>Methods</h3>
58
59 <table>
60
61 <tr>
62 <td><a href="#HistoryEntry.__init__">HistoryEntry</a></td>
63 <td>Constructor</td>
64 </tr>
65 <tr>
66 <td><a href="#HistoryEntry.__eq__">__eq__</a></td>
67 <td>Special method determining equality.</td>
68 </tr>
69 <tr>
70 <td><a href="#HistoryEntry.__lt__">__lt__</a></td>
71 <td>Special method determining less relation.</td>
72 </tr>
73 <tr>
74 <td><a href="#HistoryEntry.isValid">isValid</a></td>
75 <td>Public method to determine validity.</td>
76 </tr>
77 <tr>
78 <td><a href="#HistoryEntry.userTitle">userTitle</a></td>
79 <td>Public method to get the title of the history entry.</td>
80 </tr>
81 </table>
82 <h3>Static Methods</h3>
83
84 <table>
85 <tr><td>None</td></tr>
86 </table>
87
88 <a NAME="HistoryEntry.__init__" ID="HistoryEntry.__init__"></a>
89 <h4>HistoryEntry (Constructor)</h4>
90 <b>HistoryEntry</b>(<i>url=None, dateTime=None, title=None, visitCount=None</i>)
91
92 <p>
93 Constructor
94 </p>
95 <dl>
96
97 <dt><i>url</i></dt>
98 <dd>
99 URL of the history entry (string)
100 </dd>
101 <dt><i>dateTime</i></dt>
102 <dd>
103 date and time this entry was created (QDateTime)
104 </dd>
105 <dt><i>title</i></dt>
106 <dd>
107 title string for the history entry (string)
108 </dd>
109 <dt><i>visitCount</i></dt>
110 <dd>
111 number of visits of this URL (int)
112 </dd>
113 </dl>
114 <a NAME="HistoryEntry.__eq__" ID="HistoryEntry.__eq__"></a>
115 <h4>HistoryEntry.__eq__</h4>
116 <b>__eq__</b>(<i>other</i>)
117
118 <p>
119 Special method determining equality.
120 </p>
121 <dl>
122
123 <dt><i>other</i></dt>
124 <dd>
125 reference to the history entry to compare against
126 (HistoryEntry)
127 </dd>
128 </dl>
129 <dl>
130 <dt>Return:</dt>
131 <dd>
132 flag indicating equality (boolean)
133 </dd>
134 </dl>
135 <a NAME="HistoryEntry.__lt__" ID="HistoryEntry.__lt__"></a>
136 <h4>HistoryEntry.__lt__</h4>
137 <b>__lt__</b>(<i>other</i>)
138
139 <p>
140 Special method determining less relation.
141 </p>
142 <p>
143 Note: History is sorted in reverse order by date and time
144 </p>
145 <dl>
146
147 <dt><i>other</i></dt>
148 <dd>
149 reference to the history entry to compare against
150 (HistoryEntry)
151 </dd>
152 </dl>
153 <dl>
154 <dt>Return:</dt>
155 <dd>
156 flag indicating less (boolean)
157 </dd>
158 </dl>
159 <a NAME="HistoryEntry.isValid" ID="HistoryEntry.isValid"></a>
160 <h4>HistoryEntry.isValid</h4>
161 <b>isValid</b>(<i></i>)
162
163 <p>
164 Public method to determine validity.
165 </p>
166 <dl>
167 <dt>Return:</dt>
168 <dd>
169 flag indicating validity
170 </dd>
171 </dl>
172 <dl>
173 <dt>Return Type:</dt>
174 <dd>
175 bool
176 </dd>
177 </dl>
178 <a NAME="HistoryEntry.userTitle" ID="HistoryEntry.userTitle"></a>
179 <h4>HistoryEntry.userTitle</h4>
180 <b>userTitle</b>(<i></i>)
181
182 <p>
183 Public method to get the title of the history entry.
184 </p>
185 <dl>
186 <dt>Return:</dt>
187 <dd>
188 title of the entry (string)
189 </dd>
190 </dl>
191 <div align="right"><a href="#top">Up</a></div>
192 <hr />
193 <hr />
194 <a NAME="HistoryManager" ID="HistoryManager"></a>
195 <h2>HistoryManager</h2>
196
197 <p>
198 Class implementing the history manager.
199 </p>
200 <h3>Signals</h3>
201 <dl>
202
203 <dt>entryAdded(HistoryEntry)</dt>
204 <dd>
205 emitted after a history entry has been
206 added
207 </dd>
208 <dt>entryRemoved(HistoryEntry)</dt>
209 <dd>
210 emitted after a history entry has been
211 removed
212 </dd>
213 <dt>entryUpdated(int)</dt>
214 <dd>
215 emitted after a history entry has been updated
216 </dd>
217 <dt>historyCleared()</dt>
218 <dd>
219 emitted after the history has been cleared
220 </dd>
221 <dt>historyReset()</dt>
222 <dd>
223 emitted after the history has been reset
224 </dd>
225 <dt>historySaved()</dt>
226 <dd>
227 emitted after the history was saved
228 </dd>
229 </dl>
230 <h3>Derived from</h3>
231 QObject
232 <h3>Class Attributes</h3>
233
234 <table>
235 <tr><td>None</td></tr>
236 </table>
237 <h3>Class Methods</h3>
238
239 <table>
240 <tr><td>None</td></tr>
241 </table>
242 <h3>Methods</h3>
243
244 <table>
245
246 <tr>
247 <td><a href="#HistoryManager.__init__">HistoryManager</a></td>
248 <td>Constructor</td>
249 </tr>
250 <tr>
251 <td><a href="#HistoryManager.__checkForExpired">__checkForExpired</a></td>
252 <td>Private slot to check entries for expiration.</td>
253 </tr>
254 <tr>
255 <td><a href="#HistoryManager.__cleanUrl">__cleanUrl</a></td>
256 <td>Private method to generate a clean URL usable for the history entry.</td>
257 </tr>
258 <tr>
259 <td><a href="#HistoryManager.__cleanUrlStr">__cleanUrlStr</a></td>
260 <td>Private method to generate a clean URL usable for the history entry.</td>
261 </tr>
262 <tr>
263 <td><a href="#HistoryManager.__findFirstHistoryEntry">__findFirstHistoryEntry</a></td>
264 <td>Private method to find the first entry for the given URL.</td>
265 </tr>
266 <tr>
267 <td><a href="#HistoryManager.__load">__load</a></td>
268 <td>Private method to load the saved history entries from disk.</td>
269 </tr>
270 <tr>
271 <td><a href="#HistoryManager.__refreshFrequencies">__refreshFrequencies</a></td>
272 <td>Private slot to recalculate the refresh frequencies.</td>
273 </tr>
274 <tr>
275 <td><a href="#HistoryManager.__startFrequencyTimer">__startFrequencyTimer</a></td>
276 <td>Private method to start the timer to recalculate the frequencies.</td>
277 </tr>
278 <tr>
279 <td><a href="#HistoryManager.__updateVisitCount">__updateVisitCount</a></td>
280 <td>Private method to update the visit count for all entries of the given URL.</td>
281 </tr>
282 <tr>
283 <td><a href="#HistoryManager.addHistoryEntry">addHistoryEntry</a></td>
284 <td>Public method to add a history entry.</td>
285 </tr>
286 <tr>
287 <td><a href="#HistoryManager.clear">clear</a></td>
288 <td>Public slot to clear the complete history.</td>
289 </tr>
290 <tr>
291 <td><a href="#HistoryManager.close">close</a></td>
292 <td>Public method to close the history manager.</td>
293 </tr>
294 <tr>
295 <td><a href="#HistoryManager.daysToExpire">daysToExpire</a></td>
296 <td>Public method to get the days for entry expiration.</td>
297 </tr>
298 <tr>
299 <td><a href="#HistoryManager.getFileName">getFileName</a></td>
300 <td>Public method to get the file name of the history file.</td>
301 </tr>
302 <tr>
303 <td><a href="#HistoryManager.history">history</a></td>
304 <td>Public method to return the history.</td>
305 </tr>
306 <tr>
307 <td><a href="#HistoryManager.historyFilterModel">historyFilterModel</a></td>
308 <td>Public method to get a reference to the history filter model.</td>
309 </tr>
310 <tr>
311 <td><a href="#HistoryManager.historyModel">historyModel</a></td>
312 <td>Public method to get a reference to the history model.</td>
313 </tr>
314 <tr>
315 <td><a href="#HistoryManager.historyTreeModel">historyTreeModel</a></td>
316 <td>Public method to get a reference to the history tree model.</td>
317 </tr>
318 <tr>
319 <td><a href="#HistoryManager.preferencesChanged">preferencesChanged</a></td>
320 <td>Public method to indicate a change of preferences.</td>
321 </tr>
322 <tr>
323 <td><a href="#HistoryManager.reload">reload</a></td>
324 <td>Public method to reload the history.</td>
325 </tr>
326 <tr>
327 <td><a href="#HistoryManager.removeHistoryEntry">removeHistoryEntry</a></td>
328 <td>Public method to remove a history entry.</td>
329 </tr>
330 <tr>
331 <td><a href="#HistoryManager.save">save</a></td>
332 <td>Public slot to save the history entries to disk.</td>
333 </tr>
334 <tr>
335 <td><a href="#HistoryManager.setDaysToExpire">setDaysToExpire</a></td>
336 <td>Public method to set the days for entry expiration.</td>
337 </tr>
338 <tr>
339 <td><a href="#HistoryManager.setHistory">setHistory</a></td>
340 <td>Public method to set a new history.</td>
341 </tr>
342 <tr>
343 <td><a href="#HistoryManager.siteVisitsCount">siteVisitsCount</a></td>
344 <td>Public method to get the visit count for a web site using the given scheme.</td>
345 </tr>
346 <tr>
347 <td><a href="#HistoryManager.updateHistoryEntry">updateHistoryEntry</a></td>
348 <td>Public method to update a history entry.</td>
349 </tr>
350 </table>
351 <h3>Static Methods</h3>
352
353 <table>
354 <tr><td>None</td></tr>
355 </table>
356
357 <a NAME="HistoryManager.__init__" ID="HistoryManager.__init__"></a>
358 <h4>HistoryManager (Constructor)</h4>
359 <b>HistoryManager</b>(<i>parent=None</i>)
360
361 <p>
362 Constructor
363 </p>
364 <dl>
365
366 <dt><i>parent</i></dt>
367 <dd>
368 reference to the parent object (QObject)
369 </dd>
370 </dl>
371 <a NAME="HistoryManager.__checkForExpired" ID="HistoryManager.__checkForExpired"></a>
372 <h4>HistoryManager.__checkForExpired</h4>
373 <b>__checkForExpired</b>(<i></i>)
374
375 <p>
376 Private slot to check entries for expiration.
377 </p>
378 <a NAME="HistoryManager.__cleanUrl" ID="HistoryManager.__cleanUrl"></a>
379 <h4>HistoryManager.__cleanUrl</h4>
380 <b>__cleanUrl</b>(<i>url</i>)
381
382 <p>
383 Private method to generate a clean URL usable for the history entry.
384 </p>
385 <dl>
386
387 <dt><i>url</i> (QUrl)</dt>
388 <dd>
389 original URL
390 </dd>
391 </dl>
392 <dl>
393 <dt>Return:</dt>
394 <dd>
395 cleaned URL
396 </dd>
397 </dl>
398 <dl>
399 <dt>Return Type:</dt>
400 <dd>
401 QUrl
402 </dd>
403 </dl>
404 <a NAME="HistoryManager.__cleanUrlStr" ID="HistoryManager.__cleanUrlStr"></a>
405 <h4>HistoryManager.__cleanUrlStr</h4>
406 <b>__cleanUrlStr</b>(<i>url</i>)
407
408 <p>
409 Private method to generate a clean URL usable for the history entry.
410 </p>
411 <dl>
412
413 <dt><i>url</i> (QUrl)</dt>
414 <dd>
415 original URL
416 </dd>
417 </dl>
418 <dl>
419 <dt>Return:</dt>
420 <dd>
421 cleaned URL
422 </dd>
423 </dl>
424 <dl>
425 <dt>Return Type:</dt>
426 <dd>
427 str
428 </dd>
429 </dl>
430 <a NAME="HistoryManager.__findFirstHistoryEntry" ID="HistoryManager.__findFirstHistoryEntry"></a>
431 <h4>HistoryManager.__findFirstHistoryEntry</h4>
432 <b>__findFirstHistoryEntry</b>(<i>url</i>)
433
434 <p>
435 Private method to find the first entry for the given URL.
436 </p>
437 <dl>
438
439 <dt><i>url</i> (str)</dt>
440 <dd>
441 URL to search for
442 </dd>
443 </dl>
444 <dl>
445 <dt>Return:</dt>
446 <dd>
447 first entry for the given URL
448 </dd>
449 </dl>
450 <dl>
451 <dt>Return Type:</dt>
452 <dd>
453 HistoryEntry
454 </dd>
455 </dl>
456 <a NAME="HistoryManager.__load" ID="HistoryManager.__load"></a>
457 <h4>HistoryManager.__load</h4>
458 <b>__load</b>(<i></i>)
459
460 <p>
461 Private method to load the saved history entries from disk.
462 </p>
463 <a NAME="HistoryManager.__refreshFrequencies" ID="HistoryManager.__refreshFrequencies"></a>
464 <h4>HistoryManager.__refreshFrequencies</h4>
465 <b>__refreshFrequencies</b>(<i></i>)
466
467 <p>
468 Private slot to recalculate the refresh frequencies.
469 </p>
470 <a NAME="HistoryManager.__startFrequencyTimer" ID="HistoryManager.__startFrequencyTimer"></a>
471 <h4>HistoryManager.__startFrequencyTimer</h4>
472 <b>__startFrequencyTimer</b>(<i></i>)
473
474 <p>
475 Private method to start the timer to recalculate the frequencies.
476 </p>
477 <a NAME="HistoryManager.__updateVisitCount" ID="HistoryManager.__updateVisitCount"></a>
478 <h4>HistoryManager.__updateVisitCount</h4>
479 <b>__updateVisitCount</b>(<i>url, count</i>)
480
481 <p>
482 Private method to update the visit count for all entries of the
483 given URL.
484 </p>
485 <dl>
486
487 <dt><i>url</i> (str)</dt>
488 <dd>
489 URL to be updated
490 </dd>
491 <dt><i>count</i> (int)</dt>
492 <dd>
493 new visit count
494 </dd>
495 </dl>
496 <a NAME="HistoryManager.addHistoryEntry" ID="HistoryManager.addHistoryEntry"></a>
497 <h4>HistoryManager.addHistoryEntry</h4>
498 <b>addHistoryEntry</b>(<i>view</i>)
499
500 <p>
501 Public method to add a history entry.
502 </p>
503 <dl>
504
505 <dt><i>view</i> (WebBrowserView)</dt>
506 <dd>
507 reference to the view to add an entry for
508 </dd>
509 </dl>
510 <a NAME="HistoryManager.clear" ID="HistoryManager.clear"></a>
511 <h4>HistoryManager.clear</h4>
512 <b>clear</b>(<i>period=0</i>)
513
514 <p>
515 Public slot to clear the complete history.
516 </p>
517 <dl>
518
519 <dt><i>period</i></dt>
520 <dd>
521 history period in milliseconds to be cleared (integer)
522 </dd>
523 </dl>
524 <a NAME="HistoryManager.close" ID="HistoryManager.close"></a>
525 <h4>HistoryManager.close</h4>
526 <b>close</b>(<i></i>)
527
528 <p>
529 Public method to close the history manager.
530 </p>
531 <a NAME="HistoryManager.daysToExpire" ID="HistoryManager.daysToExpire"></a>
532 <h4>HistoryManager.daysToExpire</h4>
533 <b>daysToExpire</b>(<i></i>)
534
535 <p>
536 Public method to get the days for entry expiration.
537 </p>
538 <dl>
539 <dt>Return:</dt>
540 <dd>
541 days for entry expiration (integer)
542 </dd>
543 </dl>
544 <a NAME="HistoryManager.getFileName" ID="HistoryManager.getFileName"></a>
545 <h4>HistoryManager.getFileName</h4>
546 <b>getFileName</b>(<i></i>)
547
548 <p>
549 Public method to get the file name of the history file.
550 </p>
551 <dl>
552 <dt>Return:</dt>
553 <dd>
554 name of the history file (string)
555 </dd>
556 </dl>
557 <a NAME="HistoryManager.history" ID="HistoryManager.history"></a>
558 <h4>HistoryManager.history</h4>
559 <b>history</b>(<i></i>)
560
561 <p>
562 Public method to return the history.
563 </p>
564 <dl>
565 <dt>Return:</dt>
566 <dd>
567 reference to the list of history entries (list of HistoryEntry)
568 </dd>
569 </dl>
570 <a NAME="HistoryManager.historyFilterModel" ID="HistoryManager.historyFilterModel"></a>
571 <h4>HistoryManager.historyFilterModel</h4>
572 <b>historyFilterModel</b>(<i></i>)
573
574 <p>
575 Public method to get a reference to the history filter model.
576 </p>
577 <dl>
578 <dt>Return:</dt>
579 <dd>
580 reference to the history filter model (HistoryFilterModel)
581 </dd>
582 </dl>
583 <a NAME="HistoryManager.historyModel" ID="HistoryManager.historyModel"></a>
584 <h4>HistoryManager.historyModel</h4>
585 <b>historyModel</b>(<i></i>)
586
587 <p>
588 Public method to get a reference to the history model.
589 </p>
590 <dl>
591 <dt>Return:</dt>
592 <dd>
593 reference to the history model (HistoryModel)
594 </dd>
595 </dl>
596 <a NAME="HistoryManager.historyTreeModel" ID="HistoryManager.historyTreeModel"></a>
597 <h4>HistoryManager.historyTreeModel</h4>
598 <b>historyTreeModel</b>(<i></i>)
599
600 <p>
601 Public method to get a reference to the history tree model.
602 </p>
603 <dl>
604 <dt>Return:</dt>
605 <dd>
606 reference to the history tree model (HistoryTreeModel)
607 </dd>
608 </dl>
609 <a NAME="HistoryManager.preferencesChanged" ID="HistoryManager.preferencesChanged"></a>
610 <h4>HistoryManager.preferencesChanged</h4>
611 <b>preferencesChanged</b>(<i></i>)
612
613 <p>
614 Public method to indicate a change of preferences.
615 </p>
616 <a NAME="HistoryManager.reload" ID="HistoryManager.reload"></a>
617 <h4>HistoryManager.reload</h4>
618 <b>reload</b>(<i></i>)
619
620 <p>
621 Public method to reload the history.
622 </p>
623 <a NAME="HistoryManager.removeHistoryEntry" ID="HistoryManager.removeHistoryEntry"></a>
624 <h4>HistoryManager.removeHistoryEntry</h4>
625 <b>removeHistoryEntry</b>(<i>url, title=""</i>)
626
627 <p>
628 Public method to remove a history entry.
629 </p>
630 <dl>
631
632 <dt><i>url</i></dt>
633 <dd>
634 URL of the entry to remove (QUrl)
635 </dd>
636 <dt><i>title</i></dt>
637 <dd>
638 title of the entry to remove (string)
639 </dd>
640 </dl>
641 <a NAME="HistoryManager.save" ID="HistoryManager.save"></a>
642 <h4>HistoryManager.save</h4>
643 <b>save</b>(<i></i>)
644
645 <p>
646 Public slot to save the history entries to disk.
647 </p>
648 <a NAME="HistoryManager.setDaysToExpire" ID="HistoryManager.setDaysToExpire"></a>
649 <h4>HistoryManager.setDaysToExpire</h4>
650 <b>setDaysToExpire</b>(<i>limit</i>)
651
652 <p>
653 Public method to set the days for entry expiration.
654 </p>
655 <dl>
656
657 <dt><i>limit</i></dt>
658 <dd>
659 days for entry expiration (integer)
660 </dd>
661 </dl>
662 <a NAME="HistoryManager.setHistory" ID="HistoryManager.setHistory"></a>
663 <h4>HistoryManager.setHistory</h4>
664 <b>setHistory</b>(<i>history, loadedAndSorted=False</i>)
665
666 <p>
667 Public method to set a new history.
668 </p>
669 <dl>
670
671 <dt><i>history</i></dt>
672 <dd>
673 reference to the list of history entries to be set
674 (list of HistoryEntry)
675 </dd>
676 <dt><i>loadedAndSorted</i></dt>
677 <dd>
678 flag indicating that the list is sorted
679 (boolean)
680 </dd>
681 </dl>
682 <a NAME="HistoryManager.siteVisitsCount" ID="HistoryManager.siteVisitsCount"></a>
683 <h4>HistoryManager.siteVisitsCount</h4>
684 <b>siteVisitsCount</b>(<i>scheme, host</i>)
685
686 <p>
687 Public method to get the visit count for a web site using the given
688 scheme.
689 </p>
690 <dl>
691
692 <dt><i>scheme</i> (str)</dt>
693 <dd>
694 scheme to look for
695 </dd>
696 <dt><i>host</i> (str)</dt>
697 <dd>
698 host to look for
699 </dd>
700 </dl>
701 <dl>
702 <dt>Return:</dt>
703 <dd>
704 number of visits to this site
705 </dd>
706 </dl>
707 <dl>
708 <dt>Return Type:</dt>
709 <dd>
710 int
711 </dd>
712 </dl>
713 <a NAME="HistoryManager.updateHistoryEntry" ID="HistoryManager.updateHistoryEntry"></a>
714 <h4>HistoryManager.updateHistoryEntry</h4>
715 <b>updateHistoryEntry</b>(<i>url, title</i>)
716
717 <p>
718 Public method to update a history entry.
719 </p>
720 <dl>
721
722 <dt><i>url</i></dt>
723 <dd>
724 URL of the entry to update (string)
725 </dd>
726 <dt><i>title</i></dt>
727 <dd>
728 title of the entry to update (string)
729 </dd>
730 </dl>
731 <div align="right"><a href="#top">Up</a></div>
732 <hr />
733 </body></html>

eric ide

mercurial