1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2026-04-12 05:57:41 +02:00

Compare commits

..

63 Commits

Author SHA1 Message Date
Daniel Molkentin
7a8a3855b8 Mac: Make <ESC> close the settings dialog again 2014-06-20 16:37:07 +02:00
Daniel Molkentin
603a238eb9 Disable minimize button for Preferences on Mac 2014-06-20 16:31:17 +02:00
Olivier Goffart
b7b6cf4b3f Shibboleth: Always ask for the password if we are going to open the log window
If we don't have the cookie in the keychain (e.g. the keychain is
unavailable) but there is still session cookie in the cookie jar,
showing the browser won't ask for authentication.
2014-06-20 16:25:35 +02:00
Daniel Molkentin
c855b783d9 NSIS: Remove duplicated entry 2014-06-20 15:53:10 +02:00
Daniel Molkentin
f593fc8e4d NSIS: Bump required libpng version to 16 2014-06-20 15:50:42 +02:00
Klaas Freitag
ae5cbb8451 Version: Bumped to rc1 2014-06-20 15:37:50 +02:00
Klaas Freitag
041066a252 Exclude: Add a missing free in case of empty lines.
This fixes Coverity CLT 12893
2014-06-20 15:15:35 +02:00
Daniel Molkentin
9ca82ba14d NSIS: add libwinpthread dependency 2014-06-20 14:58:05 +02:00
Olivier Goffart
b29a757b18 Revert "csync file util: Remove compare file function, not needed anymore."
This break the test.
And the function is aleady gone in master anyway

