[Pkg-owncloud-commits] [owncloud-client] 94/218: Always use the webdav path from the Account object.

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 17 14:30:51 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit cf7726353a98fc2a9751ed8c0e231e3aec142897
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Thu Sep 10 15:39:37 2015 +0200

    Always use the webdav path from the Account object.
    
    The Account object has the themed webdav path if it is branded.
---
 src/cmd/cmd.cpp                      | 27 ++++++++++++++++-----------
 src/gui/socketapi.cpp                |  3 ++-
 src/gui/wizard/owncloudsetuppage.cpp |  2 +-
 3 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp
index d1683d5..37fbcab 100644
--- a/src/cmd/cmd.cpp
+++ b/src/cmd/cmd.cpp
@@ -185,15 +185,7 @@ void parseOptions( const QStringList& app_args, CmdOptions *options )
     }
 
     options->target_url = args.takeLast();
-    // check if the webDAV path was added to the url and append if not.
-    if(!options->target_url.endsWith("/")) {
-        options->target_url.append("/");
-    }
-    if( !options->target_url.contains( Theme::instance()->webDavPath() )) {
-        options->target_url.append(Theme::instance()->webDavPath());
-    }
-    if (options->target_url.startsWith("http"))
-        options->target_url.replace(0, 4, "owncloud");
+
     options->source_dir = args.takeLast();
     if (!options->source_dir.endsWith('/')) {
         options->source_dir.append('/');
@@ -280,6 +272,21 @@ int main(int argc, char **argv) {
 
     parseOptions( app.arguments(), &options );
 
+    AccountPtr account = Account::create();
+
+    if( !account ) {
+        qFatal("Could not initialize account!");
+        return EXIT_FAILURE;
+    }
+    // check if the webDAV path was added to the url and append if not.
+    if(!options.target_url.endsWith("/")) {
+        options.target_url.append("/");
+    }
+    if( !options.target_url.contains( account->davPath() )) {
+        options.target_url.append(account->davPath());
+    }
+    if (options.target_url.startsWith("http"))
+        options.target_url.replace(0, 4, "owncloud");
     QUrl url = QUrl::fromUserInput(options.target_url);
 
     // Order of retrieval attempt (later attempts override earlier ones):
@@ -331,8 +338,6 @@ int main(int argc, char **argv) {
     // take the unmodified url to pass to csync_create()
     QByteArray remUrl = options.target_url.toUtf8();
 
-    AccountPtr account = Account::create();
-
     // Find the folder and the original owncloud url
     QStringList splitted = url.path().split(account->davPath());
     url.setPath(splitted.value(0));
diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp
index ba18f2c..1db9696 100644
--- a/src/gui/socketapi.cpp
+++ b/src/gui/socketapi.cpp
@@ -26,6 +26,7 @@
 #include "syncfileitem.h"
 #include "filesystem.h"
 #include "version.h"
+#include "account.h"
 #include "accountstate.h"
 
 #include <QDebug>
@@ -655,7 +656,7 @@ SyncFileStatus SocketApi::fileStatus(Folder *folder, const QString& systemFileNa
         if (rec._remotePerm.isNull()) {
             // probably owncloud 6, that does not have permissions flag yet.
             QString url = folder->remoteUrl().toString() + fileName;
-            if (url.contains( Theme::instance()->webDavPath() + QLatin1String("Shared/") )) {
+            if (url.contains( folder->accountState()->account()->davPath() + QLatin1String("Shared/") )) {
                 status.setSharedWithMe(true);
             }
         } else if (rec._remotePerm.contains("S")) {
diff --git a/src/gui/wizard/owncloudsetuppage.cpp b/src/gui/wizard/owncloudsetuppage.cpp
index 18e9d78..616caa0 100644
--- a/src/gui/wizard/owncloudsetuppage.cpp
+++ b/src/gui/wizard/owncloudsetuppage.cpp
@@ -106,7 +106,7 @@ void OwncloudSetupPage::slotUrlChanged(const QString& url)
     if (url.endsWith("index.php")) {
         newUrl.chop(9);
     }
-    QString webDavPath = Theme::instance()->webDavPath();
+    QString webDavPath = _ocWizard->account()->davPath();
     if (url.endsWith(webDavPath)) {
         newUrl.chop( webDavPath.length() );
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list