summaryrefslogtreecommitdiffstats
path: root/libkgpgfile/kgpgfile.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
commitfecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch)
tree6b8614802f0d01b353bc9ba78aff2090846c198e /libkgpgfile/kgpgfile.h
parentdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff)
downloadkmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz
kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkgpgfile/kgpgfile.h')
-rw-r--r--libkgpgfile/kgpgfile.h79
1 files changed, 46 insertions, 33 deletions
diff --git a/libkgpgfile/kgpgfile.h b/libkgpgfile/kgpgfile.h
index ba5c7d2..08b6853 100644
--- a/libkgpgfile/kgpgfile.h
+++ b/libkgpgfile/kgpgfile.h
@@ -18,10 +18,14 @@
#ifndef KGPGFILE_H
#define KGPGFILE_H
-#include <qfile.h>
-#include <qobject.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqfile.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+
+#ifdef Q_MOC_RUN
+#define USE_QT4
+#endif // Q_MOC_RUN
/**
* @author Thomas Baumgart
@@ -34,14 +38,14 @@ class KProcess;
* A class for reading and writing data to/from an
* encrypted e.g. file.
*
- * This class presents a QFile based object to the application
+ * This class presents a TQFile based object to the application
* but reads/writes data from/to the file through an instance of GPG.
*
* @code
*
* +------------------+ write +-----------+ stdin +-------+ +--------+
* | |--------->|\ |---------->| |---->| |
- * | Application code | read | QFile | stdout | GPG | | File |
+ * | Application code | read | TQFile | stdout | GPG | | File |
* | |<---------|/ |<----------| |<----| |
* +------------------+ | KGPGFile | +-------+ +--------+
* | control| |
@@ -55,14 +59,19 @@ class KProcess;
* GPGAvailable(). Other, more general methods such as open(), close() and flush() are
* not shown in the above picture.
*/
-class KGPGFile : public QObject, public QFile
+#ifdef USE_QT4
+class KGPGFile : public TQFile
+#else // USE_QT4
+class KGPGFile : public TQObject, public TQFile
+#endif // USE_QT4
{
Q_OBJECT
+ TQ_OBJECT
public:
- KGPGFile(const QString& fname = "",
- const QString& homedir = "~/.gnupg",
- const QString& options = "");
+ KGPGFile(const TQString& fname = "",
+ const TQString& homedir = "~/.gnupg",
+ const TQString& options = "");
~KGPGFile();
@@ -70,11 +79,15 @@ public:
virtual void close(void);
virtual void flush(void);
+#ifdef USE_QT4
+ virtual qint64 size(void) const { return 0; };
+#else // USE_QT4
virtual Offset size(void) const { return 0; };
+#endif // USE_QT4
- virtual Q_LONG readBlock(char *data, Q_ULONG maxlen);
- virtual Q_LONG writeBlock(const char *data, Q_ULONG maxlen);
- virtual QByteArray readAll(void);
+ virtual TQ_LONG readBlock(char *data, TQ_ULONG maxlen);
+ virtual TQ_LONG writeBlock(const char *data, TQ_ULONG maxlen);
+ virtual TQByteArray readAll(void);
virtual int getch(void);
virtual int putch(int c);
@@ -89,16 +102,16 @@ public:
*
* @param recipient recipients identification (e.g. e-mail address)
*/
- void addRecipient(const QCString& recipient);
+ void addRecipient(const TQCString& recipient);
/**
* sets the name of the file to @p fn. This method must be
* called prior to open().
*/
- void setName(const QString& fn);
- void setComment(const QString& txt);
+ void setName(const TQString& fn);
+ void setComment(const TQString& txt);
- const QCString errmsg(void) const { return m_errmsg; };
+ const TQCString errmsg(void) const { return m_errmsg; };
int exitStatus(void) const { return m_exitStatus; };
/**
@@ -118,7 +131,7 @@ public:
* @retval true key for user-id @p name was found
* @retval false key for user-id @p not available
*/
- static bool keyAvailable(const QString& name);
+ static bool keyAvailable(const TQString& name);
/**
* This function returns a list of the secret keys contained
@@ -131,7 +144,7 @@ public:
*
* "9C59DB40B75DD3BA:Thomas Baumgart <ipwizard@users.sourceforge.net>"
*/
- static void secretKeyList(QStringList& list);
+ static void secretKeyList(TQStringList& list);
/**
* This function returns a list of the public keys contained
@@ -144,7 +157,7 @@ public:
*
* "9C59DB40B75DD3BA:Thomas Baumgart <ipwizard@users.sourceforge.net>"
*/
- static void publicKeyList(QStringList& list, const QString& pattern = QString());
+ static void publicKeyList(TQStringList& list, const TQString& pattern = TQString());
#ifdef KMM_DEBUG
void dumpUngetBuffer(void);
@@ -159,25 +172,25 @@ protected slots:
private:
void init(void);
- bool startProcess(const QStringList& args);
- Q_LONG _writeBlock(const char *data, Q_ULONG maxlen);
- bool open(int mode, const QString&, bool skipPasswd);
+ bool startProcess(const TQStringList& args);
+ TQ_LONG _writeBlock(const char *data, TQ_ULONG maxlen);
+ bool open(int mode, const TQString&, bool skipPasswd);
private:
- QString m_fn;
- QString m_pubring;
- QString m_secring;
- QString m_options;
- QString m_comment;
- QString m_homedir;
+ TQString m_fn;
+ TQString m_pubring;
+ TQString m_secring;
+ TQString m_options;
+ TQString m_comment;
+ TQString m_homedir;
KShellProcess* m_process;
- QValueList<QCString> m_recipient;
- QCString m_ungetchBuffer;
- QCString m_errmsg;
+ TQValueList<TQCString> m_recipient;
+ TQCString m_ungetchBuffer;
+ TQCString m_errmsg;
int m_exitStatus;
- Q_LONG m_readRemain;
+ TQ_LONG m_readRemain;
char* m_ptrRemain;
bool m_needExitLoop;
};