This reverts commit 407b3bebfe.
2014-06-20 14:29:43 +02:00
Daniel Molkentin
485a6926c5 FancyLineEdit: initialize all members
This fixes Coverity CID 12912
2014-06-20 13:46:57 +02:00
Daniel Molkentin
f3de6f46db Folder: Removed unused member _pathWatcher
This fixes Coverity CID 12914
2014-06-20 13:42:26 +02:00
Daniel Molkentin
1309dc27d9 Remove previously unused member
This fixes Coverity CID 12915
2014-06-20 13:40:55 +02:00
Daniel Molkentin
31469d6a3e Folderwizard: Properly initialize all members
This fixes coverity CID 12916
2014-06-20 13:38:36 +02:00
Daniel Molkentin
88776770f7 Legacy Propagator: Properly initialize members
This fixes coverity CID 12919
2014-06-20 13:36:15 +02:00
Daniel Molkentin
bbf8b9f8dd syncengine: properly initialize all members in ctor
This fixes Coverity CID 12922
2014-06-20 13:28:52 +02:00
Daniel Molkentin
6ff38d8005 Cleanup member initialization in Theme
This fixes coverity issue 12925
2014-06-20 13:28:52 +02:00
Daniel Molkentin
6d13b5cc43 wizard setuppage: Clean up and properly initialize members
This fixes Coverity CID 12926
2014-06-20 13:28:52 +02:00
Daniel Molkentin
73ab2804c4 owncloudwizard: properly initialize _account memember
This fixes Coverity CID 12927
2014-06-20 13:28:52 +02:00
Klaas Freitag
db3d2eed5f csync core: Remove logically dead code: Can never be reached.
This fixes Coverity CID 12881
2014-06-20 13:08:03 +02:00
Klaas Freitag
d995d1190f SyncFileItem: Some more proper member initializations.
This fixes a Coverity CID
2014-06-20 12:54:46 +02:00
Klaas Freitag
3217e42a0f SyncJournalDB: Initialize size member properly with 0
This fixes Coverity CID 12924
2014-06-20 12:37:49 +02:00
Klaas Freitag
1dd58a537e owncloudcmd: Fix structurally dead code.
This fixes Coverity CID 12928
2014-06-20 12:34:15 +02:00
Olivier Goffart
b34afa1afc reconcile: use the proper enum type
thankfully the value hapenned to be the same, but the type
is of CSYNC_FTW_..  and not CSYNC_VIO_FILE_TYPE
Detected by coverity (CID 12887)
2014-06-20 11:51:07 +02:00
Olivier Goffart
b7c9fa6d5f csync_owncloud: silent CID 12883 2014-06-20 11:51:07 +02:00
Olivier Goffart
61ad376bf4 accountsettings: silent coverity warning 12884
We use f anyway, so if we are going to test if it's null we can as
well return
2014-06-20 11:51:07 +02:00
Klaas Freitag
407b3bebfe csync file util: Remove compare file function, not needed anymore.
This also fixes Coverity CID 12890 and CID 12898
2014-06-20 11:39:28 +02:00
Olivier Goffart
f04c80dd0e httpbf: silent coverity issue 12905 2014-06-20 11:33:29 +02:00
Olivier Goffart
1e788d3d60 folderwizard: fix possible use of null pointer
Coverity issue 12907
2014-06-20 11:29:28 +02:00
Olivier Goffart
83171bf025 accountsettings: remove unused function
It was moved into owncloudgui before
And it was broken (bad use of QUrl and use of null pointer
2014-06-20 11:27:37 +02:00
Olivier Goffart
2e51721851 owncloudgui: Fix compilation 2014-06-20 11:26:41 +02:00
Olivier Goffart
4d4a0148e4 owncloudgui: use QUrl::fromLocalFile 2014-06-20 11:21:36 +02:00
Klaas Freitag
b144a5bbf9 csync_exclude: Add a missing free of path components.
This fixes Coverity CID 12895
2014-06-20 11:14:50 +02:00
Olivier Goffart
5225fe07e0 csync_owncloud_recursive_propfind: "fix" possible memory leak
This was only leaking memory if ne_path_parent returns 0, which
should never happen

This fixes coverity issue 12897
2014-06-20 11:12:45 +02:00
Klaas Freitag
85cdbd1f1d stateDB: Close the file descriptor even if stat failed.
This fixes Coverity CID 12897
2014-06-20 11:05:40 +02:00
Klaas Freitag
e4f8a136f1 StateDB: Free locale string also if attribs are invalid.
This fixes Coverity CID 12898
2014-06-20 11:05:40 +02:00
Daniel Molkentin
c263c38cdf statedb.c: fix potential memory leak on win32
This fixes coverity issue 12898
2014-06-20 10:58:03 +02:00
Daniel Molkentin
df8553e878 httpbf.c: Fix resource leak
This fixes Coverity CID 12902
2014-06-20 10:58:03 +02:00
Daniel Molkentin
bec66c85d4 Fix potential memory leak
This fixes Coverity CID 12893
2014-06-20 10:58:03 +02:00
Daniel Molkentin
f9710cc1d5 c_time: Fix resource leak in error case
This fixes Coverity CID 12903
2014-06-20 10:58:03 +02:00
Daniel Molkentin
6b041b0846 Fix use-after-free in QNAM propagator
This fixes Coverity CID 12929
2014-06-20 10:58:03 +02:00
Klaas Freitag
d0c992c991 Updater: Free tmp variable that might point to temp malloced memory
This fixes Coverity CID 12900
2014-06-20 10:41:01 +02:00
Klaas Freitag
9ee86cf06b Fix resource leak in win32 code path, added free of locale filename.
This fixes Coverity CID 12901
2014-06-20 10:25:00 +02:00
Olivier Goffart
646eafb05d Legacy propagator jobs: Do not limit bandwidth when aborting
When aborting, we want the last job to be as fast as possible
as it blocks the UI.  So don't limit the bandwidth in that case
2014-06-18 15:09:19 +02:00
Olivier Goffart
0880444e37 Syncengine: Wait for the neon thead to be finished before destroying the Propagator and calling csync_commit
The legacy job might still need the neon session and the propagator.
We need to make sure the thread exits before.

This fixes crash when pausing a sync made with the legacy jobs
(for example when there is network limitation)
This should fix https://github.com/owncloud/enterprise/issues/200
2014-06-18 15:08:23 +02:00
Olivier Goffart
0a953b91f9 csync_vio_local: fix memory leak on windows 2014-06-17 16:40:38 +02:00
Klaas Freitag
b71881d300 SyncEngine: Use QSet for the seenFiles rather than QHash.
We can save some memory here as the seenFiles list can be long.
2014-06-17 16:30:11 +02:00
Daniel Molkentin
b91967f4d9 Fix regression over 1.5: Fix non-fba auth for Shib IdPs 2014-06-17 14:53:23 +02:00
Klaas Freitag
2d234cd96f Propagator: Handle file open error properly and log error message. 2014-06-16 13:35:50 +02:00
Klaas Freitag
1230e87330 Propagator: Give a more specific error message on file remove.
If the file is removed during it is synced up, there is now a correct
error message saying that, rather than "the file has changed during
upload."
2014-06-16 13:34:59 +02:00
Daniel Molkentin
b2966fecc7 Shib: remove slotLoadFinished() from webview dtor
This is a relict from when the webview was reused.
It is now pointless, since it's now destruct-on-close.
2014-06-14 03:00:18 +02:00
Daniel Molkentin
4abe00ff6c Shib: Ensure browser view gets closed before QNAM
Otherwise, QWebPage tries to delete its QNetworkReplies, which have
already been deleted by the QNAM destruction, who is their parent.

Fixes #1840
2014-06-14 03:00:18 +02:00
Klaas Freitag
e1db834ec9 Add missing cmakedefine for HAVE_ASPRINTF and minor cleanup.
Fixes windows build.
2014-06-13 13:30:59 +02:00
Klaas Freitag
c72c72a106 FolderWizard: Get folder map from FolderMan rather than store locally.
If the Folder::Map object is kept locally in the wizard, changes to
the map are not reflected there, as they happen when signing out.
This fixes bug #1875
2014-06-12 23:17:13 +02:00
Daniel Molkentin
4a5ef8f173 Fix a possible crash caused by a dangling pointer 2014-06-12 10:29:17 +02:00
Klaas Freitag
ed26bcb3e7 Theme: Show the stringified app version rather than the major version.
This was a regression, we changed that by accident in 1.6.0.

(cherry picked from commit 760ecd71fc)
2014-06-10 17:05:15 +02:00
Daniel Molkentin
b814b45e50 Add version and product information to installer properties 2014-06-05 11:51:12 +02:00
Daniel Molkentin
ded8914df2 [Janitor] Bump version to 1.6.1pre 2014-06-05 11:51:12 +02:00
Olivier Goffart
7a7b0e8939 propagator: Ignore new directory inside removed directory.
This fixes te bug if one create a tree of folders and subfolders
and delete them while they are uploading. Some folder would
reappears
2014-06-04 16:37:46 +02:00
Olivier Goffart
a4f6370774 propagator: do not update perent directory etag before sub directories are removed
Direcotries are removed at the end, and we don't want to update
parent directory etag before the delete is performed, or the next
sync may read from db and think the files are not removed.

Issue #1845
2014-06-04 12:31:30 +02:00
Olivier Goffart
6605a89990 csync_statedb: Fix wrong % code in debug output
%ld is for long, but int64_t is larger than long on windows
2014-06-03 18:28:31 +02:00
Olivier Goffart
6e10b8c5c4 Propagator: Recover from 'precondition failed' error
When we detect a precondition failed, it is possible that it is
because the etag in the database is wrong.  We must therefore not
read from the database on the next sync.  In order to avoid that, we
reset the etag of parent directories to invalid values

Fixes #1767
2014-06-03 17:22:40 +02:00
Olivier Goffart
24616bead4 Fix syncing a folder with '#' in the name
Or an url with '#'

Fixes #1838

The problem is a bug fixed in Qt5 now breaks.
In Qt4, QUrl::setPath() did not properly handle path with '#' in them
and QUrl::toString would restitute the '#'.

But csync will blindly do  "uri + path" before passing the path to
VIO.  because csync_update has no idea that the VIO plugin need special
encoding, the encoding cannot be done there.  But csync_owncloud then
encodes the full path.  So if the uri contains '#', it must not be already
encoded or there will be two encoding.
2014-06-03 15:45:10 +02:00
Olivier Goffart
13f9970257 Fix some possible "Precondition Failed" bug
The problem was if there was a false conflict: the file has been touched
both on the server and the client.
 - etag has changed on the server
 - mtime has changed on the server and the client and is the same
 - and file size is the same on both the server and the client

This may also happen if the file is uploaded on the server, but the client
looses connection (or crashes) before it get notified of the etag.

In both tree, the instruction is EVAL, but we reduce it to a NONE because
we detected that the conflict is 'false'.  Still, we need to update the db
with the new etag.  (_should_update_db)
The problem was that we would set the flag on the wrong tree.
This was not a problem when the file was NEW on both side since  we checked
for null etag and used the other one then.
2014-06-03 12:23:30 +02:00
45 changed files with 256 additions and 146 deletions

View File

@@ -1,10 +1,10 @@
set( MIRALL_VERSION_MAJOR 1 )
set( MIRALL_VERSION_MINOR 6 )
set( MIRALL_VERSION_PATCH 0 )
set( MIRALL_VERSION_PATCH 1 )
set( MIRALL_SOVERSION 0 )
if ( NOT DEFINED MIRALL_VERSION_SUFFIX )
set( MIRALL_VERSION_SUFFIX "") #e.g. beta1, beta2, rc1
set( MIRALL_VERSION_SUFFIX "rc1") #e.g. beta1, beta2, rc1
endif( NOT DEFINED MIRALL_VERSION_SUFFIX )
if( NOT DEFINED MIRALL_VERSION_BUILD )

View File

@@ -151,6 +151,12 @@ UninstPage custom un.UnPageUserAppData un.UnPageUserAppDataLeave
!include ${source_path}/admin/win/nsi/l10n/languages.nsh
!include ${source_path}/admin/win/nsi/l10n/declarations.nsh
; Set version strings with english locale
VIProductVersion "${VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APPLICATION_NAME}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${APPLICATION_VENDOR}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VERSION}"
!macro SETLANG un
Function ${un}SetLang
# load the selected language file
@@ -407,7 +413,7 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
File "${QT_DLL_PATH}\Qt5Xml.dll"
;Qt deps
File "${MING_BIN}\libpng15-15.dll"
File "${MING_BIN}\libpng16-16.dll"
File "${MING_BIN}\icudata51.dll"
File "${MING_BIN}\icui18n51.dll"
File "${MING_BIN}\icuuc51.dll"
@@ -415,7 +421,6 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
File "${MING_BIN}\libGLESv2.dll"
File "${MING_BIN}\libjpeg-8.dll"
File "${MING_BIN}\libpcre16-0.dll"
File "${MING_BIN}\libpng15-15.dll"
File "${MING_BIN}\libproxy.dll"
File "${MING_BIN}\libqt5keychain.dll"
File "${MING_BIN}\libsqlite3-0.dll"
@@ -442,6 +447,7 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
;MinGW stuff
File "${MING_BIN}\libgcc_s_sjlj-1.dll"
File "${MING_BIN}\libstdc++-6.dll"
File "${MING_BIN}\libwinpthread-1.dll"
; CSync configs
File "${SOURCE_PATH}/sync-exclude.lst"

View File

@@ -22,7 +22,6 @@
#cmakedefine HAVE_UTIMES 1
#cmakedefine HAVE_LSTAT 1
#cmakedefine HAVE_FNMATCH 1
#cmakedefine HAVE___MINGW_ASPRINTF 1
#cmakedefine HAVE_ICONV 1
#cmakedefine HAVE_ICONV_CONST 1
@@ -31,5 +30,6 @@
#endif
#cmakedefine HAVE___MINGW_ASPRINTF 1
#cmakedefine HAVE_ASPRINTF 1
#cmakedefine WITH_UNIT_TESTING 1

View File

@@ -277,11 +277,6 @@ int csync_update(CSYNC *ctx) {
c_secdiff(finish, start), c_rbtree_size(ctx->local.tree));
csync_memstat_check();
if (rc < 0) {
ctx->status_code = CSYNC_STATUS_TREE_ERROR;
return -1;
}
/* update detection for remote replica */
if( ! ctx->options.local_only_mode ) {
csync_gettime(&start);

View File

@@ -229,6 +229,7 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
type = CSYNC_FILE_EXCLUDE_LIST;
if (strlen(pattern) < 1) {
SAFE_FREE(pattern_stored);
continue;
}
/* Ecludes starting with ']' means it can be cleanup */
@@ -264,6 +265,9 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
if (bname == NULL || dname == NULL) {
match = CSYNC_NOT_EXCLUDED;
SAFE_FREE(bname);
SAFE_FREE(dname);
SAFE_FREE(pattern_stored);
goto out;
}

View File

@@ -696,7 +696,7 @@ static struct listdir_context *fetch_resource_list(const char *uri, int depth)
ret = NE_CONNECT;
set_error_message(req_status->reason_phrase);
}
DEBUG_WEBDAV("Simple propfind result code %d.", req_status->code);
DEBUG_WEBDAV("Simple propfind result code %d.", req_status ? req_status->code : -1);
} else {
if( ret == NE_ERROR && req_status->code == 404) {
errno = ENOENT;

View File

@@ -236,13 +236,12 @@ static void propfind_results_recursive(void *userdata,
}
/* DEBUG_WEBDAV("results_recursive Added child %s to collection %s", newres->uri, element->self->uri); */
} else {
/* DEBUG_WEBDAV("results_recursive No parent %s found for child %s", parentPath, newres->uri); */
resource_free(newres);
newres = NULL;
return;
}
}
resource_free(newres);
newres = NULL;
}
void fetch_resource_list_recursive(const char *uri, const char *curi)

