# eric5.Helpviewer.Sync.DirectorySyncHandler

Module implementing a synchronization handler using a shared directory.

### Global Attributes

None

### Classes

DirectorySyncHandler | Class implementing a synchronization handler using a shared directory.

### Functions

None

## DirectorySyncHandler

Class implementing a synchronization handler using a shared directory.

### Signals

syncError(message)
  emitted for a general error with the error message (string)
syncFinished(type_, done, download)
  emitted after a synchronization has finished (string one of "bookmarks", "history", "passwords", "useragents" or "speeddial", boolean, boolean)
syncMessage(message)
  emitted to send a message about synchronization (string)
syncStatus(type_, message)
  emitted to indicate the synchronization status (string one of "bookmarks", "history", "passwords", "useragents" or "speeddial", string)

### Derived from

SyncHandler

### Class Attributes

None

### Class Methods

None

### Methods

DirectorySyncHandler | Constructor
__downloadFile | Private method to downlaod the given file.
__initialSync | Private slot to do the initial synchronization.
__initialSyncFile | Private method to do the initial synchronization of the given file.
__syncFile | Private method to synchronize the given file.
__uploadFile | Private method to upload the given file.
initialLoadAndCheck | Public method to do the initial check.
shutdown | Public method to shut down the handler.
syncBookmarks | Public method to synchronize the bookmarks.
syncHistory | Public method to synchronize the history.
syncPasswords | Public method to synchronize the passwords.
syncSpeedDial | Public method to synchronize the speed dial data.
syncUserAgents | Public method to synchronize the user agents.

### Static Methods

None

#### DirectorySyncHandler (Constructor)

DirectorySyncHandler(parent=None)

Constructor

parent
  reference to the parent object (QObject)

#### DirectorySyncHandler.__downloadFile

__downloadFile(type_, fileName, timestamp)

Private method to downlaod the given file.

type_
  type of the synchronization event (string one of "bookmarks", "history", "passwords", "useragents" or "speeddial")
fileName
  name of the file to be downloaded (string)
timestamp
  time stamp in seconds of the file to be downloaded (integer)

#### DirectorySyncHandler.__initialSync

__initialSync()

Private slot to do the initial synchronization.

#### DirectorySyncHandler.__initialSyncFile

__initialSyncFile(type_, fileName)

Private method to do the initial synchronization of the given file.

type_
  type of the synchronization event (string one of "bookmarks", "history", "passwords", "useragents" or "speeddial")
fileName
  name of the file to be synchronized (string)

#### DirectorySyncHandler.__syncFile

__syncFile(type_, fileName)

Private method to synchronize the given file.

type_
  type of the synchronization event (string one of "bookmarks", "history", "passwords", "useragents" or "speeddial")
fileName
  name of the file to be synchronized (string)

#### DirectorySyncHandler.__uploadFile

__uploadFile(type_, fileName)

Private method to upload the given file.

type_
  type of the synchronization event (string one of "bookmarks", "history", "passwords", "useragents" or "speeddial")
fileName
  name of the file to be uploaded (string)

#### DirectorySyncHandler.initialLoadAndCheck

initialLoadAndCheck(forceUpload)

Public method to do the initial check.

forceUpload=
  flag indicating a forced upload of the files (boolean)

#### DirectorySyncHandler.shutdown

shutdown()

Public method to shut down the handler.

#### DirectorySyncHandler.syncBookmarks

syncBookmarks()

Public method to synchronize the bookmarks.

#### DirectorySyncHandler.syncHistory

syncHistory()

Public method to synchronize the history.

#### DirectorySyncHandler.syncPasswords

syncPasswords()

Public method to synchronize the passwords.

#### DirectorySyncHandler.syncSpeedDial

syncSpeedDial()

Public method to synchronize the speed dial data.

#### DirectorySyncHandler.syncUserAgents

syncUserAgents()

Public method to synchronize the user agents.

Up