aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-11-04 19:28:17 +0000
committerWeblate <noreply@weblate.org>2017-11-04 19:28:17 +0000
commit7787f617656751ee7e0a58c813d0bfd5757c5c97 (patch)
tree48aa053bbd4fda9c64f89a061a2f442c860ab13d /src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp
parentTranslated using Weblate (Lithuanian) (diff)
parentMerge pull request #497 from a-stjohn/patch-1 (diff)
downloadlumina-7787f617656751ee7e0a58c813d0bfd5757c5c97.tar.gz
lumina-7787f617656751ee7e0a58c813d0bfd5757c5c97.tar.bz2
lumina-7787f617656751ee7e0a58c813d0bfd5757c5c97.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp36
1 files changed, 36 insertions, 0 deletions
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..6e65ebaf
--- /dev/null
+++ b/src-qt5/desktop-utils/lumina-fm/widgets/fmwebdav.cpp
@@ -0,0 +1,36 @@
+#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); }
+
+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;
+}
bgstack15