From e92185222ea652436d0f5a36de25cbbd66347ea1 Mon Sep 17 00:00:00 2001 From: q5sys Date: Sun, 24 Sep 2017 20:25:21 -0400 Subject: prototype webdav functionality for lumina-fm --- .../desktop-utils/lumina-fm/widgets/fmwebdav.cpp | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp (limited to 'src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp') diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp b/src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp new file mode 100644 index 00000000..9c82aa3e --- /dev/null +++ b/src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp @@ -0,0 +1,23 @@ +#include "fmwebdav.h" + +fmwebdav::fmwebdav(QObject *parent) : QNetworkAccessManager(parent) ,wdRootPath(), wdUsername(), wdUassword(), wdBaseUrl(), wdCurrentConnectionType(QWebdav::HTTP){ +// typical Qnetwork connection stuff goes here +// probably ssl parts too +} + +fmwebdav::~fmwebdav(){ +} + +QString fmwebdav::hostname() const{ return wdBaseUrl.host(); } + +int fmwebdav::port() const{ return wdBaseUrl.port(); } + +QString fmwebdav::rootPath() const{ return wdRootPath;} + +QString fmwebdav::username() const{ return wdUsername; } + +QString fmwebdav::password() const{ return wdPassword; } + +fmwebdav::QWebdavConnectionType : fmwebdav::connectionType() const{ return wdCurrentConnectionType; } + +bool fmwebdav::isSSL() const{ return (wdCurrentConnectionType==QWebdav::HTTPS); } -- cgit From fb13a95bcb1c88028e74a525c998d419984c3b28 Mon Sep 17 00:00:00 2001 From: q5sys Date: Sun, 24 Sep 2017 20:33:20 -0400 Subject: oops hadn't saved all my changes yet --- src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp') diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp b/src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp index 9c82aa3e..6e65ebaf 100644 --- a/src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp +++ b/src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp @@ -21,3 +21,16 @@ QString fmwebdav::password() const{ return wdPassword; } fmwebdav::QWebdavConnectionType : fmwebdav::connectionType() const{ return wdCurrentConnectionType; } bool fmwebdav::isSSL() const{ return (wdCurrentConnectionType==QWebdav::HTTPS); } + +void QWebdav::setConnectionSettings(const QWebdavConnectionType connectionType, const QString *hostname, const QString *rootPath, const QString *username, const QString *password, int *port){ + wdRootPath = rootPath; + if ((wdRootPath.endsWith("/")){ wdRootPath.chop(1); } + wdCurrentConnectionType = connectionType; + wdBaseUrl.setScheme(); + wdBaseUrl.setHost(hostname); + wdBaseUrl.setPath(rootPath); + if (port != 0) { // use user-defined port number if not 80 or 443 + if ( ! ( ( (port == 80) && (wdCurrentConnectionType==QWebdav::HTTP) ) || ( (port == 443) && (wdCurrentConnectionType==QWebdav::HTTPS) ) ) ){ wdBaseUrl.setPort(port); } + wdUsername = username; + wdPassword = password; +} -- cgit