[Pkg-owncloud-commits] [owncloud-client] 47/211: owncloudcmd: Fix url handling with csync, make owncloudcmd sync again.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat Oct 25 09:10:25 UTC 2014
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 8eaeba6486a30dbbbe474e6425b488ec7d8aa3a1
Author: Klaas Freitag <freitag at owncloud.com>
Date: Sat Oct 11 12:21:26 2014 +0200
owncloudcmd: Fix url handling with csync, make owncloudcmd sync again.
This fixes mirall issue #2211
---
src/owncloudcmd/owncloudcmd.cpp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/owncloudcmd/owncloudcmd.cpp b/src/owncloudcmd/owncloudcmd.cpp
index 23e3964..07ffa51 100644
--- a/src/owncloudcmd/owncloudcmd.cpp
+++ b/src/owncloudcmd/owncloudcmd.cpp
@@ -226,7 +226,7 @@ int main(int argc, char **argv) {
parseOptions( app.arguments(), &options );
- QUrl url = QUrl::fromUserInput(options.target_url);
+ QUrl url = QUrl::fromUserInput(options.target_url);
// Order of retrieval attempt (later attempts override earlier ones):
// 1. From URL
@@ -274,11 +274,15 @@ int main(int argc, char **argv) {
url.setPassword(password);
}
+ // take the unmodified url to pass to csync_create()
+ QByteArray remUrl = options.target_url.toUtf8();
+
Account account;
// Find the folder and the original owncloud url
QStringList splitted = url.path().split(account.davPath());
url.setPath(splitted.value(0));
+
url.setScheme(url.scheme().replace("owncloud", "http"));
QString folder = splitted.value(1);
@@ -295,8 +299,9 @@ int main(int argc, char **argv) {
restart_sync:
CSYNC *_csync_ctx;
+
if( csync_create( &_csync_ctx, options.source_dir.toUtf8(),
- url.toEncoded().constData()) < 0 ) {
+ remUrl.constData()) < 0 ) {
qFatal("Unable to create csync-context!");
return EXIT_FAILURE;
}
@@ -359,6 +364,7 @@ restart_sync:
OwncloudCmd owncloudCmd;
SyncJournalDb db(options.source_dir);
+
SyncEngine engine(_csync_ctx, options.source_dir, QUrl(options.target_url).path(), folder, &db);
QObject::connect(&engine, SIGNAL(finished()), &app, SLOT(quit()));
QObject::connect(&engine, SIGNAL(transmissionProgress(Progress::Info)), &owncloudCmd, SLOT(transmissionProgressSlot()));
--
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