Skip to content

Class QfWebdavConnection

ClassList > QfWebdavConnection

More...

  • #include <qfwebdavconnection.h>

Inherits the following classes: QObject

Public Properties

Type Name
property QStringList availablePaths
property QStringList checkedPaths
property bool isDownloadingPath
property bool isFetchingAvailablePaths
property bool isImportingPath
property bool isPasswordStored
property bool isUploadingPath
property QString lastError
property QString password
property double progress
property bool storePassword
property QString url
property QString username

Public Signals

Type Name
signal void availablePathsChanged
signal void checkedPathsChanged
signal void confirmationRequested (const QString & host, const QString & username)
signal void importSuccessful (const QString & path)
signal void isDownloadingPathChanged
signal void isFetchingAvailablePathsChanged
signal void isImportingPathChanged
signal void isPasswordStoredChanged
signal void isUploadingPathChanged
signal void lastErrorChanged
signal void passwordChanged
signal void progressChanged
signal void storePasswordChanged
signal void uploadFinished (bool success, const QString & message)
signal void uploadSkipped (const QString & reason)
signal void urlChanged
signal void usernameChanged

Public Functions

Type Name
QfWebdavConnection (QObject * parent=nullptr)
QStringList availablePaths () const
Q_INVOKABLE void cancelRequest ()
QStringList checkedPaths () const
Q_INVOKABLE void confirmRequest ()
Q_INVOKABLE void downloadPath (const QString & localPath)
Q_INVOKABLE void fetchAvailablePaths (const QString & remotePath=QString())
Q_INVOKABLE void importPath (const QString & remotePath, const QString & localPath, QString localFolder=QString())
bool isDownloadingPath () const
bool isFetchingAvailablePaths () const
bool isImportingPath () const
bool isPasswordStored () const
bool isUploadingPath () const
QString lastError () const
QString password () const
double progress () const
Q_INVOKABLE void requestUpload (const QString & projectPath, bool force=false)
void setPassword (const QString & password)
void setStorePassword (bool storePassword)
void setUrl (const QString & url)
void setUsername (const QString & username)
bool storePassword () const
Q_INVOKABLE void uploadPaths (const QStringList & localPaths)
QString url () const
QString username () const
~QfWebdavConnection () = default

Public Static Functions

Type Name
Q_INVOKABLE QStringList findWebdavProjectFolders (const QString & basePath)
Q_INVOKABLE QString findWebdavRootForPath (const QString & path)
Q_INVOKABLE void forgetHistory (const QString & url=QString(), const QString & username=QString())
Q_INVOKABLE bool hasWebdavConfiguration (const QString & path)
Q_INVOKABLE QVariantMap importHistory ()

Detailed Description

The WebDAV connection object allows connecting to a WebDAV endpoint and performing push/pull operations for imported content.

Public Properties Documentation

property availablePaths [1/2]

QStringList QfWebdavConnection::availablePaths;

property checkedPaths [1/2]

QStringList QfWebdavConnection::checkedPaths;

property isDownloadingPath [1/2]

bool QfWebdavConnection::isDownloadingPath;

property isFetchingAvailablePaths [1/2]

bool QfWebdavConnection::isFetchingAvailablePaths;

property isImportingPath [1/2]

bool QfWebdavConnection::isImportingPath;

property isPasswordStored [1/2]

bool QfWebdavConnection::isPasswordStored;

property isUploadingPath [1/2]

bool QfWebdavConnection::isUploadingPath;

property lastError [1/2]

QString QfWebdavConnection::lastError;

property password [1/2]

QString QfWebdavConnection::password;

property progress [1/2]

double QfWebdavConnection::progress;

property storePassword [1/2]

bool QfWebdavConnection::storePassword;

property url [1/2]

QString QfWebdavConnection::url;

property username [1/2]

QString QfWebdavConnection::username;

Public Signals Documentation

signal availablePathsChanged

void QfWebdavConnection::availablePathsChanged;

signal checkedPathsChanged

void QfWebdavConnection::checkedPathsChanged;

signal confirmationRequested

