diff options
-rw-r--r-- | modules/mux_qt/modinfo.txt | 1 | ||||
-rw-r--r-- | modules/mux_qt/mux_qt.cpp | 44 | ||||
-rw-r--r-- | modules/mux_qt/mux_qt.h | 13 | ||||
-rw-r--r-- | modules/mux_qt/types.h | 28 |
4 files changed, 17 insertions, 69 deletions
diff --git a/modules/mux_qt/modinfo.txt b/modules/mux_qt/modinfo.txt index ee91ef735..6a6f70e5b 100644 --- a/modules/mux_qt/modinfo.txt +++ b/modules/mux_qt/modinfo.txt @@ -8,7 +8,6 @@ replace_file types.h uses_external_libs -replace_file types.h add_file mux_qt.cpp add_file mux_qt.h diff --git a/modules/mux_qt/mux_qt.cpp b/modules/mux_qt/mux_qt.cpp index 0d419d38a..e5c6d96ff 100644 --- a/modules/mux_qt/mux_qt.cpp +++ b/modules/mux_qt/mux_qt.cpp @@ -4,7 +4,6 @@ *************************************************/ #include <botan/mux_qt.h> -#include <botan/exceptn.h> #include <qmutex.h> #if !defined(QT_THREAD_SUPPORT) @@ -13,44 +12,29 @@ namespace Botan { -/************************************************* -* Wrapper Type for Qt Thread Mutex * -*************************************************/ -struct mutex_wrapper - { - QMutex m; - }; - -/************************************************* -* Constructor * -*************************************************/ -Qt_Mutex::Qt_Mutex() - { - mutex = new mutex_wrapper; - } +namespace { /************************************************* -* Destructor * +* Qt Mutex * *************************************************/ -Qt_Mutex::~Qt_Mutex() +class Qt_Mutex : public Mutex { - delete mutex; - } + public: + void lock() { mutex.lock(); } + void unlock() { mutex.unlock(); } + private: + QMutex mutex; + }; -/************************************************* -* Lock the Mutex * -*************************************************/ -void Qt_Mutex::lock() - { - mutex->m.lock(); - } +} /************************************************* -* Unlock the Mutex * +* Qt Mutex Factory * *************************************************/ -void Qt_Mutex::unlock() +Mutex* Qt_Mutex_Factory::make() { - mutex->m.unlock(); + return new Qt_Mutex(); } } + diff --git a/modules/mux_qt/mux_qt.h b/modules/mux_qt/mux_qt.h index 1535b3d36..5eb6f4987 100644 --- a/modules/mux_qt/mux_qt.h +++ b/modules/mux_qt/mux_qt.h @@ -1,5 +1,5 @@ /************************************************* -* Qt Thread Mutex Header File * +* Qt Mutex Header File * * (C) 1999-2006 The Botan Project * *************************************************/ @@ -13,17 +13,10 @@ namespace Botan { /************************************************* * Qt Mutex * *************************************************/ -class Qt_Mutex : public Mutex +class Qt_Mutex_Factory : public Mutex_Factory { public: - void lock(); - void unlock(); - Mutex* clone() const { return new Qt_Mutex; } - - Qt_Mutex(); - ~Qt_Mutex(); - private: - struct mutex_wrapper* mutex; + Mutex* make(); }; } diff --git a/modules/mux_qt/types.h b/modules/mux_qt/types.h deleted file mode 100644 index 9f1b40666..000000000 --- a/modules/mux_qt/types.h +++ /dev/null @@ -1,28 +0,0 @@ -/************************************************* -* Low Level Types Header File * -* (C) 1999-2006 The Botan Project * -*************************************************/ - -#ifndef BOTAN_TYPES_H__ -#define BOTAN_TYPES_H__ - -#include <qglobal.h> - -namespace Botan { - -typedef Q_UINT8 byte; -typedef Q_UINT16 u16bit; -typedef Q_UINT32 u32bit; -typedef Q_UINT64 u64bit; - -typedef Q_INT32 s32bit; -} - -namespace Botan_types { - -typedef Botan::byte byte; -typedef Botan::u32bit u32bit; - -} - -#endif |