Fix: Allow to retry sync also for fatal err conditions.

Otherwise there would not  have been a chance to resync for example data
that was Forbidden because of a read only share.

Also removed some commented code.
This commit is contained in:
Klaas Freitag 2013-12-12 11:38:41 +01:00
parent 9ffb33293c
commit 09745c7f75
3 changed files with 3 additions and 41 deletions

View file

@ -491,44 +491,6 @@ void AccountSettings::slotUpdateFolderState( Folder *folder )
}
}
//void AccountSettings::slotOCInfo( const QString& url, const QString& versionStr, const QString& version, const QString& )
//{
//#ifdef Q_OS_WIN
// // work around a bug in QDesktopServices on Win32, see i-net
// QString filePath = url;
// if (filePath.startsWith("\\\\") || filePath.startsWith("//"))
// _OCUrl.setUrl(QDir::toNativeSeparators(filePath));
// else
// _OCUrl = QUrl::fromLocalFile(filePath);
//#else
// _OCUrl = QUrl::fromLocalFile(url);
//#endif
// qDebug() << "#-------# oC found on " << url;
// /* enable the open button */
// ui->connectLabel->setOpenExternalLinks(true);
// QUrl safeUrl(url);
// safeUrl.setPassword(QString()); // Remove the password from the URL to avoid showing it in the UI
// showConnectionLabel( tr("Connected to <a href=\"%1\">%2</a>.").arg(url, safeUrl.toString()),
// tr("Version: %1 (%2)").arg(versionStr).arg(version) );
// ui->_buttonAdd->setEnabled(true);
// disconnect(ownCloudInfo::instance(), SIGNAL(ownCloudInfoFound(const QString&, const QString&, const QString&, const QString&)),
// this, SLOT(slotOCInfo( const QString&, const QString&, const QString&, const QString& )));
// disconnect(ownCloudInfo::instance(), SIGNAL(noOwncloudFound(QNetworkReply*)),
// this, SLOT(slotOCInfoFail(QNetworkReply*)));
//}
//void AccountSettings::slotOCInfoFail( QNetworkReply *reply)
//{
// QString errStr = tr("unknown problem.");
// if( reply ) errStr = reply->errorString();
// showConnectionLabel( tr("<p>Failed to connect to %1: <tt>%2</tt></p>").arg(Theme::instance()->appNameGUI()).arg(errStr) );
// ui->_buttonAdd->setEnabled( false);
//}
void AccountSettings::slotOpenOC()
{
if( _OCUrl.isValid() )

View file

@ -81,7 +81,7 @@ void PropagateItemJob::done(SyncFileItem::Status status, const QString &errorStr
int retries = 0;
if( _item._httpErrorCode == 403 || _item._httpErrorCode == 413 || _item._httpErrorCode == 415 ) {
qDebug() << "Fatal Error condition, disallow retry!";
qDebug() << "Fatal Error condition" << _item._httpErrorCode << ", forbid retry!";
retries = -1;
} else {
retries = 3; // FIXME: good number of allowed retries?

View file

@ -686,7 +686,7 @@ int SyncJournalDb::blackListEntryCount()
QMutexLocker locker(&_mutex);
if( checkConnect() ) {
QSqlQuery query(_db);
if( ! query.exec("SELECT count(*) FROM blacklist WHERE retrycount >= 0") ) {
if( ! query.exec("SELECT count(*) FROM blacklist") ) {
sqlFail("Count number of blacklist entries failed", query);
}
if( query.next() ) {
@ -702,7 +702,7 @@ int SyncJournalDb::wipeBlacklist()
if( checkConnect() ) {
QSqlQuery query(_db);
query.prepare("DELETE FROM blacklist WHERE retrycount >= 0");
query.prepare("DELETE FROM blacklist");
if( ! query.exec() ) {
sqlFail("Deletion of whole blacklist failed", query);