Merge remote-tracking branch 'origin/1.6' into 'il'

This commit is contained in:
Olivier Goffart 2014-06-16 16:41:48 +02:00
commit 2f361278d2
10 changed files with 35 additions and 33 deletions

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

@ -65,7 +65,6 @@ ShibbolethWebView::ShibbolethWebView(Account* account, QWidget* parent)
ShibbolethWebView::~ShibbolethWebView()
{
slotLoadFinished();
}
void ShibbolethWebView::onNewCookiesForUrl (const QList<QNetworkCookie>& cookieList, const QUrl& url)

View file

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

View file

@ -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();

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()));

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();
@ -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<Folder*>(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

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

@ -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."));

View file

@ -212,7 +212,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

@ -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()));