Comparar commits
36 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| e6eca69b3e | |||
| 68f99bcc27 | |||
| 7523db354d | |||
| 4919c9e7b1 | |||
| 045498c71a | |||
| 679ac0d26a | |||
| 2e3a3bcf84 | |||
| ad437a49f9 | |||
| 6b2282bf0d | |||
| 42aed56a5a | |||
| ca9ec46253 | |||
| a92eec160a | |||
| cc91c42dfa | |||
| d22d0e7e30 | |||
| 4998303c42 | |||
| ceef2f2d46 | |||
| 8b18600d7e | |||
| 6cc63462b3 | |||
| a1dc4069c9 | |||
| 86846af59d | |||
| 5bfa02602d | |||
| 9be23984eb | |||
| eb8de8e3c0 | |||
| ec7333a4bf | |||
| e485c5c008 | |||
| 6451eb3ade | |||
| 01528427b5 | |||
| cec4d7b9ff | |||
| efa7821dd2 | |||
| 89f55cf9df | |||
| db24f60ae3 | |||
| ffac3f6213 | |||
| 4f1feab845 | |||
| f738cfd7fe | |||
| 092c935422 | |||
| 72d8175032 |
@@ -5,7 +5,8 @@
|
|||||||
#
|
#
|
||||||
# ownCloud is free software: you can redistribute it and/or modify
|
# ownCloud is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; version 2 of the License.
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# ownCLoud is distributed in the hope that it will be useful,
|
# ownCLoud is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
+2
-9
@@ -89,7 +89,7 @@ static int _data_cmp(const void *key, const void *data) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void csync_create(CSYNC **csync, const char *local, const char *remote) {
|
void csync_create(CSYNC **csync, const char *local) {
|
||||||
CSYNC *ctx;
|
CSYNC *ctx;
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
|
|
||||||
@@ -103,12 +103,6 @@ void csync_create(CSYNC **csync, const char *local, const char *remote) {
|
|||||||
|
|
||||||
ctx->local.uri = c_strndup(local, len);
|
ctx->local.uri = c_strndup(local, len);
|
||||||
|
|
||||||
/* remove trailing slashes */
|
|
||||||
len = strlen(remote);
|
|
||||||
while(len > 0 && remote[len - 1] == '/') --len;
|
|
||||||
|
|
||||||
ctx->remote.uri = c_strndup(remote, len);
|
|
||||||
|
|
||||||
ctx->status_code = CSYNC_STATUS_OK;
|
ctx->status_code = CSYNC_STATUS_OK;
|
||||||
|
|
||||||
ctx->current_fs = NULL;
|
ctx->current_fs = NULL;
|
||||||
@@ -199,7 +193,7 @@ int csync_update(CSYNC *ctx) {
|
|||||||
ctx->current = REMOTE_REPLICA;
|
ctx->current = REMOTE_REPLICA;
|
||||||
ctx->replica = ctx->remote.type;
|
ctx->replica = ctx->remote.type;
|
||||||
|
|
||||||
rc = csync_ftw(ctx, ctx->remote.uri, csync_walker, MAX_DEPTH);
|
rc = csync_ftw(ctx, "", csync_walker, MAX_DEPTH);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
if(ctx->status_code == CSYNC_STATUS_OK) {
|
if(ctx->status_code == CSYNC_STATUS_OK) {
|
||||||
ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_UPDATE_ERROR);
|
ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_UPDATE_ERROR);
|
||||||
@@ -579,7 +573,6 @@ int csync_destroy(CSYNC *ctx) {
|
|||||||
_csync_clean_ctx(ctx);
|
_csync_clean_ctx(ctx);
|
||||||
|
|
||||||
SAFE_FREE(ctx->local.uri);
|
SAFE_FREE(ctx->local.uri);
|
||||||
SAFE_FREE(ctx->remote.uri);
|
|
||||||
SAFE_FREE(ctx->error_string);
|
SAFE_FREE(ctx->error_string);
|
||||||
|
|
||||||
#ifdef WITH_ICONV
|
#ifdef WITH_ICONV
|
||||||
|
|||||||
+1
-1
@@ -317,7 +317,7 @@ typedef const char* (*csync_checksum_hook) (
|
|||||||
*
|
*
|
||||||
* @param csync The context variable to allocate.
|
* @param csync The context variable to allocate.
|
||||||
*/
|
*/
|
||||||
void OCSYNC_EXPORT csync_create(CSYNC **csync, const char *local, const char *remote);
|
void OCSYNC_EXPORT csync_create(CSYNC **csync, const char *local);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initialize the file synchronizer.
|
* @brief Initialize the file synchronizer.
|
||||||
|
|||||||
@@ -126,7 +126,6 @@ struct csync_s {
|
|||||||
} local;
|
} local;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
char *uri;
|
|
||||||
c_rbtree_t *tree;
|
c_rbtree_t *tree;
|
||||||
enum csync_replica_e type;
|
enum csync_replica_e type;
|
||||||
int read_from_db;
|
int read_from_db;
|
||||||
|
|||||||
+21
-73
@@ -56,26 +56,13 @@ static uint64_t _hash_of_file(CSYNC *ctx, const char *file) {
|
|||||||
|
|
||||||
if( ctx && file ) {
|
if( ctx && file ) {
|
||||||
path = file;
|
path = file;
|
||||||
switch (ctx->current) {
|
if (ctx->current == LOCAL_REPLICA) {
|
||||||
case LOCAL_REPLICA:
|
|
||||||
if (strlen(path) <= strlen(ctx->local.uri)) {
|
if (strlen(path) <= strlen(ctx->local.uri)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
path += strlen(ctx->local.uri) + 1;
|
path += strlen(ctx->local.uri) + 1;
|
||||||
break;
|
|
||||||
case REMOTE_REPLICA:
|
|
||||||
if (strlen(path) <= strlen(ctx->remote.uri)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
path += strlen(ctx->remote.uri) + 1;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
path = NULL;
|
|
||||||
return 0;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
len = strlen(path);
|
len = strlen(path);
|
||||||
|
|
||||||
h = c_jhash64((uint8_t *) path, len, 0);
|
h = c_jhash64((uint8_t *) path, len, 0);
|
||||||
}
|
}
|
||||||
return h;
|
return h;
|
||||||
@@ -188,25 +175,12 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
|
|||||||
}
|
}
|
||||||
|
|
||||||
path = file;
|
path = file;
|
||||||
switch (ctx->current) {
|
if (ctx->current == LOCAL_REPLICA) {
|
||||||
case LOCAL_REPLICA:
|
|
||||||
if (strlen(path) <= strlen(ctx->local.uri)) {
|
if (strlen(path) <= strlen(ctx->local.uri)) {
|
||||||
ctx->status_code = CSYNC_STATUS_PARAM_ERROR;
|
ctx->status_code = CSYNC_STATUS_PARAM_ERROR;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
path += strlen(ctx->local.uri) + 1;
|
path += strlen(ctx->local.uri) + 1;
|
||||||
break;
|
|
||||||
case REMOTE_REPLICA:
|
|
||||||
if (strlen(path) <= strlen(ctx->remote.uri)) {
|
|
||||||
ctx->status_code = CSYNC_STATUS_PARAM_ERROR;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
path += strlen(ctx->remote.uri) + 1;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
path = NULL;
|
|
||||||
ctx->status_code = CSYNC_STATUS_PARAM_ERROR;
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
len = strlen(path);
|
len = strlen(path);
|
||||||
@@ -629,16 +603,7 @@ int csync_walker(CSYNC *ctx, const char *file, const csync_vio_file_stat_t *fs,
|
|||||||
|
|
||||||
static bool fill_tree_from_db(CSYNC *ctx, const char *uri)
|
static bool fill_tree_from_db(CSYNC *ctx, const char *uri)
|
||||||
{
|
{
|
||||||
const char *path = NULL;
|
if( csync_statedb_get_below_path(ctx, uri) < 0 ) {
|
||||||
|
|
||||||
if( strlen(uri) < strlen(ctx->remote.uri)+1) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "name does not contain remote uri!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
path = uri + strlen(ctx->remote.uri)+1;
|
|
||||||
|
|
||||||
if( csync_statedb_get_below_path(ctx, path) < 0 ) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "StateDB could not be read!");
|
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "StateDB could not be read!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -680,12 +645,6 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
|
|||||||
|
|
||||||
bool do_read_from_db = (ctx->current == REMOTE_REPLICA && ctx->remote.read_from_db);
|
bool do_read_from_db = (ctx->current == REMOTE_REPLICA && ctx->remote.read_from_db);
|
||||||
|
|
||||||
if (uri[0] == '\0') {
|
|
||||||
errno = ENOENT;
|
|
||||||
ctx->status_code = CSYNC_STATUS_PARAM_ERROR;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
read_from_db = ctx->remote.read_from_db;
|
read_from_db = ctx->remote.read_from_db;
|
||||||
|
|
||||||
// if the etag of this dir is still the same, its content is restored from the
|
// if the etag of this dir is still the same, its content is restored from the
|
||||||
@@ -699,16 +658,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *uri_for_vio = uri;
|
if ((dh = csync_vio_opendir(ctx, uri)) == NULL) {
|
||||||
if (ctx->current == REMOTE_REPLICA) {
|
|
||||||
uri_for_vio += strlen(ctx->remote.uri);
|
|
||||||
if (strlen(uri_for_vio) > 0 && uri_for_vio[0] == '/') {
|
|
||||||
uri_for_vio++; // cut leading slash
|
|
||||||
}
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "URI without fuzz for %s is \"%s\"", uri, uri_for_vio);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((dh = csync_vio_opendir(ctx, uri_for_vio)) == NULL) {
|
|
||||||
if (ctx->abort) {
|
if (ctx->abort) {
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Aborted!");
|
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Aborted!");
|
||||||
ctx->status_code = CSYNC_STATUS_ABORTED;
|
ctx->status_code = CSYNC_STATUS_ABORTED;
|
||||||
@@ -781,34 +731,32 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
flen = asprintf(&filename, "%s/%s", uri, d_name);
|
if (uri[0] == '\0') {
|
||||||
if (flen < 0) {
|
filename = c_strdup(d_name);
|
||||||
|
flen = strlen(d_name);
|
||||||
|
} else {
|
||||||
|
flen = asprintf(&filename, "%s/%s", uri, d_name);
|
||||||
|
}
|
||||||
|
if (flen < 0 || !filename) {
|
||||||
csync_vio_file_stat_destroy(dirent);
|
csync_vio_file_stat_destroy(dirent);
|
||||||
dirent = NULL;
|
dirent = NULL;
|
||||||
ctx->status_code = CSYNC_STATUS_MEMORY_ERROR;
|
ctx->status_code = CSYNC_STATUS_MEMORY_ERROR;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create relative path */
|
/* Create relative path: For local replica, we need to remove the base path. */
|
||||||
switch (ctx->current) {
|
path = filename;
|
||||||
case LOCAL_REPLICA:
|
if (ctx->current == LOCAL_REPLICA) {
|
||||||
ulen = strlen(ctx->local.uri) + 1;
|
ulen = strlen(ctx->local.uri) + 1;
|
||||||
break;
|
if (((size_t)flen) < ulen) {
|
||||||
case REMOTE_REPLICA:
|
csync_vio_file_stat_destroy(dirent);
|
||||||
ulen = strlen(ctx->remote.uri) + 1;
|
dirent = NULL;
|
||||||
break;
|
ctx->status_code = CSYNC_STATUS_UNSUCCESSFUL;
|
||||||
default:
|
goto error;
|
||||||
break;
|
}
|
||||||
|
path += ulen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((size_t)flen) < ulen) {
|
|
||||||
csync_vio_file_stat_destroy(dirent);
|
|
||||||
dirent = NULL;
|
|
||||||
ctx->status_code = CSYNC_STATUS_UNSUCCESSFUL;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
path = filename + ulen;
|
|
||||||
|
|
||||||
/* skip ".csync_journal.db" and ".csync_journal.db.ctmp" */
|
/* skip ".csync_journal.db" and ".csync_journal.db.ctmp" */
|
||||||
/* Isn't this done via csync_exclude already? */
|
/* Isn't this done via csync_exclude already? */
|
||||||
|
|||||||
@@ -30,10 +30,7 @@ static void setup(void **state) {
|
|||||||
rc = system("mkdir -p /tmp/check_csync1");
|
rc = system("mkdir -p /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
|
|
||||||
rc = system("mkdir -p /tmp/check_csync2");
|
csync_create(&csync, "/tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
|
|
||||||
csync_create(&csync, "/tmp/check_csync1", "/tmp/check_csync2");
|
|
||||||
|
|
||||||
*state = csync;
|
*state = csync;
|
||||||
}
|
}
|
||||||
@@ -45,10 +42,7 @@ static void setup_module(void **state) {
|
|||||||
rc = system("mkdir -p /tmp/check_csync1");
|
rc = system("mkdir -p /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
|
|
||||||
rc = system("mkdir -p /tmp/check_csync2");
|
csync_create(&csync, "/tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
|
|
||||||
csync_create(&csync, "/tmp/check_csync1", "dummy://foo/bar");
|
|
||||||
|
|
||||||
csync_init(csync);
|
csync_init(csync);
|
||||||
*state = csync;
|
*state = csync;
|
||||||
@@ -66,9 +60,6 @@ static void teardown(void **state) {
|
|||||||
rc = system("rm -rf /tmp/check_csync1");
|
rc = system("rm -rf /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
|
|
||||||
rc = system("rm -rf /tmp/check_csync2");
|
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
|
|
||||||
*state = NULL;
|
*state = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ static void check_csync_create(void **state)
|
|||||||
|
|
||||||
(void) state; /* unused */
|
(void) state; /* unused */
|
||||||
|
|
||||||
csync_create(&csync, "/tmp/csync1", "/tmp/csync2");
|
csync_create(&csync, "/tmp/csync1");
|
||||||
|
|
||||||
rc = csync_destroy(csync);
|
rc = csync_destroy(csync);
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
static void setup(void **state) {
|
static void setup(void **state) {
|
||||||
CSYNC *csync;
|
CSYNC *csync;
|
||||||
|
|
||||||
csync_create(&csync, "/tmp/check_csync1", "/tmp/check_csync2");
|
csync_create(&csync, "/tmp/check_csync1");
|
||||||
|
|
||||||
*state = csync;
|
*state = csync;
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ static void setup_init(void **state) {
|
|||||||
CSYNC *csync;
|
CSYNC *csync;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
csync_create(&csync, "/tmp/check_csync1", "/tmp/check_csync2");
|
csync_create(&csync, "/tmp/check_csync1");
|
||||||
|
|
||||||
rc = csync_exclude_load(EXCLUDE_LIST_FILE, &(csync->excludes));
|
rc = csync_exclude_load(EXCLUDE_LIST_FILE, &(csync->excludes));
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
|
|||||||
@@ -30,10 +30,7 @@ static void setup(void **state) {
|
|||||||
rc = system("mkdir -p /tmp/check_csync1");
|
rc = system("mkdir -p /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
|
|
||||||
rc = system("mkdir -p /tmp/check_csync2");
|
csync_create(&csync, "/tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
|
|
||||||
csync_create(&csync, "/tmp/check_csync1", "/tmp/check_csync2");
|
|
||||||
|
|
||||||
*state = csync;
|
*state = csync;
|
||||||
}
|
}
|
||||||
@@ -45,10 +42,7 @@ static void setup_module(void **state) {
|
|||||||
rc = system("mkdir -p /tmp/check_csync1");
|
rc = system("mkdir -p /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
|
|
||||||
rc = system("mkdir -p /tmp/check_csync2");
|
csync_create(&csync, "/tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
|
|
||||||
csync_create(&csync, "/tmp/check_csync1", "dummy://foo/bar");
|
|
||||||
|
|
||||||
*state = csync;
|
*state = csync;
|
||||||
}
|
}
|
||||||
@@ -65,9 +59,6 @@ static void teardown(void **state) {
|
|||||||
rc = system("rm -rf /tmp/check_csync1");
|
rc = system("rm -rf /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
|
|
||||||
rc = system("rm -rf /tmp/check_csync2");
|
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
|
|
||||||
*state = NULL;
|
*state = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,7 @@ static void setup(void **state) {
|
|||||||
rc = system("mkdir -p /tmp/check_csync1");
|
rc = system("mkdir -p /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
|
|
||||||
rc = system("mkdir -p /tmp/check_csync2");
|
csync_create(&csync, "/tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
|
|
||||||
csync_create(&csync, "/tmp/check_csync1", "/tmp/check_csync2");
|
|
||||||
|
|
||||||
*state = csync;
|
*state = csync;
|
||||||
}
|
}
|
||||||
@@ -53,9 +50,6 @@ static void teardown(void **state) {
|
|||||||
rc = system("rm -rf /tmp/check_csync1");
|
rc = system("rm -rf /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
|
|
||||||
rc = system("rm -rf /tmp/check_csync2");
|
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
|
|
||||||
*state = NULL;
|
*state = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ static void setup(void **state) {
|
|||||||
rc = system("mkdir -p /tmp/check_csync1");
|
rc = system("mkdir -p /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
|
|
||||||
csync_create(&csync, "/tmp/check_csync1", "/tmp/check_csync2");
|
csync_create(&csync, "/tmp/check_csync1");
|
||||||
|
|
||||||
csync->statedb.file = c_strdup( TESTDB );
|
csync->statedb.file = c_strdup( TESTDB );
|
||||||
*state = csync;
|
*state = csync;
|
||||||
|
|||||||
@@ -34,15 +34,11 @@ static void setup(void **state)
|
|||||||
|
|
||||||
rc = system("rm -rf /tmp/check_csync1");
|
rc = system("rm -rf /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
rc = system("rm -rf /tmp/check_csync2");
|
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
rc = system("mkdir -p /tmp/check_csync1");
|
rc = system("mkdir -p /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
rc = system("mkdir -p /tmp/check_csync2");
|
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
rc = system("mkdir -p /tmp/check_csync");
|
rc = system("mkdir -p /tmp/check_csync");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
csync_create(&csync, "/tmp/check_csync1", "/tmp/check_csync2");
|
csync_create(&csync, "/tmp/check_csync1");
|
||||||
csync_init(csync);
|
csync_init(csync);
|
||||||
|
|
||||||
sqlite3 *db = NULL;
|
sqlite3 *db = NULL;
|
||||||
@@ -106,8 +102,6 @@ static void teardown(void **state) {
|
|||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
rc = system("rm -rf /tmp/check_csync1");
|
rc = system("rm -rf /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
rc = system("rm -rf /tmp/check_csync2");
|
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
|
|
||||||
*state = NULL;
|
*state = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,9 +91,7 @@ static void setup(void **state)
|
|||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
rc = system("mkdir -p /tmp/check_csync1");
|
rc = system("mkdir -p /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
rc = system("mkdir -p /tmp/check_csync2");
|
csync_create(&csync, "/tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
csync_create(&csync, "/tmp/check_csync1", "/tmp/check_csync2");
|
|
||||||
csync_init(csync);
|
csync_init(csync);
|
||||||
|
|
||||||
/* Create a new db with metadata */
|
/* Create a new db with metadata */
|
||||||
@@ -122,9 +120,7 @@ static void setup_ftw(void **state)
|
|||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
rc = system("mkdir -p /tmp/check_csync1");
|
rc = system("mkdir -p /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
rc = system("mkdir -p /tmp/check_csync2");
|
csync_create(&csync, "/tmp");
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
csync_create(&csync, "/tmp", "/tmp");
|
|
||||||
csync_init(csync);
|
csync_init(csync);
|
||||||
|
|
||||||
sqlite3 *db = NULL;
|
sqlite3 *db = NULL;
|
||||||
@@ -162,8 +158,6 @@ static void teardown_rm(void **state) {
|
|||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
rc = system("rm -rf /tmp/check_csync1");
|
rc = system("rm -rf /tmp/check_csync1");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
rc = system("rm -rf /tmp/check_csync2");
|
|
||||||
assert_int_equal(rc, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create a file stat, caller must free memory */
|
/* create a file stat, caller must free memory */
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ static void setup(void **state)
|
|||||||
rc = system("rm -rf /tmp/csync_test");
|
rc = system("rm -rf /tmp/csync_test");
|
||||||
assert_int_equal(rc, 0);
|
assert_int_equal(rc, 0);
|
||||||
|
|
||||||
csync_create(&csync, "/tmp/csync1", "/tmp/csync2");
|
csync_create(&csync, "/tmp/csync1");
|
||||||
|
|
||||||
csync->replica = LOCAL_REPLICA;
|
csync->replica = LOCAL_REPLICA;
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ static void setup_testenv(void **state) {
|
|||||||
statevar *mystate = malloc( sizeof(statevar) );
|
statevar *mystate = malloc( sizeof(statevar) );
|
||||||
mystate->result = NULL;
|
mystate->result = NULL;
|
||||||
|
|
||||||
csync_create(&(mystate->csync), "/tmp/csync1", "/tmp/csync2");
|
csync_create(&(mystate->csync), "/tmp/csync1");
|
||||||
|
|
||||||
mystate->csync->replica = LOCAL_REPLICA;
|
mystate->csync->replica = LOCAL_REPLICA;
|
||||||
|
|
||||||
|
|||||||
+13
-1
@@ -68,9 +68,17 @@ To set up your build environment for development using HomeBrew_:
|
|||||||
|
|
||||||
1. Install Xcode
|
1. Install Xcode
|
||||||
2. Install Xcode command line tools::
|
2. Install Xcode command line tools::
|
||||||
|
<<<<<<< HEAD
|
||||||
xcode-select --install
|
xcode-select --install
|
||||||
|
|
||||||
3. Install homebrew::
|
3. Install homebrew::
|
||||||
|
=======
|
||||||
|
|
||||||
|
xcode-select --install
|
||||||
|
|
||||||
|
3. Install homebrew::
|
||||||
|
|
||||||
|
>>>>>>> ca9ec4625391ae23940b3a62aaa0afe89f3d98e8
|
||||||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
|
|
||||||
4. Add the ownCloud repository using the following command::
|
4. Add the ownCloud repository using the following command::
|
||||||
@@ -100,7 +108,7 @@ To set up your build environment for development using HomeBrew_:
|
|||||||
its Common Name as a third parameter (use quotes) to have the package
|
its Common Name as a third parameter (use quotes) to have the package
|
||||||
signed automatically.
|
signed automatically.
|
||||||
|
|
||||||
.. note:: Contrary to earlier versions, ownCloud 1.7 and later are packaged
|
.. note:: Contrary to earlier versions, ownCloud 1.7 and later are packaged
|
||||||
as a ``pkg`` installer. Do not call "make package" at any time when
|
as a ``pkg`` installer. Do not call "make package" at any time when
|
||||||
compiling for OS X, as this will build a disk image, and will not
|
compiling for OS X, as this will build a disk image, and will not
|
||||||
work correctly.
|
work correctly.
|
||||||
@@ -249,6 +257,10 @@ To build the most up-to-date version of the client:
|
|||||||
|
|
||||||
.. note:: Example:: cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 -DCMAKE_INSTALL_PREFIX=/Users/path/to/client/install/ -D_OPENSSL_LIBDIR=/usr/local/opt/openssl/lib/ -D_OPENSSL_INCLUDEDIR=/usr/local/opt/openssl/include/ -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include/ -DNO_SHIBBOLETH=1
|
.. note:: Example:: cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 -DCMAKE_INSTALL_PREFIX=/Users/path/to/client/install/ -D_OPENSSL_LIBDIR=/usr/local/opt/openssl/lib/ -D_OPENSSL_INCLUDEDIR=/usr/local/opt/openssl/include/ -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include/ -DNO_SHIBBOLETH=1
|
||||||
|
|
||||||
|
.. note:: Example:: cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 -DCMAKE_INSTALL_PREFIX=/Users/path/to/client/install/ -D_OPENSSL_LIBDIR=/usr/local/opt/openssl/lib/ -D_OPENSSL_INCLUDEDIR=/usr/local/opt/openssl/include/ -D_OPENSSL_VERSION=1.0.2a -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include/ -DNO_SHIBBOLETH=1
|
||||||
|
|
||||||
|
qtkeychain must be compiled with the same prefix e.g CMAKE_INSTALL_PREFIX=/Users/path/to/client/install/ .
|
||||||
|
|
||||||
4. Call ``make``.
|
4. Call ``make``.
|
||||||
|
|
||||||
The owncloud binary will appear in the ``bin`` directory.
|
The owncloud binary will appear in the ``bin`` directory.
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Desktop Sync client enables you to:
|
|||||||
Your files are always automatically synchronized between your ownCloud server
|
Your files are always automatically synchronized between your ownCloud server
|
||||||
and local PC.
|
and local PC.
|
||||||
|
|
||||||
Because of various technical issues, desktop sync clients older than 1.7 will
|
Because of various technical issues, desktop sync clients older than 2.2.1 will
|
||||||
not allowed to connect and sync with the ownCloud 8.1+ server. It is highly
|
not allowed to connect and sync with the ownCloud 8.1+ server. It is highly
|
||||||
recommended to keep your client updated.
|
recommended to keep your client updated.
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; version 2 of the License.
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but
|
# This program is distributed in the hope that it will be useful, but
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -493,6 +493,33 @@ X-GNOME-Autostart-Delay=3
|
|||||||
# Translations
|
# Translations
|
||||||
|
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
|
||||||
|
|
||||||
# Translations
|
# Translations
|
||||||
Comment[oc]=@APPLICATION_NAME@ sincronizacion del client
|
Comment[oc]=@APPLICATION_NAME@ sincronizacion del client
|
||||||
GenericName[oc]=Dorsièr de Sincronizacion
|
GenericName[oc]=Dorsièr de Sincronizacion
|
||||||
|
|||||||
+2
-11
@@ -329,8 +329,7 @@ int main(int argc, char **argv) {
|
|||||||
if( !options.target_url.contains( account->davPath() )) {
|
if( !options.target_url.contains( account->davPath() )) {
|
||||||
options.target_url.append(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);
|
QUrl url = QUrl::fromUserInput(options.target_url);
|
||||||
|
|
||||||
// Order of retrieval attempt (later attempts override earlier ones):
|
// Order of retrieval attempt (later attempts override earlier ones):
|
||||||
@@ -371,14 +370,6 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ### ensure URL is free of credentials
|
|
||||||
if (url.userName().isEmpty()) {
|
|
||||||
url.setUserName(user);
|
|
||||||
}
|
|
||||||
if (url.password().isEmpty()) {
|
|
||||||
url.setPassword(password);
|
|
||||||
}
|
|
||||||
|
|
||||||
// take the unmodified url to pass to csync_create()
|
// take the unmodified url to pass to csync_create()
|
||||||
QByteArray remUrl = options.target_url.toUtf8();
|
QByteArray remUrl = options.target_url.toUtf8();
|
||||||
|
|
||||||
@@ -475,7 +466,7 @@ restart_sync:
|
|||||||
selectiveSyncFixup(&db, selectiveSyncList);
|
selectiveSyncFixup(&db, selectiveSyncList);
|
||||||
}
|
}
|
||||||
|
|
||||||
SyncEngine engine(account, options.source_dir, QUrl(options.target_url), folder, &db);
|
SyncEngine engine(account, options.source_dir, folder, &db);
|
||||||
engine.setIgnoreHiddenFiles(options.ignoreHiddenFiles);
|
engine.setIgnoreHiddenFiles(options.ignoreHiddenFiles);
|
||||||
QObject::connect(&engine, SIGNAL(finished(bool)), &app, SLOT(quit()));
|
QObject::connect(&engine, SIGNAL(finished(bool)), &app, SLOT(quit()));
|
||||||
QObject::connect(&engine, SIGNAL(transmissionProgress(ProgressInfo)), &cmd, SLOT(transmissionProgressSlot()));
|
QObject::connect(&engine, SIGNAL(transmissionProgress(ProgressInfo)), &cmd, SLOT(transmissionProgressSlot()));
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ set(client_SRCS
|
|||||||
wizard/owncloudadvancedsetuppage.cpp
|
wizard/owncloudadvancedsetuppage.cpp
|
||||||
wizard/owncloudconnectionmethoddialog.cpp
|
wizard/owncloudconnectionmethoddialog.cpp
|
||||||
wizard/owncloudhttpcredspage.cpp
|
wizard/owncloudhttpcredspage.cpp
|
||||||
wizard/owncloudbrowsercredspage.cpp
|
|
||||||
wizard/owncloudsetuppage.cpp
|
wizard/owncloudsetuppage.cpp
|
||||||
wizard/owncloudwizardcommon.cpp
|
wizard/owncloudwizardcommon.cpp
|
||||||
wizard/owncloudwizard.cpp
|
wizard/owncloudwizard.cpp
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
@@ -30,6 +31,7 @@
|
|||||||
#include "owncloudsetupwizard.h"
|
#include "owncloudsetupwizard.h"
|
||||||
#include "creds/abstractcredentials.h"
|
#include "creds/abstractcredentials.h"
|
||||||
#include "tooltipupdater.h"
|
#include "tooltipupdater.h"
|
||||||
|
#include "filesystem.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
@@ -109,7 +111,7 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) :
|
|||||||
|
|
||||||
QAction *syncNowAction = new QAction(this);
|
QAction *syncNowAction = new QAction(this);
|
||||||
syncNowAction->setShortcut(QKeySequence(Qt::Key_F6));
|
syncNowAction->setShortcut(QKeySequence(Qt::Key_F6));
|
||||||
connect(syncNowAction, SIGNAL(triggered()), SLOT(slotSyncCurrentFolderNow()));
|
connect(syncNowAction, SIGNAL(triggered()), SLOT(slotScheduleCurrentFolder()));
|
||||||
addAction(syncNowAction);
|
addAction(syncNowAction);
|
||||||
|
|
||||||
connect(ui->_folderList, SIGNAL(clicked(const QModelIndex &)),
|
connect(ui->_folderList, SIGNAL(clicked(const QModelIndex &)),
|
||||||
@@ -227,6 +229,11 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
|
|||||||
connect(ac, SIGNAL(triggered(bool)), this, SLOT(doExpand()));
|
connect(ac, SIGNAL(triggered(bool)), this, SLOT(doExpand()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!folderPaused) {
|
||||||
|
ac = menu->addAction(tr("Force sync now"));
|
||||||
|
connect(ac, SIGNAL(triggered(bool)), this, SLOT(slotForceSyncCurrentFolder()));
|
||||||
|
}
|
||||||
|
|
||||||
ac = menu->addAction(folderPaused ? tr("Resume sync") : tr("Pause sync"));
|
ac = menu->addAction(folderPaused ? tr("Resume sync") : tr("Pause sync"));
|
||||||
connect(ac, SIGNAL(triggered(bool)), this, SLOT(slotEnableCurrentFolder()));
|
connect(ac, SIGNAL(triggered(bool)), this, SLOT(slotEnableCurrentFolder()));
|
||||||
|
|
||||||
@@ -299,8 +306,9 @@ void AccountSettings::slotFolderWizardAccepted()
|
|||||||
tr("<p>Could not create local folder <i>%1</i>.")
|
tr("<p>Could not create local folder <i>%1</i>.")
|
||||||
.arg(QDir::toNativeSeparators(definition.localPath)));
|
.arg(QDir::toNativeSeparators(definition.localPath)));
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
FileSystem::setFolderMinimumPermissions(definition.localPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -460,7 +468,7 @@ void AccountSettings::slotEnableCurrentFolder()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AccountSettings::slotSyncCurrentFolderNow()
|
void AccountSettings::slotScheduleCurrentFolder()
|
||||||
{
|
{
|
||||||
QModelIndex selected = ui->_folderList->selectionModel()->currentIndex();
|
QModelIndex selected = ui->_folderList->selectionModel()->currentIndex();
|
||||||
if( !selected.isValid() )
|
if( !selected.isValid() )
|
||||||
@@ -471,6 +479,24 @@ void AccountSettings::slotSyncCurrentFolderNow()
|
|||||||
folderMan->scheduleFolder(folderMan->folder(alias));
|
folderMan->scheduleFolder(folderMan->folder(alias));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AccountSettings::slotForceSyncCurrentFolder()
|
||||||
|
{
|
||||||
|
QModelIndex selected = ui->_folderList->selectionModel()->currentIndex();
|
||||||
|
if( !selected.isValid() )
|
||||||
|
return;
|
||||||
|
QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString();
|
||||||
|
FolderMan *folderMan = FolderMan::instance();
|
||||||
|
|
||||||
|
// Terminate and reschedule any running sync
|
||||||
|
if (Folder* current = folderMan->currentSyncFolder()) {
|
||||||
|
folderMan->terminateSyncProcess();
|
||||||
|
folderMan->scheduleFolder(current);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Insert the selected folder at the front of the queue
|
||||||
|
folderMan->scheduleFolderNext(folderMan->folder(alias));
|
||||||
|
}
|
||||||
|
|
||||||
void AccountSettings::slotOpenOC()
|
void AccountSettings::slotOpenOC()
|
||||||
{
|
{
|
||||||
if( _OCUrl.isValid() )
|
if( _OCUrl.isValid() )
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
@@ -70,7 +71,8 @@ public slots:
|
|||||||
protected slots:
|
protected slots:
|
||||||
void slotAddFolder();
|
void slotAddFolder();
|
||||||
void slotEnableCurrentFolder();
|
void slotEnableCurrentFolder();
|
||||||
void slotSyncCurrentFolderNow();
|
void slotScheduleCurrentFolder();
|
||||||
|
void slotForceSyncCurrentFolder();
|
||||||
void slotRemoveCurrentFolder();
|
void slotRemoveCurrentFolder();
|
||||||
void slotOpenCurrentFolder();
|
void slotOpenCurrentFolder();
|
||||||
void slotFolderWizardAccepted();
|
void slotFolderWizardAccepted();
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
@@ -616,7 +617,7 @@ void ActivitySettings::slotCopyToClipboard()
|
|||||||
message = tr("The sync activity list has been copied to the clipboard.");
|
message = tr("The sync activity list has been copied to the clipboard.");
|
||||||
} else if(idx == 2 ) {
|
} else if(idx == 2 ) {
|
||||||
// issues Widget
|
// issues Widget
|
||||||
message = tr("The list of unsynched items has been copied to the clipboard.");
|
message = tr("The list of unsynced items has been copied to the clipboard.");
|
||||||
_protocolWidget->storeSyncIssues(ts);
|
_protocolWidget->storeSyncIssues(ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -15,14 +15,9 @@
|
|||||||
|
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QDesktopServices>
|
|
||||||
#include <QNetworkReply>
|
|
||||||
#include <QTimer>
|
|
||||||
#include <QBuffer>
|
|
||||||
#include "creds/httpcredentialsgui.h"
|
#include "creds/httpcredentialsgui.h"
|
||||||
#include "theme.h"
|
#include "theme.h"
|
||||||
#include "account.h"
|
#include "account.h"
|
||||||
#include <json.h>
|
|
||||||
|
|
||||||
using namespace QKeychain;
|
using namespace QKeychain;
|
||||||
|
|
||||||
@@ -31,31 +26,11 @@ namespace OCC
|
|||||||
|
|
||||||
void HttpCredentialsGui::askFromUser()
|
void HttpCredentialsGui::askFromUser()
|
||||||
{
|
{
|
||||||
_asyncAuth.reset(new AsyncAuth(_account, this));
|
// The rest of the code assumes that this will be done asynchronously
|
||||||
connect(_asyncAuth.data(), SIGNAL(result(AsyncAuth::Result,QString)),
|
QMetaObject::invokeMethod(this, "askFromUserAsync", Qt::QueuedConnection);
|
||||||
this, SLOT(asyncAuthResult(AsyncAuth::Result,QString)));
|
|
||||||
_asyncAuth->start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpCredentialsGui::asyncAuthResult(AsyncAuth::Result r, const QString& token)
|
void HttpCredentialsGui::askFromUserAsync()
|
||||||
{
|
|
||||||
if (r == AsyncAuth::Waiting) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (r == AsyncAuth::NotSupported) {
|
|
||||||
// We will re-enter the event loop, so better wait the next iteration
|
|
||||||
QMetaObject::invokeMethod(this, "showDialog", Qt::QueuedConnection);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (r == AsyncAuth::LoggedIn) {
|
|
||||||
_password = token;
|
|
||||||
_ready = true;
|
|
||||||
persist();
|
|
||||||
}
|
|
||||||
emit asked();
|
|
||||||
}
|
|
||||||
|
|
||||||
void HttpCredentialsGui::showDialog()
|
|
||||||
{
|
{
|
||||||
QString msg = tr("Please enter %1 password:<br>"
|
QString msg = tr("Please enter %1 password:<br>"
|
||||||
"<br>"
|
"<br>"
|
||||||
@@ -104,99 +79,5 @@ QString HttpCredentialsGui::requestAppPasswordText(const Account* account)
|
|||||||
.arg(account->url().toString() + QLatin1String("/index.php/settings/personal?section=apppasswords"));
|
.arg(account->url().toString() + QLatin1String("/index.php/settings/personal?section=apppasswords"));
|
||||||
}
|
}
|
||||||
|
|
||||||
AsyncAuth::~AsyncAuth()
|
|
||||||
{
|
|
||||||
delete _reply;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AsyncAuth::start()
|
|
||||||
{
|
|
||||||
QNetworkRequest req;
|
|
||||||
req.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
|
|
||||||
|
|
||||||
auto buffer = new QBuffer();
|
|
||||||
buffer->setData("name=" + Utility::userAgentString().toPercentEncoding());
|
|
||||||
QNetworkReply *reply = _account->davRequest("POST",
|
|
||||||
Utility::concatUrlPath(_account->url(), QLatin1String("/index.php/auth/start")),
|
|
||||||
req, buffer);
|
|
||||||
QObject::connect(reply, SIGNAL(finished()), this, SLOT(startFinished()));
|
|
||||||
buffer->setParent(reply);
|
|
||||||
QTimer::singleShot(30*1000, reply, SLOT(abort()));
|
|
||||||
_reply = reply;
|
|
||||||
|
|
||||||
// FIXME! timeout
|
|
||||||
|
|
||||||
// _state = AsyncAuth::QueryUrlState;
|
|
||||||
}
|
|
||||||
|
|
||||||
// We get a reply from /index.php/auth/start
|
|
||||||
void AsyncAuth::startFinished()
|
|
||||||
{
|
|
||||||
auto reply = qobject_cast<QNetworkReply *>(sender());
|
|
||||||
Q_ASSERT(reply);
|
|
||||||
reply->deleteLater();
|
|
||||||
|
|
||||||
if (reply->error() != QNetworkReply::NoError) {
|
|
||||||
qDebug() << "auth/start returned error" << reply->errorString();
|
|
||||||
|
|
||||||
// FIXME! we should make a difference between network errors and file not found error.
|
|
||||||
emit result(NotSupported, QString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const QString replyData = reply->readAll();
|
|
||||||
|
|
||||||
bool success;
|
|
||||||
QVariantMap json = QtJson::parse(replyData, success).toMap();
|
|
||||||
if (!success) {
|
|
||||||
qDebug() << "could not parse json" << replyData;
|
|
||||||
emit result(NotSupported, QString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
auto clientUrl = QUrl::fromEncoded(json[QLatin1String("clientUrl")].toByteArray());
|
|
||||||
_pollUrl = QUrl::fromEncoded(json[QLatin1String("pollUrl")].toByteArray());
|
|
||||||
if (!_pollUrl.isValid() || !clientUrl.isValid()) {
|
|
||||||
qWarning() << "invalid urls from server" << json;
|
|
||||||
emit result(NotSupported, QString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!QDesktopServices::openUrl(clientUrl)) {
|
|
||||||
// We cannot open the browser, then we claim we don't support it.
|
|
||||||
emit result(NotSupported, QString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
emit result(Waiting, QString());
|
|
||||||
QTimer::singleShot(1000, this, SLOT(poll()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void AsyncAuth::poll()
|
|
||||||
{
|
|
||||||
QNetworkReply *reply = _account->davRequest("POST", _pollUrl, QNetworkRequest());
|
|
||||||
QObject::connect(reply, SIGNAL(finished()), this, SLOT(pollFinished()));
|
|
||||||
QTimer::singleShot(5*60*1000, reply, SLOT(abort()));
|
|
||||||
_reply = reply;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AsyncAuth::pollFinished()
|
|
||||||
{
|
|
||||||
auto reply = qobject_cast<QNetworkReply *>(sender());
|
|
||||||
Q_ASSERT(reply);
|
|
||||||
|
|
||||||
const QString replyData = reply->readAll();
|
|
||||||
reply->deleteLater();
|
|
||||||
|
|
||||||
bool success;
|
|
||||||
QVariantMap json = QtJson::parse(replyData, success).toMap();
|
|
||||||
if (!success || json["status"].toUInt() != 1) {
|
|
||||||
QTimer::singleShot(4*1000, this, SLOT(poll()));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto token = json["token"].toString();
|
|
||||||
|
|
||||||
emit result(LoggedIn, token);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace OCC
|
} // namespace OCC
|
||||||
|
|||||||
@@ -15,45 +15,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "creds/httpcredentials.h"
|
#include "creds/httpcredentials.h"
|
||||||
#include <QPointer>
|
|
||||||
|
|
||||||
namespace OCC
|
namespace OCC
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
class AsyncAuth : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
AsyncAuth(Account *account, QObject *parent)
|
|
||||||
: QObject(parent), _account(account)
|
|
||||||
{ }
|
|
||||||
~AsyncAuth();
|
|
||||||
|
|
||||||
enum Result { Waiting, NotSupported, LoggedIn };
|
|
||||||
void start();
|
|
||||||
public slots:
|
|
||||||
void startFinished();
|
|
||||||
void poll();
|
|
||||||
void pollFinished();
|
|
||||||
|
|
||||||
signals:
|
|
||||||
/**
|
|
||||||
* The state has changed.
|
|
||||||
* when logged in, token has the value of the token.
|
|
||||||
*/
|
|
||||||
void result(AsyncAuth::Result result, const QString &token);
|
|
||||||
private:
|
|
||||||
|
|
||||||
Account *_account;
|
|
||||||
QUrl _pollUrl;
|
|
||||||
// Makes sure the reply is destroyed when this object is closed
|
|
||||||
QPointer<QNetworkReply> _reply;
|
|
||||||
// State _state;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The HttpCredentialsGui class
|
* @brief The HttpCredentialsGui class
|
||||||
* @ingroup gui
|
* @ingroup gui
|
||||||
@@ -64,13 +29,9 @@ public:
|
|||||||
explicit HttpCredentialsGui() : HttpCredentials() {}
|
explicit HttpCredentialsGui() : HttpCredentials() {}
|
||||||
HttpCredentialsGui(const QString& user, const QString& password, const QString& certificatePath, const QString& certificatePasswd) : HttpCredentials(user, password, certificatePath, certificatePasswd) {}
|
HttpCredentialsGui(const QString& user, const QString& password, const QString& certificatePath, const QString& certificatePasswd) : HttpCredentials(user, password, certificatePath, certificatePasswd) {}
|
||||||
void askFromUser() Q_DECL_OVERRIDE;
|
void askFromUser() Q_DECL_OVERRIDE;
|
||||||
|
Q_INVOKABLE void askFromUserAsync();
|
||||||
|
|
||||||
static QString requestAppPasswordText(const Account *account);
|
static QString requestAppPasswordText(const Account *account);
|
||||||
private slots:
|
|
||||||
void asyncAuthResult(AsyncAuth::Result, const QString &token);
|
|
||||||
void showDialog();
|
|
||||||
private:
|
|
||||||
QScopedPointer<AsyncAuth> _asyncAuth;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace OCC
|
} // namespace OCC
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ Folder::Folder(const FolderDefinition& definition,
|
|||||||
|
|
||||||
_syncResult.setFolder(_definition.alias);
|
_syncResult.setFolder(_definition.alias);
|
||||||
|
|
||||||
_engine.reset(new SyncEngine(_accountState->account(), path(), remoteUrl(), remotePath(), &_journal));
|
_engine.reset(new SyncEngine(_accountState->account(), path(), remotePath(), &_journal));
|
||||||
// pass the setting if hidden files are to be ignored, will be read in csync_update
|
// pass the setting if hidden files are to be ignored, will be read in csync_update
|
||||||
_engine->setIgnoreHiddenFiles(_definition.ignoreHiddenFiles);
|
_engine->setIgnoreHiddenFiles(_definition.ignoreHiddenFiles);
|
||||||
|
|
||||||
|
|||||||
+30
-8
@@ -338,6 +338,7 @@ QString FolderMan::unescapeAlias( const QString& alias )
|
|||||||
|
|
||||||
// filename is the name of the file only, it does not include
|
// filename is the name of the file only, it does not include
|
||||||
// the configuration directory path
|
// the configuration directory path
|
||||||
|
// WARNING: Do not remove this code, it is used for predefined/automated deployments (2016)
|
||||||
Folder* FolderMan::setupFolderFromOldConfigFile(const QString &file, AccountState *accountState )
|
Folder* FolderMan::setupFolderFromOldConfigFile(const QString &file, AccountState *accountState )
|
||||||
{
|
{
|
||||||
Folder *folder = 0;
|
Folder *folder = 0;
|
||||||
@@ -408,6 +409,8 @@ Folder* FolderMan::setupFolderFromOldConfigFile(const QString &file, AccountStat
|
|||||||
//migrate settings
|
//migrate settings
|
||||||
folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, blackList);
|
folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, blackList);
|
||||||
settings.remove(QLatin1String("blackList"));
|
settings.remove(QLatin1String("blackList"));
|
||||||
|
// FIXME: If you remove this codepath, you need to provide another way to do
|
||||||
|
// this via theme.h or the normal FolderMan::setupFolders
|
||||||
}
|
}
|
||||||
|
|
||||||
folder->saveToSettings();
|
folder->saveToSettings();
|
||||||
@@ -517,6 +520,26 @@ void FolderMan::scheduleFolder( Folder *f )
|
|||||||
startScheduledSyncSoon();
|
startScheduledSyncSoon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FolderMan::scheduleFolderNext(Folder* f)
|
||||||
|
{
|
||||||
|
auto alias = f->alias();
|
||||||
|
qDebug() << "Schedule folder " << alias << " to sync! Front-of-queue.";
|
||||||
|
|
||||||
|
if( !f->canSync() ) {
|
||||||
|
qDebug() << "Folder is not ready to sync, not scheduled!";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_scheduledFolders.removeAll(f);
|
||||||
|
|
||||||
|
f->prepareToSync();
|
||||||
|
emit folderSyncStateChange(f);
|
||||||
|
_scheduledFolders.prepend(f);
|
||||||
|
emit scheduleQueueChanged();
|
||||||
|
|
||||||
|
startScheduledSyncSoon();
|
||||||
|
}
|
||||||
|
|
||||||
void FolderMan::slotScheduleETagJob(const QString &/*alias*/, RequestEtagJob *job)
|
void FolderMan::slotScheduleETagJob(const QString &/*alias*/, RequestEtagJob *job)
|
||||||
{
|
{
|
||||||
QObject::connect(job, SIGNAL(destroyed(QObject*)), this, SLOT(slotEtagJobDestroyed(QObject*)));
|
QObject::connect(job, SIGNAL(destroyed(QObject*)), this, SLOT(slotEtagJobDestroyed(QObject*)));
|
||||||
@@ -670,12 +693,11 @@ void FolderMan::slotStartScheduledFolderSync()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find the first folder in the queue that can be synced.
|
// Find the first folder in the queue that can be synced.
|
||||||
Folder* f = 0;
|
Folder* folder = 0;
|
||||||
while( !_scheduledFolders.isEmpty() ) {
|
while( !_scheduledFolders.isEmpty() ) {
|
||||||
f = _scheduledFolders.dequeue();
|
Folder* g = _scheduledFolders.dequeue();
|
||||||
Q_ASSERT(f);
|
if( g->canSync() ) {
|
||||||
|
folder = g;
|
||||||
if( f->canSync() ) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -683,9 +705,9 @@ void FolderMan::slotStartScheduledFolderSync()
|
|||||||
emit scheduleQueueChanged();
|
emit scheduleQueueChanged();
|
||||||
|
|
||||||
// Start syncing this folder!
|
// Start syncing this folder!
|
||||||
if( f ) {
|
if( folder ) {
|
||||||
_currentSyncFolder = f;
|
_currentSyncFolder = folder;
|
||||||
f->startSync( QStringList() );
|
folder->startSync( QStringList() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-6
@@ -161,12 +161,22 @@ public:
|
|||||||
/** Queues a folder for syncing. */
|
/** Queues a folder for syncing. */
|
||||||
void scheduleFolder(Folder*);
|
void scheduleFolder(Folder*);
|
||||||
|
|
||||||
|
/** Puts a folder in the very front of the queue. */
|
||||||
|
void scheduleFolderNext(Folder*);
|
||||||
|
|
||||||
/** Queues all folders for syncing. */
|
/** Queues all folders for syncing. */
|
||||||
void scheduleAllFolders();
|
void scheduleAllFolders();
|
||||||
|
|
||||||
void setDirtyProxy(bool value = true);
|
void setDirtyProxy(bool value = true);
|
||||||
void setDirtyNetworkLimits();
|
void setDirtyNetworkLimits();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Terminates the current folder sync.
|
||||||
|
*
|
||||||
|
* It does not switch the folder to paused state.
|
||||||
|
*/
|
||||||
|
void terminateSyncProcess();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/**
|
/**
|
||||||
* signal to indicate a folder has changed its sync state.
|
* signal to indicate a folder has changed its sync state.
|
||||||
@@ -247,12 +257,6 @@ private slots:
|
|||||||
void slotScheduleFolderByTime();
|
void slotScheduleFolderByTime();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
|
||||||
* Terminates the current folder sync.
|
|
||||||
*
|
|
||||||
* It does not switch the folder to paused state.
|
|
||||||
*/
|
|
||||||
void terminateSyncProcess();
|
|
||||||
|
|
||||||
/** Adds a new folder, does not add it to the account settings and
|
/** Adds a new folder, does not add it to the account settings and
|
||||||
* does not set an account on the new folder.
|
* does not set an account on the new folder.
|
||||||
|
|||||||
@@ -806,25 +806,6 @@ void FolderStatusModel::slotApplySelectiveSync()
|
|||||||
resetFolders();
|
resetFolders();
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString shortenFilename( Folder *f, const QString& file )
|
|
||||||
{
|
|
||||||
// strip off the server prefix from the file name
|
|
||||||
QString shortFile(file);
|
|
||||||
if( shortFile.isEmpty() ) {
|
|
||||||
return QString::null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(shortFile.startsWith(QLatin1String("ownclouds://")) ||
|
|
||||||
shortFile.startsWith(QLatin1String("owncloud://")) ) {
|
|
||||||
// rip off the whole ownCloud URL.
|
|
||||||
if( f ) {
|
|
||||||
QString remotePathUrl = f->remoteUrl().toString();
|
|
||||||
shortFile.remove(Utility::toCSyncScheme(remotePathUrl));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return shortFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FolderStatusModel::slotSetProgress(const ProgressInfo &progress)
|
void FolderStatusModel::slotSetProgress(const ProgressInfo &progress)
|
||||||
{
|
{
|
||||||
auto par = qobject_cast<QWidget*>(QObject::parent());
|
auto par = qobject_cast<QWidget*>(QObject::parent());
|
||||||
@@ -898,7 +879,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress)
|
|||||||
curItemProgress = curItem._size;
|
curItemProgress = curItem._size;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString itemFileName = shortenFilename(f, curItem._file);
|
QString itemFileName = curItem._file;
|
||||||
QString kindString = Progress::asActionString(curItem);
|
QString kindString = Progress::asActionString(curItem);
|
||||||
|
|
||||||
QString fileProgressString;
|
QString fileProgressString;
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
+2
-1
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
@@ -159,7 +160,7 @@ void ownCloudGui::slotOpenSettingsDialog()
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "No configured folders yet, starting setup wizard";
|
qDebug() << "No configured folders yet, starting setup wizard";
|
||||||
OwncloudSetupWizard::runWizard(qApp, SLOT(slotownCloudWizardDone(int)));
|
slotNewAccountWizard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -599,6 +600,9 @@ void ownCloudGui::updateContextMenu()
|
|||||||
_contextMenu->addMenu(_recentActionsMenu);
|
_contextMenu->addMenu(_recentActionsMenu);
|
||||||
_contextMenu->addSeparator();
|
_contextMenu->addSeparator();
|
||||||
}
|
}
|
||||||
|
if (accountList.isEmpty()) {
|
||||||
|
_contextMenu->addAction(_actionNewAccountWizard);
|
||||||
|
}
|
||||||
_contextMenu->addAction(_actionSettings);
|
_contextMenu->addAction(_actionSettings);
|
||||||
if (!Theme::instance()->helpUrl().isEmpty()) {
|
if (!Theme::instance()->helpUrl().isEmpty()) {
|
||||||
_contextMenu->addAction(_actionHelp);
|
_contextMenu->addAction(_actionHelp);
|
||||||
@@ -723,11 +727,13 @@ void ownCloudGui::setupActions()
|
|||||||
_actionStatus = new QAction(tr("Unknown status"), this);
|
_actionStatus = new QAction(tr("Unknown status"), this);
|
||||||
_actionStatus->setEnabled( false );
|
_actionStatus->setEnabled( false );
|
||||||
_actionSettings = new QAction(tr("Settings..."), this);
|
_actionSettings = new QAction(tr("Settings..."), this);
|
||||||
|
_actionNewAccountWizard = new QAction(tr("New account..."), this);
|
||||||
_actionRecent = new QAction(tr("Details..."), this);
|
_actionRecent = new QAction(tr("Details..."), this);
|
||||||
_actionRecent->setEnabled( true );
|
_actionRecent->setEnabled( true );
|
||||||
|
|
||||||
QObject::connect(_actionRecent, SIGNAL(triggered(bool)), SLOT(slotShowSyncProtocol()));
|
QObject::connect(_actionRecent, SIGNAL(triggered(bool)), SLOT(slotShowSyncProtocol()));
|
||||||
QObject::connect(_actionSettings, SIGNAL(triggered(bool)), SLOT(slotShowSettings()));
|
QObject::connect(_actionSettings, SIGNAL(triggered(bool)), SLOT(slotShowSettings()));
|
||||||
|
QObject::connect(_actionNewAccountWizard, SIGNAL(triggered(bool)), SLOT(slotNewAccountWizard()));
|
||||||
_actionHelp = new QAction(tr("Help"), this);
|
_actionHelp = new QAction(tr("Help"), this);
|
||||||
QObject::connect(_actionHelp, SIGNAL(triggered(bool)), SLOT(slotHelp()));
|
QObject::connect(_actionHelp, SIGNAL(triggered(bool)), SLOT(slotHelp()));
|
||||||
_actionQuit = new QAction(tr("Quit %1").arg(Theme::instance()->appNameGUI()), this);
|
_actionQuit = new QAction(tr("Quit %1").arg(Theme::instance()->appNameGUI()), this);
|
||||||
@@ -890,6 +896,11 @@ void ownCloudGui::slotPauseAllFolders()
|
|||||||
setPauseOnAllFoldersHelper(true);
|
setPauseOnAllFoldersHelper(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ownCloudGui::slotNewAccountWizard()
|
||||||
|
{
|
||||||
|
OwncloudSetupWizard::runWizard(qApp, SLOT(slotownCloudWizardDone(int)));
|
||||||
|
}
|
||||||
|
|
||||||
void ownCloudGui::setPauseOnAllFoldersHelper(bool pause)
|
void ownCloudGui::setPauseOnAllFoldersHelper(bool pause)
|
||||||
{
|
{
|
||||||
QList<AccountState*> accounts;
|
QList<AccountState*> accounts;
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
@@ -94,6 +95,7 @@ private slots:
|
|||||||
void slotLogout();
|
void slotLogout();
|
||||||
void slotUnpauseAllFolders();
|
void slotUnpauseAllFolders();
|
||||||
void slotPauseAllFolders();
|
void slotPauseAllFolders();
|
||||||
|
void slotNewAccountWizard();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setPauseOnAllFoldersHelper(bool pause);
|
void setPauseOnAllFoldersHelper(bool pause);
|
||||||
@@ -123,6 +125,7 @@ private:
|
|||||||
QAction *_actionLogin;
|
QAction *_actionLogin;
|
||||||
QAction *_actionLogout;
|
QAction *_actionLogout;
|
||||||
|
|
||||||
|
QAction *_actionNewAccountWizard;
|
||||||
QAction *_actionSettings;
|
QAction *_actionSettings;
|
||||||
QAction *_actionStatus;
|
QAction *_actionStatus;
|
||||||
QAction *_actionEstimate;
|
QAction *_actionEstimate;
|
||||||
|
|||||||
@@ -31,12 +31,11 @@
|
|||||||
#include "sslerrordialog.h"
|
#include "sslerrordialog.h"
|
||||||
#include "accountmanager.h"
|
#include "accountmanager.h"
|
||||||
#include "clientproxy.h"
|
#include "clientproxy.h"
|
||||||
|
#include "filesystem.h"
|
||||||
|
|
||||||
#include "creds/credentialsfactory.h"
|
#include "creds/credentialsfactory.h"
|
||||||
#include "creds/abstractcredentials.h"
|
#include "creds/abstractcredentials.h"
|
||||||
#include "creds/dummycredentials.h"
|
#include "creds/dummycredentials.h"
|
||||||
#include "creds/httpcredentialsgui.h"
|
|
||||||
#include "wizard/owncloudbrowsercredspage.h"
|
|
||||||
|
|
||||||
namespace OCC {
|
namespace OCC {
|
||||||
|
|
||||||
@@ -195,39 +194,43 @@ void OwncloudSetupWizard::slotOwnCloudFoundAuth(const QUrl& url, const QVariantM
|
|||||||
qDebug() << Q_FUNC_INFO << " was redirected to" << redirectedUrl.toString();
|
qDebug() << Q_FUNC_INFO << " was redirected to" << redirectedUrl.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start by trying a browser authentication if the server supports it.
|
DetermineAuthTypeJob *job = new DetermineAuthTypeJob(_ocWizard->account(), this);
|
||||||
* If it does not support it, asyncAuthResult will fallback to the legacy wizard page */
|
job->setIgnoreCredentialFailure(true);
|
||||||
|
connect(job, SIGNAL(authType(WizardCommon::AuthType)),
|
||||||
_asyncAuth.reset(new AsyncAuth(_ocWizard->account().data(), this));
|
_ocWizard, SLOT(setAuthType(WizardCommon::AuthType)));
|
||||||
connect(_asyncAuth.data(), SIGNAL(result(AsyncAuth::Result,QString)),
|
job->start();
|
||||||
this, SLOT(asyncAuthResult(AsyncAuth::Result,QString)));
|
|
||||||
_asyncAuth->start();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OwncloudSetupWizard::asyncAuthResult(AsyncAuth::Result r,const QString &token)
|
|
||||||
{
|
|
||||||
if (r == AsyncAuth::NotSupported) {
|
|
||||||
_asyncAuth.reset(0);
|
|
||||||
DetermineAuthTypeJob *job = new DetermineAuthTypeJob(_ocWizard->account(), this);
|
|
||||||
job->setIgnoreCredentialFailure(true);
|
|
||||||
connect(job, SIGNAL(authType(WizardCommon::AuthType)),
|
|
||||||
_ocWizard, SLOT(setAuthType(WizardCommon::AuthType)));
|
|
||||||
job->start();
|
|
||||||
} else if (r == AsyncAuth::Waiting) {
|
|
||||||
_ocWizard->setAuthType(WizardCommon::Browser);
|
|
||||||
} else if (r == AsyncAuth::LoggedIn) {
|
|
||||||
_ocWizard->_browserCredsPage->_token = token;
|
|
||||||
slotConnectToOCUrl(_ocWizard->account()->url().toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OwncloudSetupWizard::slotNoOwnCloudFoundAuth(QNetworkReply *reply)
|
void OwncloudSetupWizard::slotNoOwnCloudFoundAuth(QNetworkReply *reply)
|
||||||
{
|
{
|
||||||
_ocWizard->displayError(tr("Failed to connect to %1 at %2:<br/>%3")
|
int resultCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||||
.arg(Theme::instance()->appNameGUI(),
|
QString contentType = reply->header(QNetworkRequest::ContentTypeHeader).toString();
|
||||||
reply->url().toString(),
|
|
||||||
reply->errorString()), checkDowngradeAdvised(reply));
|
// Do this early because reply might be deleted in message box event loop
|
||||||
|
QString msg = tr("Failed to connect to %1 at %2:<br/>%3")
|
||||||
|
.arg(Theme::instance()->appNameGUI(),
|
||||||
|
reply->url().toString(),
|
||||||
|
reply->errorString());
|
||||||
|
bool isDowngradeAdvised = checkDowngradeAdvised(reply);
|
||||||
|
|
||||||
|
// If a client cert is needed, nginx sends:
|
||||||
|
// 400 "<html>\r\n<head><title>400 No required SSL certificate was sent</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>400 Bad Request</h1></center>\r\n<center>No required SSL certificate was sent</center>\r\n<hr><center>nginx/1.10.0</center>\r\n</body>\r\n</html>\r\n"
|
||||||
|
// If the IP needs to be added as "trusted domain" in oC, oC sends:
|
||||||
|
// https://gist.github.com/guruz/ab6d11df1873c2ad3932180de92e7d82
|
||||||
|
if (resultCode != 200 && contentType.startsWith("text/")) {
|
||||||
|
// FIXME: Synchronous dialogs are not so nice because of event loop recursion
|
||||||
|
// (we already create a dialog further below)
|
||||||
|
QString serverError = reply->peek(1024*20);
|
||||||
|
qDebug() << serverError;
|
||||||
|
QMessageBox messageBox(_ocWizard);
|
||||||
|
messageBox.setText(serverError);
|
||||||
|
messageBox.addButton(QMessageBox::Ok);
|
||||||
|
messageBox.setTextFormat(Qt::RichText);
|
||||||
|
messageBox.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Displays message inside wizard and possibly also another message box
|
||||||
|
_ocWizard->displayError(msg, isDowngradeAdvised);
|
||||||
|
|
||||||
// Allow the credentials dialog to pop up again for the same URL.
|
// Allow the credentials dialog to pop up again for the same URL.
|
||||||
// Maybe the user just clicked 'Cancel' by accident or changed his mind.
|
// Maybe the user just clicked 'Cancel' by accident or changed his mind.
|
||||||
@@ -362,8 +365,8 @@ void OwncloudSetupWizard::slotCreateLocalAndRemoteFolders(const QString& localFo
|
|||||||
} else {
|
} else {
|
||||||
QString res = tr("Creating local sync folder %1...").arg(localFolder);
|
QString res = tr("Creating local sync folder %1...").arg(localFolder);
|
||||||
if( fi.mkpath( localFolder ) ) {
|
if( fi.mkpath( localFolder ) ) {
|
||||||
|
FileSystem::setFolderMinimumPermissions(localFolder);
|
||||||
Utility::setupFavLink( localFolder );
|
Utility::setupFavLink( localFolder );
|
||||||
// FIXME: Create a local sync folder.
|
|
||||||
res += tr("ok");
|
res += tr("ok");
|
||||||
} else {
|
} else {
|
||||||
res += tr("failed.");
|
res += tr("failed.");
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include "networkjobs.h"
|
#include "networkjobs.h"
|
||||||
|
|
||||||
#include "wizard/owncloudwizardcommon.h"
|
#include "wizard/owncloudwizardcommon.h"
|
||||||
#include "creds/httpcredentialsgui.h"
|
|
||||||
|
|
||||||
namespace OCC {
|
namespace OCC {
|
||||||
|
|
||||||
@@ -81,7 +80,6 @@ private slots:
|
|||||||
void slotCreateRemoteFolderFinished(QNetworkReply::NetworkError);
|
void slotCreateRemoteFolderFinished(QNetworkReply::NetworkError);
|
||||||
void slotAssistantFinished( int );
|
void slotAssistantFinished( int );
|
||||||
void slotSkipFolderConfiguration();
|
void slotSkipFolderConfiguration();
|
||||||
void asyncAuthResult(AsyncAuth::Result, const QString &);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit OwncloudSetupWizard(QObject *parent = 0 );
|
explicit OwncloudSetupWizard(QObject *parent = 0 );
|
||||||
@@ -97,7 +95,6 @@ private:
|
|||||||
OwncloudWizard* _ocWizard;
|
OwncloudWizard* _ocWizard;
|
||||||
QString _initLocalFolder;
|
QString _initLocalFolder;
|
||||||
QString _remoteFolder;
|
QString _remoteFolder;
|
||||||
QScopedPointer<AsyncAuth> _asyncAuth;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
@@ -98,6 +99,8 @@ ProtocolWidget::ProtocolWidget(QWidget *parent) :
|
|||||||
_issueItemView->setRootIsDecorated(false);
|
_issueItemView->setRootIsDecorated(false);
|
||||||
_issueItemView->setTextElideMode(Qt::ElideMiddle);
|
_issueItemView->setTextElideMode(Qt::ElideMiddle);
|
||||||
_issueItemView->header()->setObjectName("ActivityErrorListHeader");
|
_issueItemView->header()->setObjectName("ActivityErrorListHeader");
|
||||||
|
connect(_issueItemView, SIGNAL(itemActivated(QTreeWidgetItem*,int)),
|
||||||
|
SLOT(slotOpenFile(QTreeWidgetItem*,int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
ProtocolWidget::~ProtocolWidget()
|
ProtocolWidget::~ProtocolWidget()
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License.
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
|||||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário