[Pkg-owncloud-commits] [owncloud-client] 20/103: Fix reconnect after server disconnect
Sandro Knauß
hefee-guest at moszumanska.debian.org
Wed Apr 30 18:08:55 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit d836b8015353c18c733d33b410d36a25c7201acd
Author: Daniel Molkentin <danimo at owncloud.com>
Date: Mon Apr 14 17:51:57 2014 +0200
Fix reconnect after server disconnect
Fixes #1679
Fixes #1568
Fixes #1659
---
src/mirall/owncloudgui.cpp | 6 ++++++
src/mirall/quotainfo.cpp | 27 ++++++++++++---------------
2 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/src/mirall/owncloudgui.cpp b/src/mirall/owncloudgui.cpp
index 8f16dcd..bf6a05b 100644
--- a/src/mirall/owncloudgui.cpp
+++ b/src/mirall/owncloudgui.cpp
@@ -146,6 +146,7 @@ void ownCloudGui::slotOpenPath(const QString &path)
void ownCloudGui::slotAccountStateChanged()
{
setupContextMenu();
+ slotComputeOverallSyncStatus();
}
void ownCloudGui::startupConnected( bool connected, const QStringList& fails )
@@ -171,6 +172,11 @@ void ownCloudGui::slotComputeOverallSyncStatus()
_tray->setToolTip(tr("Please sign in"));
return;
}
+ if (a->state() == Account::Disconnected) {
+ _tray->setIcon(Theme::instance()->syncStateIcon( SyncResult::Unavailable, true));
+ _tray->setToolTip(tr("Disconnected from server"));
+ return;
+ }
}
// display the info of the least successful sync (eg. not just display the result of the latest sync
QString trayMessage;
diff --git a/src/mirall/quotainfo.cpp b/src/mirall/quotainfo.cpp
index ac25083..c1c20b8 100644
--- a/src/mirall/quotainfo.cpp
+++ b/src/mirall/quotainfo.cpp
@@ -52,36 +52,33 @@ void QuotaInfo::slotAccountStateChanged(int state)
switch (state) {
case Account::SignedOut: // fall through
case Account::InvalidCredidential:
- case Account::Disconnected:
_jobRestartTimer->stop();
break;
+ case Account::Disconnected:
case Account::Connected: // fall through
slotCheckQuota();
}
}
+void QuotaInfo::slotCheckQuota()
+{
+ if (!_account.isNull() && _account->credentials()) {
+ CheckQuotaJob *job = new CheckQuotaJob(_account, "/", this);
+ connect(job, SIGNAL(quotaRetrieved(qint64,qint64)), SLOT(slotUpdateLastQuota(qint64,qint64)));
+ connect(job, SIGNAL(networkError(QNetworkReply*)), SLOT(slotRequestFailed()));
+ job->start();
+ }
+}
+
void QuotaInfo::slotRequestFailed()
{
- if (!_account.isNull() && _account->state() == Account::Connected) {
+ if (!_account.isNull() && _account->state() != Account::Disconnected) {
_account->setState(Account::Disconnected);
}
_lastQuotaTotalBytes = 0;
_lastQuotaUsedBytes = 0;
_jobRestartTimer->start(failIntervalT);
-
- _jobRestartTimer->start(failIntervalT);
-}
-
-void QuotaInfo::slotCheckQuota()
-{
- if (!_account.isNull() && _account->state() == Account::Connected
- && _account->credentials() && _account->credentials()->ready()) {
- CheckQuotaJob *job = new CheckQuotaJob(_account, "/", this);
- connect(job, SIGNAL(quotaRetrieved(qint64,qint64)), SLOT(slotUpdateLastQuota(qint64,qint64)));
- connect(job, SIGNAL(networkError(QNetworkReply*)), SLOT(slotRequestFailed()));
- job->start();
- }
}
void QuotaInfo::slotUpdateLastQuota(qint64 total, qint64 used)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list