From d3ce1bb3464d65722f2dbf82c266af667d356f7a Mon Sep 17 00:00:00 2001 From: ubbo Date: Mon, 29 Sep 2008 17:22:17 +0000 Subject: reorganized constructor of keylist git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@178 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgwin.cpp | 4 +--- keylist.cpp | 15 ++++----------- keylist.h | 4 +--- keymgmt.cpp | 4 +--- release/keydb/pubring.gpg | Bin 1166 -> 10307 bytes 5 files changed, 7 insertions(+), 20 deletions(-) diff --git a/gpgwin.cpp b/gpgwin.cpp index 43d2c87..47ab4dc 100644 --- a/gpgwin.cpp +++ b/gpgwin.cpp @@ -36,9 +36,7 @@ GpgWin::GpgWin() /* the list of Keys available*/ - m_keyList = new KeyList(); - m_keyList->setIconPath(iconPath); - m_keyList->setContext(myCtx); + m_keyList = new KeyList(myCtx, iconPath); /* List of binary Attachments */ /*m_attachments = new Attachments(); diff --git a/keylist.cpp b/keylist.cpp index 395ae8f..b4ef294 100644 --- a/keylist.cpp +++ b/keylist.cpp @@ -21,9 +21,12 @@ #include "keylist.h" -KeyList::KeyList(QWidget *parent) +KeyList::KeyList(GpgME::Context* ctx, QString iconpath, QWidget *parent) : QWidget(parent) { + m_ctx = ctx; + this->iconPath = iconpath; + m_keyList = new QTableWidget(this); m_keyList->setColumnCount(5); m_keyList->verticalHeader()->hide(); @@ -54,19 +57,9 @@ KeyList::KeyList(QWidget *parent) popupMenu = new QMenu(this); -} - -void KeyList::setContext(GpgME::Context *ctx) -{ - m_ctx = ctx; refresh(); } -void KeyList::setIconPath(QString path) -{ - this->iconPath = path; -} - void KeyList::refresh() { // while filling the table, sort enabled causes errors diff --git a/keylist.h b/keylist.h index 2d39011..1398a7a 100644 --- a/keylist.h +++ b/keylist.h @@ -39,13 +39,11 @@ class KeyList : public QWidget Q_OBJECT public: - void setContext(GpgME::Context *ctx); - void setIconPath(QString iconPath); void refresh(); void setColumnWidth(int row, int size); void addMenuAction(QAction *act); - KeyList(QWidget *parent = 0); + KeyList(GpgME::Context* ctx, QString iconpath, QWidget *parent = 0); QList *getChecked(); QList *getSelected(); diff --git a/keymgmt.cpp b/keymgmt.cpp index d666bf1..cac5912 100755 --- a/keymgmt.cpp +++ b/keymgmt.cpp @@ -31,9 +31,7 @@ KeyMgmt::KeyMgmt(GpgME::Context *ctx, QString iconpath) resize(640, 400); /* the list of Keys available*/ - m_keyList = new KeyList(); - m_keyList->setIconPath(mIconPath); - m_keyList->setContext(mCtx); + m_keyList = new KeyList(mCtx, mIconPath); m_keyList->setColumnWidth(2,250); m_keyList->setColumnWidth(3,250); setCentralWidget(m_keyList); diff --git a/release/keydb/pubring.gpg b/release/keydb/pubring.gpg index acb4872..e2f85b4 100644 Binary files a/release/keydb/pubring.gpg and b/release/keydb/pubring.gpg differ -- cgit v1.2.3