View File

@@ -238,8 +238,8 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
/* file on other replica is changed or new */
case CSYNC_INSTRUCTION_NEW:
case CSYNC_INSTRUCTION_EVAL:
if (other->type == CSYNC_VIO_FILE_TYPE_DIRECTORY &&
cur->type == CSYNC_VIO_FILE_TYPE_DIRECTORY) {
if (other->type == CSYNC_FTW_TYPE_DIR &&
cur->type == CSYNC_FTW_TYPE_DIR) {
is_equal_files = (other->modtime == cur->modtime);
} else {
is_equal_files = ((other->size == cur->size) && (other->modtime == cur->modtime));
@@ -249,8 +249,12 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
cur->instruction = CSYNC_INSTRUCTION_NONE;
other->instruction = CSYNC_INSTRUCTION_NONE;
if( !cur->etag && other->etag ) cur->etag = c_strdup(other->etag);
cur->should_update_etag = true; /* update DB */
/* update DB with new etag from remote */
if (ctx->current == LOCAL_REPLICA) {
other->should_update_etag = true;
} else {
cur->should_update_etag = true;
}
} else if(ctx->current == REMOTE_REPLICA) {
cur->instruction = CSYNC_INSTRUCTION_CONFLICT;
other->instruction = CSYNC_INSTRUCTION_NONE;

View File

@@ -32,6 +32,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <inttypes.h>
#include "c_lib.h"
#include "csync_private.h"
@@ -68,12 +69,11 @@ static void _csync_win32_hide_file( const char *file ) {
fileName = c_utf8_to_locale( file );
dwAttrs = GetFileAttributesW(fileName);
if (dwAttrs==INVALID_FILE_ATTRIBUTES) return;
if (!(dwAttrs & FILE_ATTRIBUTE_HIDDEN)) {
SetFileAttributesW(fileName, dwAttrs | FILE_ATTRIBUTE_HIDDEN );
if (dwAttrs != INVALID_FILE_ATTRIBUTES) {
if (!(dwAttrs & FILE_ATTRIBUTE_HIDDEN)) {
SetFileAttributesW(fileName, dwAttrs | FILE_ATTRIBUTE_HIDDEN );
}
}
c_free_locale_string(fileName);
#else
(void) file;
@@ -155,6 +155,8 @@ static int _csync_statedb_check(const char *statedb) {
}
}
}
} else {
close(fd);
}
/* if it comes here, the database is broken and should be recreated. */
_tunlink(wstatedb);
@@ -529,7 +531,7 @@ int csync_statedb_get_below_path( CSYNC *ctx, const char *path ) {
if( rc != SQLITE_DONE ) {
ctx->status_code = CSYNC_STATUS_TREE_ERROR;
} else {
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "%ld entries read below path %s from db.", cnt, path);
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "%" PRId64 " entries read below path %s from db.", cnt, path);
}
sqlite3_finalize(stmt);
SAFE_FREE(likepath);

