Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaas Freitag <freitag@owncloud.com>2013-12-03 17:47:32 +0400
committerKlaas Freitag <freitag@owncloud.com>2013-12-03 17:48:49 +0400
commit278e76b774dc6e6e7bc4ed06d9aef4d2f4371be6 (patch)
treec5d31d8added9393d6a9652bd6edee0b74f410b9
parent09d850bfaaabdb03c47b115ca1b3e90fbb0d1f0d (diff)
Add blackListEntryCount method.
-rw-r--r--src/mirall/folder.cpp5
-rw-r--r--src/mirall/folder.h1
-rw-r--r--src/mirall/syncjournaldb.cpp18
-rw-r--r--src/mirall/syncjournaldb.h2
4 files changed, 26 insertions, 0 deletions
diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp
index 7b64b1d1a..715922d40 100644
--- a/src/mirall/folder.cpp
+++ b/src/mirall/folder.cpp
@@ -416,6 +416,11 @@ void Folder::createGuiLog( const QString& filename, const QString& verb, int cou
}
}
+int Folder::blackListEntryCount()
+{
+ return _journal.blackListEntryCount();
+}
+
int Folder::slotWipeBlacklist()
{
return _journal.wipeBlacklist();
diff --git a/src/mirall/folder.h b/src/mirall/folder.h
index 769a145fb..72eaab192 100644
--- a/src/mirall/folder.h
+++ b/src/mirall/folder.h
@@ -168,6 +168,7 @@ public slots:
bool proxyDirty();
int slotWipeBlacklist();
+ int blackListEntryCount();
private slots:
void slotCSyncStarted();
diff --git a/src/mirall/syncjournaldb.cpp b/src/mirall/syncjournaldb.cpp
index cd779b403..2b9558e85 100644
--- a/src/mirall/syncjournaldb.cpp
+++ b/src/mirall/syncjournaldb.cpp
@@ -677,6 +677,23 @@ SyncJournalBlacklistRecord SyncJournalDb::blacklistEntry( const QString& file )
return entry;
}
+int SyncJournalDb::blackListEntryCount()
+{
+ int re = 0;
+
+ QMutexLocker locker(&_mutex);
+ if( checkConnect() ) {
+ QSqlQuery query(_db);
+ if( ! query.exec("SELECT count(*) FROM blacklist WHERE retrycount >= 0") ) {
+ sqlFail("Count number of blacklist entries failed", query);
+ }
+ if( query.next() ) {
+ re = query.value(0).toInt();
+ }
+ }
+ return re;
+}
+
int SyncJournalDb::wipeBlacklist()
{
QMutexLocker locker(&_mutex);
@@ -687,6 +704,7 @@ int SyncJournalDb::wipeBlacklist()
if( ! query.exec() ) {
sqlFail("Deletion of whole blacklist failed", query);
+ return -1;
}
return query.numRowsAffected();
}
diff --git a/src/mirall/syncjournaldb.h b/src/mirall/syncjournaldb.h
index fffb2247d..35d255a41 100644
--- a/src/mirall/syncjournaldb.h
+++ b/src/mirall/syncjournaldb.h
@@ -36,9 +36,11 @@ public:
bool deleteFileRecord( const QString& filename, bool recursively = false );
int getFileRecordCount();
bool exists();
+
void updateBlacklistEntry( const SyncJournalBlacklistRecord& item );
void wipeBlacklistEntry(const QString& file);
int wipeBlacklist();
+ int blackListEntryCount();
struct DownloadInfo {
DownloadInfo() : _errorCount(0), _valid(false) {}