[Pkg-owncloud-commits] [owncloud-client] 44/498: Move AccountState::displayName to Account.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Tue Aug 11 14:48:32 UTC 2015
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 28306e5dfbeb2b08ff63fbbf41e44cbd3bfb2051
Author: Christian Kamm <kamm at incasoftware.de>
Date: Thu Apr 23 14:51:06 2015 +0200
Move AccountState::displayName to Account.
---
src/gui/accountstate.cpp | 7 -------
src/gui/accountstate.h | 3 ---
src/gui/settingsdialog.cpp | 2 +-
src/libsync/account.cpp | 6 ++++++
src/libsync/account.h | 3 +++
5 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp
index 6003467..8904b2c 100644
--- a/src/gui/accountstate.cpp
+++ b/src/gui/accountstate.cpp
@@ -234,12 +234,5 @@ void AccountState::slotCredentialsFetched(AbstractCredentials* credentials)
checkConnectivity();
}
-QString AccountState::displayName()
-{
- auto user = account()->credentials()->user();
- auto url = account()->url();
- return tr("%1@%2").arg(user, url.host());
-}
-
} // namespace OCC
diff --git a/src/gui/accountstate.h b/src/gui/accountstate.h
index 2dae899..9175750 100644
--- a/src/gui/accountstate.h
+++ b/src/gui/accountstate.h
@@ -85,9 +85,6 @@ public:
/// connection status and errors.
void checkConnectivity();
- // The name of the account as shown in the toolbar
- QString displayName();
-
private:
void setState(State state);
diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp
index 93b20f8..b7c4660 100644
--- a/src/gui/settingsdialog.cpp
+++ b/src/gui/settingsdialog.cpp
@@ -159,7 +159,7 @@ void SettingsDialog::accountAdded(AccountState *s)
QIcon accountIcon(QLatin1String(":/client/resources/account.png"));
auto toolBar = qobject_cast<QToolBar*>(layout()->menuBar());
Q_ASSERT(toolBar);
- auto accountAction = new QAction(accountIcon, s->displayName(), this);
+ auto accountAction = new QAction(accountIcon, s->account()->displayName(), this);
toolBar->insertAction(toolBar->actions().at(0), accountAction);
accountAction->setCheckable(true);
auto accountSettings = new AccountSettings(s, this);
diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp
index 95df477..b64f84b 100644
--- a/src/libsync/account.cpp
+++ b/src/libsync/account.cpp
@@ -71,6 +71,12 @@ AccountPtr Account::sharedFromThis()
}
+QString Account::displayName() const
+{
+ auto user = _credentials->user();
+ return tr("%1@%2").arg(user, _url.host());
+}
+
static bool isEqualExceptProtocol(const QUrl &url1, const QUrl &url2)
{
return (url1.host() != url2.host() ||
diff --git a/src/libsync/account.h b/src/libsync/account.h
index d4cec26..c26ddda 100644
--- a/src/libsync/account.h
+++ b/src/libsync/account.h
@@ -62,6 +62,9 @@ public:
void setSharedThis(AccountPtr sharedThis);
AccountPtr sharedFromThis();
+ /// The name of the account as shown in the toolbar
+ QString displayName() const;
+
/**
* @brief Checks the Account instance is different from \param other
*
--
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