diff --git a/csync/config_csync.h.cmake b/csync/config_csync.h.cmake index bce3abd0b..8c48c4e15 100644 --- a/csync/config_csync.h.cmake +++ b/csync/config_csync.h.cmake @@ -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 diff --git a/src/creds/shibboleth/shibbolethwebview.cpp b/src/creds/shibboleth/shibbolethwebview.cpp index f4948b04d..c641d22c8 100644 --- a/src/creds/shibboleth/shibbolethwebview.cpp +++ b/src/creds/shibboleth/shibbolethwebview.cpp @@ -65,7 +65,6 @@ ShibbolethWebView::ShibbolethWebView(Account* account, QWidget* parent) ShibbolethWebView::~ShibbolethWebView() { - slotLoadFinished(); } void ShibbolethWebView::onNewCookiesForUrl (const QList& cookieList, const QUrl& url) diff --git a/src/creds/shibboleth/shibbolethwebview.h b/src/creds/shibboleth/shibbolethwebview.h index c002e7e04..1999dfde9 100644 --- a/src/creds/shibboleth/shibbolethwebview.h +++ b/src/creds/shibboleth/shibbolethwebview.h @@ -46,7 +46,7 @@ Q_SIGNALS: private Q_SLOTS: void onNewCookiesForUrl(const QList& cookieList, const QUrl& url); void slotLoadStarted(); - void slotLoadFinished(bool success = true); + void slotLoadFinished(bool success); void slotHandleAuthentication(QNetworkReply*,QAuthenticator*); protected: diff --git a/src/creds/shibbolethcredentials.cpp b/src/creds/shibbolethcredentials.cpp index 55aabc093..6c01efc53 100644 --- a/src/creds/shibbolethcredentials.cpp +++ b/src/creds/shibbolethcredentials.cpp @@ -352,7 +352,7 @@ void ShibbolethCredentials::showLoginWindow(Account* account) } _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(); diff --git a/src/mirall/accountsettings.cpp b/src/mirall/accountsettings.cpp index c3793b076..5200d0204 100644 --- a/src/mirall/accountsettings.cpp +++ b/src/mirall/accountsettings.cpp @@ -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())); diff --git a/src/mirall/folderwizard.cpp b/src/mirall/folderwizard.cpp index ec617aa5c..d11100dc5 100644 --- a/src/mirall/folderwizard.cpp +++ b/src/mirall/folderwizard.cpp @@ -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(); @@ -374,7 +374,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(i.value()); @@ -448,13 +448,6 @@ FolderWizard::~FolderWizard() { } -void FolderWizard::setFolderMap( const Folder::Map& fm) -{ - _folderWizardSourcePage->setFolderMap( fm ); - if (!Theme::instance()->singleSyncFolder()) { - _folderWizardTargetPage->setFolderMap( fm ); - } -} } // end namespace diff --git a/src/mirall/folderwizard.h b/src/mirall/folderwizard.h index 52789e028..658524f69 100644 --- a/src/mirall/folderwizard.h +++ b/src/mirall/folderwizard.h @@ -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: diff --git a/src/mirall/propagator_qnam.cpp b/src/mirall/propagator_qnam.cpp index 177c36e9c..d9ea8ed13 100644 --- a/src/mirall/propagator_qnam.cpp +++ b/src/mirall/propagator_qnam.cpp @@ -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,25 @@ 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 { + delete device; + + qDebug() << "ERR: Could not open upload file: " << device->errorString(); + done( SyncFileItem::NormalError, device->errorString() ); + return; + } } void PropagateUploadFileQNAM::slotPutFinished() @@ -270,9 +281,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.")); diff --git a/src/mirall/theme.cpp b/src/mirall/theme.cpp index 713e07cec..8628508cb 100644 --- a/src/mirall/theme.cpp +++ b/src/mirall/theme.cpp @@ -212,7 +212,7 @@ QString Theme::about() const "

Distributed by %4 and licensed under the GNU General Public License (GPL) Version 2.0.
" "%5 and the %5 logo are registered trademarks of %4 in the
" "United States, other countries, or both.

") - .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); } diff --git a/src/wizard/owncloudshibbolethcredspage.cpp b/src/wizard/owncloudshibbolethcredspage.cpp index 42b84ea7f..40053d69b 100644 --- a/src/wizard/owncloudshibbolethcredspage.cpp +++ b/src/wizard/owncloudshibbolethcredspage.cpp @@ -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()));