[Pkg-owncloud-commits] [qtkeychain] 01/115: Initial
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat Mar 15 19:25:41 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository qtkeychain.
commit 6ce1ec1d66cf657a62d40a623eb71a796499a5fa
Author: Frank Osterfeld <frank.osterfeld at kdab.com>
Date: Thu Oct 27 18:14:37 2011 +0200
Initial
---
keychain.cpp | 34 ++++++++++++++++++++++++++++++++++
keychain.h | 35 +++++++++++++++++++++++++++++++++++
keychain_mac.cpp | 10 ++++++++++
keychain_p.h | 16 ++++++++++++++++
keychain_win.cpp | 10 ++++++++++
qtkeychain.pro | 17 +++++++++++++++++
6 files changed, 122 insertions(+)
diff --git a/keychain.cpp b/keychain.cpp
new file mode 100644
index 0000000..db6ed8a
--- /dev/null
+++ b/keychain.cpp
@@ -0,0 +1,34 @@
+#include "keychain.h"
+#include "keychain_p.h"
+
+KeychainException::KeychainException( const QString& message )
+ : std::runtime_error( message.toStdString() )
+ , m_message( message )
+{}
+
+KeychainException::~KeychainException() throw() {
+}
+
+QString KeychainException::message() const {
+ return m_message;
+}
+
+Keychain::Keychain( const QString& service )
+ : d( new Private( service ) )
+{
+}
+
+QString Keychain::service() const
+{
+ return d->service;
+}
+
+void Keychain::writePassword( const QString& account, const QString& password )
+{
+ d->writePasswordImpl( account, password );
+}
+
+QString Keychain::readPassword( const QString& account ) const
+{
+ return d->readPasswordImpl( account );
+}
diff --git a/keychain.h b/keychain.h
new file mode 100644
index 0000000..52ee1de
--- /dev/null
+++ b/keychain.h
@@ -0,0 +1,35 @@
+#ifndef KEYCHAIN_H
+#define KEYCHAIN_H
+
+#include <QString>
+
+#include <stdexcept>
+
+class KeychainException : public std::runtime_error {
+public:
+ explicit KeychainException( const QString& message );
+ ~KeychainException() throw();
+ QString message() const;
+
+private:
+ QString m_message;
+};
+
+class Keychain {
+public:
+ explicit Keychain( const QString& service );
+ ~Keychain();
+
+ QString service() const;
+
+ void writePassword( const QString& account, const QString& password );
+ QString readPassword( const QString& account ) const;
+
+private:
+ class Private;
+ Private* const d;
+ Q_DISABLE_COPY(Keychain)
+};
+
+#endif
+
diff --git a/keychain_mac.cpp b/keychain_mac.cpp
new file mode 100644
index 0000000..b3a3722
--- /dev/null
+++ b/keychain_mac.cpp
@@ -0,0 +1,10 @@
+#include "keychain_p.h"
+
+QString Keychain::Private::readPasswordImpl( const QString& account ) const {
+ throw KeychainException( QLatin1String("not implemented") );
+}
+
+void Keychain::Private::writePasswordImpl( const QString& account, const QString& password ) {
+ throw KeychainException( QLatin1String("not implemented") );
+}
+
diff --git a/keychain_p.h b/keychain_p.h
new file mode 100644
index 0000000..ab181af
--- /dev/null
+++ b/keychain_p.h
@@ -0,0 +1,16 @@
+#ifndef KEYCHAIN_P_H
+#define KEYCHAIN_P_H
+
+#include "keychain.h"
+
+class Keychain::Private {
+public:
+ explicit Private( const QString& s ) : service( s ) {}
+
+ void writePasswordImpl( const QString& account, const QString& password );
+ QString readPasswordImpl( const QString& account ) const;
+
+ const QString service;
+};
+
+#endif // KEYCHAIN_P_H
diff --git a/keychain_win.cpp b/keychain_win.cpp
new file mode 100644
index 0000000..b3a3722
--- /dev/null
+++ b/keychain_win.cpp
@@ -0,0 +1,10 @@
+#include "keychain_p.h"
+
+QString Keychain::Private::readPasswordImpl( const QString& account ) const {
+ throw KeychainException( QLatin1String("not implemented") );
+}
+
+void Keychain::Private::writePasswordImpl( const QString& account, const QString& password ) {
+ throw KeychainException( QLatin1String("not implemented") );
+}
+
diff --git a/qtkeychain.pro b/qtkeychain.pro
new file mode 100644
index 0000000..a2a1c12
--- /dev/null
+++ b/qtkeychain.pro
@@ -0,0 +1,17 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Thu Oct 27 17:55:20 2011
+######################################################################
+
+TEMPLATE = lib
+TARGET = qtkeychain
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+HEADERS += keychain.h \
+ keychain_p.h
+SOURCES += keychain.cpp
+
+macx:SOURCES += keychain_mac.cpp
+win32:SOURCES += keychain_win.cpp
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/qtkeychain.git
More information about the Pkg-owncloud-commits
mailing list