View File

@@ -274,6 +274,9 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
} else {
enum csync_vio_file_type_e tmp_vio_type = CSYNC_VIO_FILE_TYPE_UNKNOWN;
/* tmp might point to malloc mem, so free it here before reusing tmp */
SAFE_FREE(tmp);
/* check if it's a file and has been renamed */
if (ctx->current == LOCAL_REPLICA) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Checking for rename based on inode # %" PRId64 "", (uint64_t) fs->inode);

View File

@@ -113,12 +113,12 @@ void csync_win32_set_file_hidden( const char *file, bool h ) {
fileName = c_utf8_to_locale( file );
dwAttrs = GetFileAttributesW(fileName);
if (dwAttrs==INVALID_FILE_ATTRIBUTES) return;
if (h && !(dwAttrs & FILE_ATTRIBUTE_HIDDEN)) {
SetFileAttributesW(fileName, dwAttrs | FILE_ATTRIBUTE_HIDDEN );
} else if (!h && (dwAttrs & FILE_ATTRIBUTE_HIDDEN)) {
SetFileAttributesW(fileName, dwAttrs & ~FILE_ATTRIBUTE_HIDDEN );
if (dwAttrs != INVALID_FILE_ATTRIBUTES) {
if (h && !(dwAttrs & FILE_ATTRIBUTE_HIDDEN)) {
SetFileAttributesW(fileName, dwAttrs | FILE_ATTRIBUTE_HIDDEN );
} else if (!h && (dwAttrs & FILE_ATTRIBUTE_HIDDEN)) {
SetFileAttributesW(fileName, dwAttrs & ~FILE_ATTRIBUTE_HIDDEN );
}
}
c_free_locale_string(fileName);

View File

@@ -204,9 +204,9 @@ void hbf_free_transfer( hbf_transfer_t *transfer ) {
for( cnt = 0; cnt < transfer->block_cnt; cnt++ ) {
hbf_block_t *block = transfer->block_arr[cnt];
if( !block ) continue;
if( block->http_error_msg ) free( block->http_error_msg );
if( block->etag ) free( block->etag );
if( block ) free(block);
}
free( transfer->block_arr );
free( transfer->url );
@@ -536,8 +536,8 @@ Hbf_State hbf_transfer( ne_session *session, hbf_transfer_t *transfer, const cha
} else {
state = HBF_MEMORY_FAIL;
}
free( transfer_url );
}
free( transfer_url );
}
/* do the source file validation finally (again). */

View File

@@ -135,7 +135,8 @@ int c_utimes(const char *uri, const struct timeval *times) {
if(!SetFileTime(hFile, NULL, &LastAccessTime, &LastModificationTime)) {
//can this happen?
errno=ENOENT;
CloseHandle(hFile);
CloseHandle(hFile);
c_free_locale_string(wuri);
return -1;
}

View File

@@ -260,6 +260,7 @@ int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf) {
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_CTIME;
}
c_free_locale_string(wuri);
CloseHandle(h);
return 0;

View File

@@ -317,7 +317,7 @@ void FancyLineEdit::setButtonFocusPolicy(Side side, Qt::FocusPolicy policy)
// IconButton - helper class to represent a clickable icon
IconButton::IconButton(QWidget *parent)
: QAbstractButton(parent), m_autoHide(false)
: QAbstractButton(parent), m_iconOpacity(0), m_autoHide(false)
{
setCursor(Qt::ArrowCursor);
setFocusPolicy(Qt::NoFocus);

View File

@@ -18,10 +18,8 @@
#include <QWebFrame>
#include <QWebPage>
#include <QMessageBox>
#include <QAuthenticator>
#include <QNetworkReply>
#include "creds/shibboleth/authenticationdialog.h"
#include "creds/shibboleth/shibbolethwebview.h"
#include "creds/shibbolethcredentials.h"
#include "mirall/account.h"
@@ -65,7 +63,6 @@ ShibbolethWebView::ShibbolethWebView(Account* account, QWidget* parent)
ShibbolethWebView::~ShibbolethWebView()
{
slotLoadFinished();
}
void ShibbolethWebView::onNewCookiesForUrl (const QList<QNetworkCookie>& cookieList, const QUrl& url)
@@ -107,23 +104,6 @@ void ShibbolethWebView::slotLoadFinished(bool success)
}
}
void ShibbolethWebView::slotHandleAuthentication(QNetworkReply *reply, QAuthenticator *authenticator)
{
Q_UNUSED(reply)
QUrl url = reply->url();
// show only scheme, host and port
QUrl reducedUrl;
reducedUrl.setScheme(url.scheme());
reducedUrl.setHost(url.host());
reducedUrl.setPort(url.port());
AuthenticationDialog dialog(authenticator->realm(), reducedUrl.toString(), this);
if (dialog.exec() == QDialog::Accepted) {
authenticator->setUser(dialog.user());
authenticator->setPassword(dialog.password());
}
}
void ShibbolethWebView::accept()
{
_accepted = true;

View File

@@ -46,8 +46,7 @@ Q_SIGNALS:
private Q_SLOTS:
void onNewCookiesForUrl(const QList<QNetworkCookie>& cookieList, const QUrl& url);
void slotLoadStarted();
void slotLoadFinished(bool success = true);
void slotHandleAuthentication(QNetworkReply*,QAuthenticator*);
void slotLoadFinished(bool success);
protected:
void accept();

View File

@@ -16,9 +16,11 @@
#include <QSettings>
#include <QNetworkReply>
#include <QMessageBox>
#include <QAuthenticator>
#include <QDebug>
#include "creds/shibbolethcredentials.h"
#include "creds/shibboleth/authenticationdialog.h"
#include "creds/shibboleth/shibbolethwebview.h"
#include "creds/shibboleth/shibbolethrefresher.h"
#include "creds/shibbolethcredentials.h"
@@ -154,6 +156,8 @@ QNetworkAccessManager* ShibbolethCredentials::getQNAM() const
QNetworkAccessManager* qnam(new MirallAccessManager);
connect(qnam, SIGNAL(finished(QNetworkReply*)),
this, SLOT(slotReplyFinished(QNetworkReply*)));
connect(qnam, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
SLOT(slotHandleAuthentication(QNetworkReply*,QAuthenticator*)));
return qnam;
}
@@ -298,6 +302,23 @@ void ShibbolethCredentials::invalidateAndFetch(Account* account)
job->start();
}
void ShibbolethCredentials::slotHandleAuthentication(QNetworkReply *reply, QAuthenticator *authenticator)
{
Q_UNUSED(reply)
QUrl url = reply->url();
// show only scheme, host and port
QUrl reducedUrl;
reducedUrl.setScheme(url.scheme());
reducedUrl.setHost(url.host());
reducedUrl.setPort(url.port());
AuthenticationDialog dialog(authenticator->realm(), reducedUrl.toString());
if (dialog.exec() == QDialog::Accepted) {
authenticator->setUser(dialog.user());
authenticator->setPassword(dialog.password());
}
}
void ShibbolethCredentials::slotInvalidateAndFetchInvalidateDone(QKeychain::Job* job)
{
Account *account = qvariant_cast<Account*>(job->property("account"));
@@ -350,9 +371,16 @@ void ShibbolethCredentials::showLoginWindow(Account* account)
// FIXME On OS X this does not raise properly
return;
}
CookieJar *jar = static_cast<CookieJar*>(account->networkAccessManager()->cookieJar());
// When opening a new window clear all the session cookie that might keep the user from logging in
// (or the session may already be open in the server, and there will not be redirect asking for the
// real long term cookie we want to store)
jar->clearSessionCookies();
_browser = new ShibbolethWebView(account);
connect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie, Account*)),
this, SLOT(onShibbolethCookieReceived(QNetworkCookie, Account*)));
this, SLOT(onShibbolethCookieReceived(QNetworkCookie, Account*)), Qt::QueuedConnection);
connect(_browser, SIGNAL(rejected()), this, SLOT(slotBrowserRejected()));
_browser->show();