void QfWebdavConnection::confirmationRequested;

signal importSuccessful

void QfWebdavConnection::importSuccessful;

signal isDownloadingPathChanged

void QfWebdavConnection::isDownloadingPathChanged;

signal isFetchingAvailablePathsChanged

void QfWebdavConnection::isFetchingAvailablePathsChanged;

signal isImportingPathChanged

void QfWebdavConnection::isImportingPathChanged;

signal isPasswordStoredChanged

void QfWebdavConnection::isPasswordStoredChanged;

signal isUploadingPathChanged

void QfWebdavConnection::isUploadingPathChanged;

signal lastErrorChanged

void QfWebdavConnection::lastErrorChanged;

signal passwordChanged

void QfWebdavConnection::passwordChanged;

signal progressChanged

void QfWebdavConnection::progressChanged;

signal storePasswordChanged

void QfWebdavConnection::storePasswordChanged;

signal uploadFinished

void QfWebdavConnection::uploadFinished;

signal uploadSkipped

void QfWebdavConnection::uploadSkipped;

signal urlChanged

void QfWebdavConnection::urlChanged;

signal usernameChanged

void QfWebdavConnection::usernameChanged;

Public Functions Documentation

function QfWebdavConnection

explicit QfWebdavConnection::QfWebdavConnection (
    QObject * parent=nullptr
) 

function availablePaths [2/2]

inline QStringList QfWebdavConnection::availablePaths () const

Returns a list of fetched available paths.

See also: fetchAvailablePaths


function cancelRequest

Q_INVOKABLE void QfWebdavConnection::cancelRequest () 

Cancels a requested download or upload operation. If an upload is active, the per-project upload lock is released. For automatic uploads, uploadFinished() is emitted with a failure status.

See also: confirmationRequested

See also: isDownloadingPath

See also: isUploadingPath


function checkedPaths [2/2]

inline QStringList QfWebdavConnection::checkedPaths () const

Returns a list of checked paths.

See also: fetchAvailablePaths


function confirmRequest

Q_INVOKABLE void QfWebdavConnection::confirmRequest () 

Launches a requested download or upload operation after the user has confirmed they want to proceed. This is typically called in response to confirmationRequested().

See also: confirmationRequested

See also: isDownloadingPath

See also: isUploadingPath


function downloadPath

Q_INVOKABLE void QfWebdavConnection::downloadPath (
    const QString & localPath
) 

Download new and modified files from an imported remote path. localPath the local path within which a remote path was imported into

Note:

This is not a synchronization process; files removed remotely will not be removed locally. Furthermore, all files modified remotely will overwrite locally-stored files.


function fetchAvailablePaths

Q_INVOKABLE void QfWebdavConnection::fetchAvailablePaths (
    const QString & remotePath=QString()
) 

Fetches available remote paths from the current WebDAV endpoint.


function importPath

Q_INVOKABLE void QfWebdavConnection::importPath (
    const QString & remotePath,
    const QString & localPath,
    QString localFolder=QString()
) 

Imports a remote path into a local path stored on the device. remotePath the remote path on the WebDAV endpoint. localPath the local path localFolder the local folder name containing the imported remote path content


function isDownloadingPath [2/2]

inline bool QfWebdavConnection::isDownloadingPath () const

Returns TRUE if the WebDAV connection is conducting a download operation.


function isFetchingAvailablePaths [2/2]

inline bool QfWebdavConnection::isFetchingAvailablePaths () const

Returns TRUE if the WebDAV connection is conducting a fetching of available remote paths.


function isImportingPath [2/2]

inline bool QfWebdavConnection::isImportingPath () const

Returns TRUE if the WebDAV connection is conducting an import operation.


function isPasswordStored [2/2]

inline bool QfWebdavConnection::isPasswordStored () const

Returns TRUE if a password has been stored for a given pair of username and WebDAV URL endpoint.


function isUploadingPath [2/2]

inline bool QfWebdavConnection::isUploadingPath () const

Returns TRUE if the WebDAV connection is conducting an upload operation.


function lastError [2/2]

