}
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('/');
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):
// 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));
#include "syncfileitem.h"
#include "filesystem.h"
#include "version.h"
+#include "account.h"
#include "accountstate.h"
#include <QDebug>
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")) {