View File

@@ -26,6 +26,8 @@ namespace QKeychain {
class Job;
}
class QAuthenticator;
namespace Mirall
{
@@ -58,6 +60,7 @@ public:
public Q_SLOTS:
void invalidateAndFetch(Account *account);
void slotHandleAuthentication(QNetworkReply*,QAuthenticator*);
private Q_SLOTS:
void onShibbolethCookieReceived(const QNetworkCookie&, Account*);

View File

@@ -172,8 +172,6 @@ void AccountSettings::slotAddFolder()
folderMan->setSyncEnabled(false); // do not start more syncs.
FolderWizard *folderWizard = new FolderWizard(this);
Folder::Map folderMap = folderMan->map();
folderWizard->setFolderMap( folderMap );
connect(folderWizard, SIGNAL(accepted()), SLOT(slotFolderWizardAccepted()));
connect(folderWizard, SIGNAL(rejected()), SLOT(slotFolderWizardRejected()));
@@ -418,28 +416,6 @@ void AccountSettings::setFolderList( const Folder::Map &folders )
}
// move from Application
void AccountSettings::slotFolderOpenAction( const QString& alias )
{
Folder *f = FolderMan::instance()->folder(alias);
qDebug() << "opening local url " << f->path();
if( f ) {
QUrl url(f->path(), QUrl::TolerantMode);
url.setScheme( QLatin1String("file") );
#ifdef Q_OS_WIN
// work around a bug in QDesktopServices on Win32, see i-net
QString filePath = f->path();
if (filePath.startsWith(QLatin1String("\\\\")) || filePath.startsWith(QLatin1String("//")))
url.setUrl(QDir::toNativeSeparators(filePath));
else
url = QUrl::fromLocalFile(filePath);
#endif
QDesktopServices::openUrl(url);
}
}
void AccountSettings::slotEnableCurrentFolder()
{
QModelIndex selected = ui->_folderList->selectionModel()->currentIndex();
@@ -456,7 +432,11 @@ void AccountSettings::slotEnableCurrentFolder()
// this sets the folder status to disabled but does not interrupt it.
Folder *f = folderMan->folder( alias );
if( f && folderEnabled ) {
if (!f) {
return;
}
if( folderEnabled ) {
// check if a sync is still running and if so, ask if we should terminate.
if( f->isBusy() ) { // its still running
#if defined(Q_OS_MAC)

View File

@@ -60,7 +60,6 @@ public slots:
void slotOpenOC();
void slotUpdateFolderState( Folder* );
void slotDoubleClicked( const QModelIndex& );
void slotFolderOpenAction( const QString& );
void slotSetProgress(const QString& folder, const Progress::Info& progress);
void slotButtonsSetEnabled();

View File

@@ -99,10 +99,21 @@ bool Folder::init()
return false;
}
QString url = Utility::toCSyncScheme(remoteUrl().toString());
// We need to reconstruct the url because the path need to be fully decoded, as csync will re-encode the path:
// Remember that csync will just append the filename to the path and pass it to the vio plugin.
// csync_owncloud will then re-encode everything.
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QUrl url = remoteUrl();
QString url_string = url.scheme() + QLatin1String("://") + url.authority(QUrl::EncodeDelimiters) + url.path(QUrl::FullyDecoded);
#else
// Qt4 was broken anyway as it did not encode the '#' as it should have done (it was actually a provlem when parsing the path from QUrl::setPath
QString url_string = remoteUrl().toString();
#endif
url_string = Utility::toCSyncScheme(url_string);
QString localpath = path();
if( csync_create( &_csync_ctx, localpath.toUtf8().data(), url.toUtf8().data() ) < 0 ) {
if( csync_create( &_csync_ctx, localpath.toUtf8().data(), url_string.toUtf8().data() ) < 0 ) {
qDebug() << "Unable to create csync-context!";
slotSyncError(tr("Unable to create csync-context"));
_csync_ctx = 0;

View File

@@ -200,7 +200,6 @@ private:
QString _remotePath;
QString _alias;
QString _configFile;
QFileSystemWatcher *_pathWatcher;
bool _enabled;
SyncResult _syncResult;
QScopedPointer<SyncEngine> _engine;

View File

@@ -56,9 +56,6 @@ class FolderStatusDelegate : public QStyledItemDelegate
QSize sizeHint( const QStyleOptionViewItem&, const QModelIndex& ) const;
bool editorEvent( QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option,
const QModelIndex& index );
private:
bool _addProgressSpace;
};
} // namespace Mirall

View File

@@ -104,7 +104,7 @@ bool FolderWizardLocalPath::isComplete() const
}
// check if the local directory isn't used yet in another ownCloud sync
Folder::Map map = _folderMap;
Folder::Map map = FolderMan::instance()->map();
if( isOk ) {
Folder::Map::const_iterator i = map.constBegin();
@@ -170,8 +170,8 @@ bool FolderWizardLocalPath::isComplete() const
bool goon = true;
while( goon && i != map.constEnd() ) {
Folder *f = i.value();
qDebug() << "Checking local alias: " << f->alias();
if( f ) {
qDebug() << "Checking local alias: " << f->alias();
if( f->alias() == alias ) {
warnStrings.append( tr("The alias <i>%1</i> is already in use. Please pick another alias.").arg(alias) );
isOk = false;
@@ -224,7 +224,10 @@ void FolderWizardLocalPath::slotChooseLocalFolder()
// =================================================================================
FolderWizardRemotePath::FolderWizardRemotePath()
: FormatWarningsWizardPage()
, _ownCloudDirCheck(0)
, _dirChecked(false)
,_warnWasVisible(false)
{
_ui.setupUi(this);
_ui.warnFrame->hide();
@@ -374,7 +377,7 @@ bool FolderWizardRemotePath::isComplete() const
}
wizard()->setProperty("targetPath", dir);
Folder::Map map = _folderMap;
Folder::Map map = FolderMan::instance()->map();
Folder::Map::const_iterator i = map.constBegin();
for(i = map.constBegin();i != map.constEnd(); i++ ) {
Folder *f = static_cast<Folder*>(i.value());
@@ -448,13 +451,6 @@ FolderWizard::~FolderWizard()
{
}
void FolderWizard::setFolderMap( const Folder::Map& fm)
{
_folderWizardSourcePage->setFolderMap( fm );
if (!Theme::instance()->singleSyncFolder()) {
_folderWizardTargetPage->setFolderMap( fm );
}
}
} // end namespace

View File

@@ -73,8 +73,6 @@ public:
virtual void initializePage();
virtual void cleanupPage();
void setFolderMap( const Folder::Map &fm ) { _folderMap = fm; }
protected slots:
void showWarn( const QString& = QString() ) const;
@@ -91,7 +89,7 @@ private:
ownCloudInfo *_ownCloudDirCheck;
bool _dirChecked;
bool _warnWasVisible;
Folder::Map _folderMap;
};
/**
@@ -109,7 +107,6 @@ public:
FolderWizard(QWidget *parent = 0);
~FolderWizard();
void setFolderMap( const Folder::Map &map );
private:

View File

@@ -326,10 +326,9 @@ void ownCloudGui::slotShowOptionalTrayMessage(const QString &title, const QStrin
void ownCloudGui::slotFolderOpenAction( const QString& alias )
{
Folder *f = FolderMan::instance()->folder(alias);
qDebug() << "opening local url " << f->path();
if( f ) {
QUrl url(f->path(), QUrl::TolerantMode);
url.setScheme( QLatin1String("file") );
qDebug() << "opening local url " << f->path();
QUrl url = QUrl::fromLocalFile(f->path());
#ifdef Q_OS_WIN
// work around a bug in QDesktopServices on Win32, see i-net

View File

@@ -219,10 +219,23 @@ void OwncloudPropagator::start(const SyncFileItemVector& _syncedItems)
QVector<PropagatorJob*> directoriesToRemove;
QString removedDirectory;
foreach(const SyncFileItem &item, items) {
if (item._instruction == CSYNC_INSTRUCTION_REMOVE
&& !removedDirectory.isEmpty() && item._file.startsWith(removedDirectory)) {
//already taken care of. (by the removal of the parent directory)
continue;
if (!removedDirectory.isEmpty() && item._file.startsWith(removedDirectory)) {
// this is an item in a directory which is going to be removed.
if (item._instruction == CSYNC_INSTRUCTION_REMOVE) {
//already taken care of. (by the removal of the parent directory)
continue;
} else if (item._instruction == CSYNC_INSTRUCTION_NEW && item._isDirectory) {
// create a new directory within a deleted directory? That can happen if the directory
// etag were not fetched properly on the previous sync because the sync was aborted
// while uploading this directory (which is now removed). We can ignore it.
continue;
} else if (item._instruction == CSYNC_INSTRUCTION_IGNORE) {
continue;
}
qWarning() << "WARNING: Job within a removed directory? This should not happen!"
<< item._file << item._instruction;
}
while (!item.destination().startsWith(directories.top().first)) {
@@ -233,11 +246,21 @@ void OwncloudPropagator::start(const SyncFileItemVector& _syncedItems)
PropagateDirectory *dir = new PropagateDirectory(this, item);
dir->_firstJob.reset(createJob(item));
if (item._instruction == CSYNC_INSTRUCTION_REMOVE) {
//We do the removal of directories at the end
//We do the removal of directories at the end, because there might be moves from
// this directories that will happen later.
directoriesToRemove.append(dir);
removedDirectory = item._file + "/";
// We should not update the etag of parent directories of the removed directory
// since it would be done before the actual remove (issue #1845)
// NOTE: Currently this means that we don't update those etag at all in this sync,
// but it should not be a problem, they will be updated in the next sync.
for (int i = 0; i < directories.size(); ++i) {
directories[i].second->_item._should_update_etag = false;
}
} else {
directories.top().second->append(dir);
PropagateDirectory* currentDirJob = directories.top().second;
currentDirJob->append(dir);
}
directories.push(qMakePair(item.destination() + "/" , dir));
} else if (PropagateItemJob* current = createJob(item)) {

View File

@@ -31,7 +31,8 @@
namespace Mirall {
ownCloudTheme::ownCloudTheme()
ownCloudTheme::ownCloudTheme() :
Theme()
{
// qDebug() << " ** running ownCloud theme!";
}

View File

@@ -305,6 +305,11 @@ bool PropagateNeonJob::updateMTimeAndETag(const char* uri, time_t mtime)
void PropagateNeonJob::limitBandwidth(qint64 progress, qint64 bandwidth_limit)
{
if (_propagator->_abortRequested.fetchAndAddRelaxed(0)) {
// Do not limit bandwidth when aborting to speed up the current transfer
return;
}
if (bandwidth_limit > 0) {
int64_t diff = _lastTime.nsecsElapsed() / 1000;
int64_t len = progress - _lastProgress;

View File

@@ -23,7 +23,8 @@ class PropagateUploadFileLegacy: public PropagateNeonJob {
Q_OBJECT
public:
explicit PropagateUploadFileLegacy(OwncloudPropagator* propagator,const SyncFileItem& item)
: PropagateNeonJob(propagator, item), _previousFileSize(0) {}
: PropagateNeonJob(propagator, item)
, _chunked_done(0), _chunked_total_size(0), _previousFileSize(0) {}
void start();
private:
// Log callback for httpbf

View File

@@ -200,7 +200,7 @@ void PropagateUploadFileQNAM::startNextChunk()
}
QString path = _item._file;
QIODevice *device;
QIODevice *device = 0;
if (_chunkCount > 1) {
int sendingChunk = (_currentChunk + _startChunk) % _chunkCount;
// XOR with chunk size to make sure everything goes well if chunk size change between runs
@@ -218,14 +218,24 @@ void PropagateUploadFileQNAM::startNextChunk()
} else {
device = _file;
}
if (!device->isOpen())
device->open(QIODevice::ReadOnly);
_job = new PUTFileJob(AccountManager::instance()->account(), _propagator->_remoteFolder + path, device, headers);
_job->setTimeout(_propagator->httpTimeout() * 1000);
connect(_job, SIGNAL(finishedSignal()), this, SLOT(slotPutFinished()));
connect(_job, SIGNAL(uploadProgress(qint64,qint64)), this, SLOT(slotUploadProgress(qint64,qint64)));
_job->start();
bool isOpen = true;
if (!device->isOpen()) {
isOpen = device->open(QIODevice::ReadOnly);
}
if( isOpen ) {
_job = new PUTFileJob(AccountManager::instance()->account(), _propagator->_remoteFolder + path, device, headers);
_job->setTimeout(_propagator->httpTimeout() * 1000);
connect(_job, SIGNAL(finishedSignal()), this, SLOT(slotPutFinished()));
connect(_job, SIGNAL(uploadProgress(qint64,qint64)), this, SLOT(slotUploadProgress(qint64,qint64)));
_job->start();
} else {
qDebug() << "ERR: Could not open upload file: " << device->errorString();
done( SyncFileItem::NormalError, device->errorString() );
delete device;
return;
}
}
void PropagateUploadFileQNAM::slotPutFinished()
@@ -257,6 +267,12 @@ void PropagateUploadFileQNAM::slotPutFinished()
errorString += QLatin1String(" (") + rx.cap(1) + QLatin1Char(')');
}
if (_item._httpErrorCode == 412) {
// Precondition Failed: Maybe the bad etag is in the database, we need to clear the
// parent folder etag so we won't read from DB next sync.
_propagator->_journal->avoidReadFromDbOnNextSync(_item._file);
}
done(classifyError(err, _item._httpErrorCode), errorString);
return;
}
@@ -264,9 +280,14 @@ void PropagateUploadFileQNAM::slotPutFinished()
bool finished = job->reply()->hasRawHeader("ETag");
if (!finished) {
QFileInfo fi(_propagator->_localDir + _item._file);
if( !fi.exists() ) {
_propagator->_activeJobs--;
done(SyncFileItem::SoftError, tr("The local file was removed during sync."));
return;
}
if (Utility::qDateTimeToTime_t(QFileInfo(_propagator->_localDir + _item._file).lastModified())
!= _item._modtime) {
if (Utility::qDateTimeToTime_t(fi.lastModified()) != _item._modtime) {
/* Uh oh: The local file has changed during upload */
_propagator->_activeJobs--;
done(SyncFileItem::SoftError, tr("Local file changed during sync."));

View File

@@ -23,6 +23,18 @@ namespace Mirall {
SettingsDialogMac::SettingsDialogMac(ownCloudGui *gui, QWidget *parent)
: MacPreferencesWindow(parent)
{
// do not show minimize button. There is no use, and retoring the
// dialog from minimize is broken in MacPreferencesWindow
setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint |
Qt::WindowCloseButtonHint | Qt::WindowMaximizeButtonHint);
// Emulate dialog behavior: Escape means close
QAction *closeWindowAction = new QAction(this);
closeWindowAction->setShortcut(QKeySequence(Qt::Key_Escape));
connect(closeWindowAction, SIGNAL(triggered()), SLOT(close()));
addAction(closeWindowAction);
setObjectName("SettingsMac"); // required as group for saveGeometry call
setWindowTitle(tr("%1").arg(Theme::instance()->appNameGUI()));

View File

@@ -55,12 +55,17 @@ void csyncLogCatcher(int /*verbosity*/,
bool SyncEngine::_syncRunning = false;
SyncEngine::SyncEngine(CSYNC *ctx, const QString& localPath, const QString& remoteURL, const QString& remotePath, Mirall::SyncJournalDb* journal)
: _csync_ctx(ctx)
, _needsUpdate(false)
, _localPath(localPath)
, _remoteUrl(remoteURL)
, _remotePath(remotePath)
, _journal(journal)
, _hasFiles(false)
, _downloadLimit(0)
, _uploadLimit(0)
{
_localPath = localPath;
_remotePath = remotePath;
_remoteUrl = remoteURL;
_csync_ctx = ctx;
_journal = journal;
qRegisterMetaType<SyncFileItem>("SyncFileItem");
qRegisterMetaType<SyncFileItem::Status>("SyncFileItem::Status");
qRegisterMetaType<Progress::Info>("Progress::Info");
@@ -265,7 +270,7 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
item._fileId = file->file_id;
// record the seen files to be able to clean the journal later
_seenFiles[item._file] = QString();
_seenFiles.insert(item._file);
switch(file->error_status) {
case CSYNC_STATUS_OK:
@@ -655,6 +660,7 @@ void SyncEngine::slotFinished()
if( ! _journal->postSyncCleanup( _seenFiles ) ) {
qDebug() << "Cleaning of synced ";
}
_journal->commit("All Finished.", false);
emit treeWalkResult(_syncedItems);
finalize();
@@ -662,14 +668,14 @@ void SyncEngine::slotFinished()
void SyncEngine::finalize()
{
_thread.quit();
_thread.wait();
csync_commit(_csync_ctx);
qDebug() << "CSync run took " << _stopWatch.addLapTime(QLatin1String("Sync Finished"));
_stopWatch.stop();
_propagator.reset(0);
_thread.quit();
_thread.wait();
_syncRunning = false;
emit finished();
}

View File

@@ -21,6 +21,7 @@
#include <QMutex>
#include <QThread>
#include <QString>
#include <QSet>
#include <qelapsedtimer.h>
#include <csync.h>
@@ -115,7 +116,7 @@ private:
SyncJournalDb *_journal;
QScopedPointer <OwncloudPropagator> _propagator;
QString _lastDeleted; // if the last item was a path and it has been deleted
QHash <QString, QString> _seenFiles;
QSet<QString> _seenFiles;
QThread _thread;
Progress::Info _progressInfo;

View File

@@ -49,8 +49,9 @@ public:
FileIgnored ///< The file is in the ignored list
};
SyncFileItem() : _type(UnknownType), _direction(None), _instruction(CSYNC_INSTRUCTION_NONE),
_size(0), _should_update_etag(false), _blacklistedInDb(false),
SyncFileItem() : _type(UnknownType), _direction(None), _isDirectory(false),
_instruction(CSYNC_INSTRUCTION_NONE), _modtime(0),
_size(0), _inode(0), _should_update_etag(false), _blacklistedInDb(false),
_status(NoStatus), _httpErrorCode(0), _requestDuration(0) {}
friend bool operator==(const SyncFileItem& item1, const SyncFileItem& item2) {

View File

@@ -491,7 +491,7 @@ SyncJournalFileRecord SyncJournalDb::getFileRecord( const QString& filename )
return rec;
}
bool SyncJournalDb::postSyncCleanup(const QHash<QString, QString> &items )
bool SyncJournalDb::postSyncCleanup(const QSet<QString> &items )
{
QMutexLocker locker(&_mutex);
@@ -835,6 +835,28 @@ void SyncJournalDb::avoidRenamesOnNextSync(const QString& path)
}
}
void SyncJournalDb::avoidReadFromDbOnNextSync(const QString& fileName)
{
//Make sure that on the next sync, filName is not read from the DB but use the PROPFIND to
//get the info from the server
// We achieve that by clearing the etag of the parents directory recursively
QMutexLocker locker(&_mutex);
if( !checkConnect() ) {
return;
}
QSqlQuery query(_db);
// This query will match entries for whitch the path is a prefix of fileName
query.prepare("UPDATE metadata SET md5='_invalid_' WHERE ? LIKE(path||'/%') AND type == 2"); // CSYNC_FTW_TYPE_DIR == 2
query.bindValue(0, fileName);
if( !query.exec() ) {
qDebug() << "SQL error in avoidRenamesOnNextSync: "<< query.lastError().text();
} else {
qDebug() << query.executedQuery() << fileName;
}
}
void SyncJournalDb::commit(const QString& context, bool startTrans)
{

View File

@@ -57,7 +57,7 @@ public:
bool _valid;
};
struct UploadInfo {
UploadInfo() : _chunk(0), _transferid(0), _errorCount(0), _valid(false) {}
UploadInfo() : _chunk(0), _transferid(0), _size(0), _errorCount(0), _valid(false) {}
int _chunk;
int _transferid;
quint64 _size; //currently unused
@@ -73,7 +73,13 @@ public:
SyncJournalBlacklistRecord blacklistEntry( const QString& );
void avoidRenamesOnNextSync(const QString &path);
bool postSyncCleanup( const QHash<QString, QString>& items );
/**
* Make sure that on the next sync, filName is not read from the DB but use the PROPFIND to
* get the info from the server
*/
void avoidReadFromDbOnNextSync(const QString& fileName);
bool postSyncCleanup( const QSet<QString>& items );
/* Because sqlite transactions is really slow, we encapsulate everything in big transactions
* Commit will actually commit the transaction and create a new one.

View File

@@ -36,6 +36,7 @@ Theme* Theme::_instance = 0;
Theme* Theme::instance() {
if (!_instance) {
_instance = new THEME_CLASS;
// some themes may not call the base ctor
_instance->_mono = false;
}
return _instance;
@@ -151,6 +152,13 @@ QIcon Theme::themeIcon( const QString& name, bool sysTray ) const
}
return icon;
}
Theme::Theme() :
QObject(0)
,_mono(false)
{
}
#endif
// if this option return true, the client only supports one folder to sync.
@@ -212,7 +220,7 @@ QString Theme::about() const
"<p>Distributed by %4 and licensed under the GNU General Public License (GPL) Version 2.0.<br>"
"%5 and the %5 logo are registered trademarks of %4 in the<br>"
"United States, other countries, or both.</p>")
.arg(MIRALL_VERSION_MAJOR).arg("http://" MIRALL_STRINGIFY(APPLICATION_DOMAIN))
.arg(MIRALL_VERSION_STRING).arg("http://" MIRALL_STRINGIFY(APPLICATION_DOMAIN))
.arg(MIRALL_STRINGIFY(APPLICATION_DOMAIN)).arg(APPLICATION_VENDOR).arg(APPLICATION_NAME);
}

View File

@@ -181,7 +181,7 @@ public:
protected:
QIcon themeIcon(const QString& name, bool sysTray = false) const;
Theme() {}
Theme();
signals:
void systrayUseMonoIconsChanged(bool);

View File

@@ -177,7 +177,6 @@ int main(int argc, char **argv) {
if( csync_init( _csync_ctx ) < 0 ) {
qFatal("Could not initialize csync!");
return EXIT_FAILURE;
_csync_ctx = 0;
}
csync_set_module_property(_csync_ctx, "csync_context", _csync_ctx);

View File

@@ -35,6 +35,8 @@ OwncloudSetupPage::OwncloudSetupPage()
_ocUser(),
_authTypeKnown(false),
_checking(false),
_configExists(false),
_multipleFoldersExist(false),
_authType(WizardCommon::HttpCreds),
_progressIndi(new QProgressIndicator (this))
{

View File

@@ -73,7 +73,6 @@ private:
WizardCommon::AuthType _authType;
QProgressIndicator* _progressIndi;
QButtonGroup* _selectiveSyncButtons;
QString _remoteFolder;
};

View File

@@ -42,14 +42,13 @@ void OwncloudShibbolethCredsPage::setupBrowser()
// we need to reset the cookie jar to drop temporary cookies (like the shib cookie)
// i.e. if someone presses "back"
QNetworkAccessManager *qnam = account->networkAccessManager();
delete qnam->cookieJar();
CookieJar *jar = new CookieJar;
// Implicitly deletes the old cookie jar, and reparents the jar
qnam->setCookieJar(jar);
jar->setParent(0);
_browser = new ShibbolethWebView(account);
connect(_browser, SIGNAL(shibbolethCookieReceived(const QNetworkCookie&, Account*)),
this, SLOT(slotShibbolethCookieReceived()));
this, SLOT(slotShibbolethCookieReceived()), Qt::QueuedConnection);
connect(_browser, SIGNAL(rejected()),
this, SLOT(slotBrowserRejected()));

View File

@@ -36,6 +36,7 @@ namespace Mirall
OwncloudWizard::OwncloudWizard(QWidget *parent)
: QWizard(parent),
_account(0),
_setupPage(new OwncloudSetupPage),
_httpCredsPage(new OwncloudHttpCredsPage),
_shibbolethCredsPage(new OwncloudShibbolethCredsPage),