mirror of
https://github.com/chylex/Nextcloud-Desktop.git
synced 2026-04-12 05:57:41 +02:00
Compare commits
63 Commits
v1.6.0
...
v1.6.1-rc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a8a3855b8 | ||
|
|
603a238eb9 | ||
|
|
b7b6cf4b3f | ||
|
|
c855b783d9 | ||
|
|
f593fc8e4d | ||
|
|
ae5cbb8451 | ||
|
|
041066a252 | ||
|
|
9ca82ba14d | ||
|
|
b29a757b18 | ||
|
|
485a6926c5 | ||
|
|
f3de6f46db | ||
|
|
1309dc27d9 | ||
|
|
31469d6a3e | ||
|
|
88776770f7 | ||
|
|
bbf8b9f8dd | ||
|
|
6ff38d8005 | ||
|
|
6d13b5cc43 | ||
|
|
73ab2804c4 | ||
|
|
db3d2eed5f | ||
|
|
d995d1190f | ||
|
|
3217e42a0f | ||
|
|
1dd58a537e | ||
|
|
b34afa1afc | ||
|
|
b7c9fa6d5f | ||
|
|
61ad376bf4 | ||
|
|
407b3bebfe | ||
|
|
f04c80dd0e | ||
|
|
1e788d3d60 | ||
|
|
83171bf025 | ||
|
|
2e51721851 | ||
|
|
4d4a0148e4 | ||
|
|
b144a5bbf9 | ||
|
|
5225fe07e0 | ||
|
|
85cdbd1f1d | ||
|
|
e4f8a136f1 | ||
|
|
c263c38cdf | ||
|
|
df8553e878 | ||
|
|
bec66c85d4 | ||
|
|
f9710cc1d5 | ||
|
|
6b041b0846 | ||
|
|
d0c992c991 | ||
|
|
9ee86cf06b | ||
|
|
646eafb05d | ||
|
|
0880444e37 | ||
|
|
0a953b91f9 | ||
|
|
b71881d300 | ||
|
|
b91967f4d9 | ||
|
|
2d234cd96f | ||
|
|
1230e87330 | ||
|
|
b2966fecc7 | ||
|
|
4abe00ff6c | ||
|
|
e1db834ec9 | ||
|
|
c72c72a106 | ||
|
|
4a5ef8f173 | ||
|
|
ed26bcb3e7 | ||
|
|
b814b45e50 | ||
|
|
ded8914df2 | ||
|
|
7a7b0e8939 | ||
|
|
a4f6370774 | ||
|
|
6605a89990 | ||
|
|
6e10b8c5c4 | ||
|
|
24616bead4 | ||
|
|
13f9970257 |
@@ -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 )
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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). */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
2
src/3rdparty/fancylineedit/fancylineedit.cpp
vendored
2
src/3rdparty/fancylineedit/fancylineedit.cpp
vendored
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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*);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -200,7 +200,6 @@ private:
|
||||
QString _remotePath;
|
||||
QString _alias;
|
||||
QString _configFile;
|
||||
QFileSystemWatcher *_pathWatcher;
|
||||
bool _enabled;
|
||||
SyncResult _syncResult;
|
||||
QScopedPointer<SyncEngine> _engine;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
ownCloudTheme::ownCloudTheme()
|
||||
ownCloudTheme::ownCloudTheme() :
|
||||
Theme()
|
||||
{
|
||||
// qDebug() << " ** running ownCloud theme!";
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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."));
|
||||
|
||||
@@ -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()));
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ public:
|
||||
|
||||
protected:
|
||||
QIcon themeIcon(const QString& name, bool sysTray = false) const;
|
||||
Theme() {}
|
||||
Theme();
|
||||
|
||||
signals:
|
||||
void systrayUseMonoIconsChanged(bool);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -35,6 +35,8 @@ OwncloudSetupPage::OwncloudSetupPage()
|
||||
_ocUser(),
|
||||
_authTypeKnown(false),
|
||||
_checking(false),
|
||||
_configExists(false),
|
||||
_multipleFoldersExist(false),
|
||||
_authType(WizardCommon::HttpCreds),
|
||||
_progressIndi(new QProgressIndicator (this))
|
||||
{
|
||||
|
||||
@@ -73,7 +73,6 @@ private:
|
||||
WizardCommon::AuthType _authType;
|
||||
|
||||
QProgressIndicator* _progressIndi;
|
||||
QButtonGroup* _selectiveSyncButtons;
|
||||
QString _remoteFolder;
|
||||
};
|
||||
|
||||
|
||||
@@ -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()));
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace Mirall
|
||||
|
||||
OwncloudWizard::OwncloudWizard(QWidget *parent)
|
||||
: QWizard(parent),
|
||||
_account(0),
|
||||
_setupPage(new OwncloudSetupPage),
|
||||
_httpCredsPage(new OwncloudHttpCredsPage),
|
||||
_shibbolethCredsPage(new OwncloudShibbolethCredsPage),
|
||||
|
||||
Reference in New Issue
Block a user