# eric4.Helpviewer.History.HistoryManager

Module implementing the history manager.

### Global Attributes

HISTORY_VERSION

### Classes

HistoryEntry | Class implementing a history entry.
HistoryManager | Class implementing the history manager.

### Functions

None

## HistoryEntry

Class implementing a history entry.

### Derived from

object

### Class Attributes

None

### Class Methods

None

### Methods

HistoryEntry | Constructor
__eq__ | Special method determining equality.
__lt__ | Special method determining less relation.
userTitle | Public method to get the title of the history entry.

### Static Methods

None

#### HistoryEntry (Constructor)

HistoryEntry(url = None, dateTime = None, title = None)

Constructor

url
  URL of the history entry (QString)
dateTime
  date and time this entry was created (QDateTime)
title
  title string for the history entry (QString)

#### HistoryEntry.__eq__

__eq__(other)

Special method determining equality.

other
  reference to the history entry to compare against (HistoryEntry)

Returns:
  flag indicating equality (boolean)

#### HistoryEntry.__lt__

__lt__(other)

Special method determining less relation.

Note: History is sorted in reverse order by date and time

other
  reference to the history entry to compare against (HistoryEntry)

Returns:
  flag indicating less (boolean)

#### HistoryEntry.userTitle

userTitle()

Public method to get the title of the history entry.

Returns:
  title of the entry (QString)

Up

## HistoryManager

Class implementing the history manager.

### Signals

entryAdded
  emitted after a history entry has been added
entryRemoved
  emitted after a history entry has been removed
entryUpdated(int)
  emitted after a history entry has been updated
historyCleared()
  emitted after the history has been cleared
historyReset()
  emitted after the history has been reset

### Derived from

QWebHistoryInterface

### Class Attributes

None

### Class Methods

None

### Methods

HistoryManager | Constructor
__checkForExpired | Private slot to check entries for expiration.
__load | Private method to load the saved history entries from disk.
__refreshFrequencies | Private slot to recalculate the refresh frequencies.
__startFrequencyTimer | Private method to start the timer to recalculate the frequencies.
_addHistoryEntry | Protected method to add a history item.
_removeHistoryEntry | Protected method to remove a history item.
addHistoryEntry | Public method to add a history entry.
clear | Public slot to clear the complete history.
close | Public method to close the history manager.
daysToExpire | Public method to get the days for entry expiration.
history | Public method to return the history.
historyContains | Public method to check the history for an entry.
historyFilterModel | Public method to get a reference to the history filter model.
historyModel | Public method to get a reference to the history model.
historyTreeModel | Public method to get a reference to the history tree model.
preferencesChanged | Public method to indicate a change of preferences.
removeHistoryEntry | Public method to remove a history entry.
save | Public slot to save the history entries to disk.
setDaysToExpire | Public method to set the days for entry expiration.
setHistory | Public method to set a new history.
updateHistoryEntry | Public method to update a history entry.

### Static Methods

None

#### HistoryManager (Constructor)

HistoryManager(parent = None)

Constructor

parent
  reference to the parent object (QObject)

#### HistoryManager.__checkForExpired

__checkForExpired()

Private slot to check entries for expiration.

#### HistoryManager.__load

__load()

Private method to load the saved history entries from disk.

#### HistoryManager.__refreshFrequencies

__refreshFrequencies()

Private slot to recalculate the refresh frequencies.

#### HistoryManager.__startFrequencyTimer

__startFrequencyTimer()

Private method to start the timer to recalculate the frequencies.

#### HistoryManager._addHistoryEntry

_addHistoryEntry(itm)

Protected method to add a history item.

itm
  reference to the history item to add (HistoryEntry)

#### HistoryManager._removeHistoryEntry

_removeHistoryEntry(itm)

Protected method to remove a history item.

itm
  reference to the history item to remove (HistoryEntry)

#### HistoryManager.addHistoryEntry

addHistoryEntry(url)

Public method to add a history entry.

url
  URL to be added (QString)

#### HistoryManager.clear

clear()

Public slot to clear the complete history.

#### HistoryManager.close

close()

Public method to close the history manager.

#### HistoryManager.daysToExpire

daysToExpire()

Public method to get the days for entry expiration.

Returns:
  days for entry expiration (integer)

#### HistoryManager.history

history()

Public method to return the history.

Returns:
  reference to the list of history entries (list of HistoryEntry)

#### HistoryManager.historyContains

historyContains(url)

Public method to check the history for an entry.

url
  URL to check for (QString)

Returns:
  flag indicating success (boolean)

#### HistoryManager.historyFilterModel

historyFilterModel()

Public method to get a reference to the history filter model.

Returns:
  reference to the history filter model (HistoryFilterModel)

#### HistoryManager.historyModel

historyModel()

Public method to get a reference to the history model.

Returns:
  reference to the history model (HistoryModel)

#### HistoryManager.historyTreeModel

historyTreeModel()

Public method to get a reference to the history tree model.

Returns:
  reference to the history tree model (HistoryTreeModel)

#### HistoryManager.preferencesChanged

preferencesChanged()

Public method to indicate a change of preferences.

#### HistoryManager.removeHistoryEntry

removeHistoryEntry(url, title = QString())

Public method to remove a history entry.

url
  URL of the entry to remove (QUrl)
title
  title of the entry to remove (QString)

#### HistoryManager.save

save()

Public slot to save the history entries to disk.

#### HistoryManager.setDaysToExpire

setDaysToExpire(limit)

Public method to set the days for entry expiration.

limit
  days for entry expiration (integer)

#### HistoryManager.setHistory

setHistory(history, loadedAndSorted = False)

Public method to set a new history.

history
  reference to the list of history entries to be set (list of HistoryEntry)
loadedAndSorted
  flag indicating that the list is sorted (boolean)

#### HistoryManager.updateHistoryEntry

updateHistoryEntry(url, title)

Public method to update a history entry.

url
  URL of the entry to update (QString)
title
  title of the entry to update (QString)

Up