[Pkg-owncloud-commits] [owncloud-client] 46/498: Add a basic random Account::id()

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:48:33 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 abfdc574d4631a24f16048eb19059e4455c54176
Author: Christian Kamm <kamm at incasoftware.de>
Date:   Thu Apr 23 14:57:36 2015 +0200

    Add a basic random Account::id()
---
 src/libsync/account.cpp | 7 +++++++
 src/libsync/account.h   | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp
index b64f84b..e6dd5c2 100644
--- a/src/libsync/account.cpp
+++ b/src/libsync/account.cpp
@@ -32,6 +32,7 @@
 #include <QDir>
 #include <QDebug>
 #include <QSslKey>
+#include <QUuid>
 
 namespace OCC {
 
@@ -45,6 +46,7 @@ Account::Account(QObject *parent)
     , _wasMigrated(false)
 {
     qRegisterMetaType<AccountPtr>("AccountPtr");
+    _id = QUuid::createUuid().toString();
 }
 
 AccountPtr Account::create()
@@ -77,6 +79,11 @@ QString Account::displayName() const
     return tr("%1@%2").arg(user, _url.host());
 }
 
+QString Account::id() const
+{
+    return _id;
+}
+
 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 c26ddda..49fa737 100644
--- a/src/libsync/account.h
+++ b/src/libsync/account.h
@@ -65,6 +65,9 @@ public:
     /// The name of the account as shown in the toolbar
     QString displayName() const;
 
+    /// The internal id of the account.
+    QString id() const;
+
     /**
      * @brief Checks the Account instance is different from \param other
      *
@@ -150,6 +153,7 @@ private:
     Account(QObject *parent = 0);
 
     QWeakPointer<Account> _sharedThis;
+    QString _id;
     QMap<QString, QVariant> _settingsMap;
     QUrl _url;
     QList<QSslCertificate> _approvedCerts;

-- 
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