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-10-14 18:11:15 +0400
committerKlaas Freitag <freitag@owncloud.com>2013-10-14 18:11:52 +0400
commitd0d362664be9f9cd2d406163af582b1cffc03712 (patch)
tree192a9e55eae026167dab9816909aaf1db76a2056
parentf841450daea6ef759fe4789c5844288badb5b7da (diff)
Handle proxy on folder level, not folderman level.
-rw-r--r--src/mirall/application.cpp2
-rw-r--r--src/mirall/folder.cpp17
-rw-r--r--src/mirall/folder.h4
-rw-r--r--src/mirall/folderman.cpp11
-rw-r--r--src/mirall/folderman.h3
-rw-r--r--src/mirall/folderwatcher_inotify.cpp11
6 files changed, 40 insertions, 8 deletions
diff --git a/src/mirall/application.cpp b/src/mirall/application.cpp
index 6b0f5ecf9..048663c87 100644
--- a/src/mirall/application.cpp
+++ b/src/mirall/application.cpp
@@ -164,9 +164,9 @@ Application::Application(int &argc, char **argv) :
setupActions();
setupSystemTray();
- slotSetupProxy();
folderMan->setupFolders();
+ slotSetupProxy(); // folders have to be defined first.
// startup procedure.
QTimer::singleShot( 0, this, SLOT( slotCheckConnection() ));
diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp
index e60278802..82cc504ec 100644
--- a/src/mirall/folder.cpp
+++ b/src/mirall/folder.cpp
@@ -54,6 +54,8 @@ Folder::Folder(const QString &alias, const QString &path, const QString& secondP
, _csync(0)
, _csyncError(false)
, _csyncUnavail(false)
+ , _wipeDb(false)
+ , _proxyDirty(true)
, _csync_ctx(0)
{
qsrand(QTime::currentTime().msec());
@@ -501,10 +503,21 @@ void Folder::setProxy()
csync_set_module_property(_csync_ctx, "proxy_user", proxy.user().toUtf8().data() );
csync_set_module_property(_csync_ctx, "proxy_pwd" , proxy.password().toUtf8().data() );
- FolderMan::instance()->setDirtyProxy(false);
+ setProxyDirty(false);
+ } else {
+ qDebug() << "WRN: Unable to set Proxy without csync-ctx!";
}
}
+void Folder::setProxyDirty(bool value)
+{
+ _proxyDirty = value;
+}
+
+bool Folder::proxyDirty()
+{
+ return _proxyDirty;
+}
const char* Folder::proxyTypeToCStr(QNetworkProxy::ProxyType type)
{
@@ -540,7 +553,7 @@ void Folder::startSync(const QStringList &pathList)
QMetaObject::invokeMethod(this, "slotCSyncFinished", Qt::QueuedConnection);
return;
}
- } else if (FolderMan::instance()->isDirtyProxy()) {
+ } else if (proxyDirty()) {
setProxy();
}
diff --git a/src/mirall/folder.h b/src/mirall/folder.h
index d2bc20050..caf4b576c 100644
--- a/src/mirall/folder.h
+++ b/src/mirall/folder.h
@@ -150,6 +150,9 @@ public slots:
*/
void startSync(const QStringList &pathList = QStringList());
+ void setProxyDirty(bool value);
+ bool proxyDirty();
+
private slots:
void slotCSyncStarted();
void slotCSyncError(const QString& );
@@ -202,6 +205,7 @@ protected:
bool _csyncError;
bool _csyncUnavail;
bool _wipeDb;
+ bool _proxyDirty;
Progress::Kind _progressKind;
QTimer _pollTimer;
QString _lastEtag;
diff --git a/src/mirall/folderman.cpp b/src/mirall/folderman.cpp
index 381db8651..caf05ac28 100644
--- a/src/mirall/folderman.cpp
+++ b/src/mirall/folderman.cpp
@@ -37,8 +37,7 @@ FolderMan* FolderMan::_instance = 0;
FolderMan::FolderMan(QObject *parent) :
QObject(parent),
- _syncEnabled( true ),
- _dirtyProxy( true )
+ _syncEnabled( true )
{
// if QDir::mkpath would not be so stupid, I would not need to have this
// duplication of folderConfigPath() here
@@ -521,6 +520,14 @@ bool FolderMan::startFromScratch( const QString& localFolder )
return false;
}
+void FolderMan::setDirtyProxy(bool value)
+{
+ foreach( Folder *f, _folderMap.values() ) {
+ f->setProxyDirty(value);
+ }
+}
+
+
SyncResult FolderMan::accountStatus(const QList<Folder*> &folders)
{
SyncResult overallResult(SyncResult::Undefined);
diff --git a/src/mirall/folderman.h b/src/mirall/folderman.h
index 8051d0c46..7625b18c2 100644
--- a/src/mirall/folderman.h
+++ b/src/mirall/folderman.h
@@ -109,8 +109,7 @@ public slots:
void slotScheduleAllFolders();
- bool isDirtyProxy() { return _dirtyProxy; }
- void setDirtyProxy(bool value = true) { _dirtyProxy = value; }
+ void setDirtyProxy(bool value = true);
private slots:
// slot to add a folder to the syncing queue
diff --git a/src/mirall/folderwatcher_inotify.cpp b/src/mirall/folderwatcher_inotify.cpp
index f650b0fe7..a58fe332e 100644
--- a/src/mirall/folderwatcher_inotify.cpp
+++ b/src/mirall/folderwatcher_inotify.cpp
@@ -132,7 +132,16 @@ void FolderWatcherPrivate::slotINotifyEvent(int mask, int /*cookie*/, const QStr
//qDebug() << cookie << " OTHER " << mask << " :" << path;
}
- foreach (const QString& pattern, _parent->ignores()) {
+ QStringList ignores = _parent->ignores();
+
+ if( path.endsWith(".csync_journal.db.ctmp") ||
+ path.endsWith(".csync_journal.db.ctmp-journal") ||
+ path.endsWith(".csync_journal.db")) {
+ qDebug() << " ** Inotify ignored for " <<path;
+ return;
+ }
+
+ foreach (const QString& pattern, ignores) {
QRegExp regexp(pattern);
regexp.setPatternSyntax(QRegExp::Wildcard);