inline QString QfWebdavConnection::lastError () const

Returns the last error string captured by the WebDAV connection.


function password [2/2]

inline QString QfWebdavConnection::password () const

Returns the authentication password.


function progress [2/2]

double QfWebdavConnection::progress () const

Returns the progress of an ongoing import, download, or upload operation.

Note:

The returned value's range is 0.0 to 1.0.


function requestUpload

Q_INVOKABLE void QfWebdavConnection::requestUpload (
    const QString & projectPath,
    bool force=false
) 

Requests an automatic upload for the WebDAV imported project that contains projectPath. This is intended for background or scheduled upload workflows and will not prompt the user for credentials. The upload is skipped if the project is not WebDAV imported, if another upload is already running for the same project (upload lock), if no stored password is available, or if no local changes are detected since the last successful automatic upload (unless force is TRUE).

If the upload does not start, uploadSkipped() is emitted with the reason. If it starts, uploadFinished() is emitted when the upload completes.


function setPassword

void QfWebdavConnection::setPassword (
    const QString & password
) 

Sets the authentication password.


function setStorePassword

void QfWebdavConnection::setStorePassword (
    bool storePassword
) 

Sets whether the current authentication password will be saved upon successful list or file transfer operation

Parameters:

  • storePassword set to TRUE to store the current authentication password.

function setUrl

void QfWebdavConnection::setUrl (
    const QString & url
) 

Sets the WebDAV URL endpoint used to connect, list, and transfer files.

Parameters:

  • url the URL endpoint string

function setUsername

void QfWebdavConnection::setUsername (
    const QString & username
) 

Sets the authentication username.


function storePassword [2/2]

inline bool QfWebdavConnection::storePassword () const

Returns TRUE if the current authentication password will be saved upon successful list or file transfer operation.


function uploadPaths

Q_INVOKABLE void QfWebdavConnection::uploadPaths (
    const QStringList & localPaths
) 

Uploads one or more local files and/or folders to the WebDAV endpoint associated with a project previously imported via WebDAV. The provided localPaths must all belong to the same imported project (i.e. share the same WebDAV configuration); otherwise no upload is started and lastError() is set.

Note:

This is not a synchronization process; files removed locally will not be removed remotely. Modified local files will overwrite their remote versions. Hidden dot-folders are ignored, and the WebDAV configuration and lock files are never uploaded.

Before the upload starts, confirmationRequested() is emitted so the UI can ask the user to confirm. Call confirmRequest() to proceed or cancelRequest() to abort.


function url [2/2]

inline QString QfWebdavConnection::url () const

Returns the WebDAV URL endpoint used to connect, list, and transfer files.


function username [2/2]

inline QString QfWebdavConnection::username () const

Returns the authentication username.


function ~QfWebdavConnection

QfWebdavConnection::~QfWebdavConnection () = default

Public Static Functions Documentation

function findWebdavProjectFolders

static Q_INVOKABLE QStringList QfWebdavConnection::findWebdavProjectFolders (
    const QString & basePath
) 

Scans a directory recursively and returns all folders containing a WebDAV configuration file.

Parameters:

  • basePath the directory to scan

Returns:

list of absolute paths to WebDAV project folders


function findWebdavRootForPath

static Q_INVOKABLE QString QfWebdavConnection::findWebdavRootForPath (
    const QString & path
) 

Finds the WebDAV project root by walking up from the given path.

Parameters:

  • path the file or folder path to start from

Returns:

the project root path, or empty string if not found


function forgetHistory

static Q_INVOKABLE void QfWebdavConnection::forgetHistory (
    const QString & url=QString(),
    const QString & username=QString()
) 

function hasWebdavConfiguration

static Q_INVOKABLE bool QfWebdavConnection::hasWebdavConfiguration (
    const QString & path
) 

Returns TRUE if a given path contains a WebDAV configuration JSON file or is parented to a folder containing such a file.


function importHistory

static Q_INVOKABLE QVariantMap QfWebdavConnection::importHistory () 

Returns a list of import history.



The documentation for this class was generated from the following file src/core/qfwebdavconnection.h