summaryrefslogtreecommitdiffstats
path: root/knode/knconvert.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /knode/knconvert.h
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knode/knconvert.h')
-rw-r--r--knode/knconvert.h126
1 files changed, 126 insertions, 0 deletions
diff --git a/knode/knconvert.h b/knode/knconvert.h
new file mode 100644
index 000000000..c75e0da00
--- /dev/null
+++ b/knode/knconvert.h
@@ -0,0 +1,126 @@
+/*
+ KNode, the KDE newsreader
+ Copyright (c) 1999-2005 the KNode authors.
+ See file AUTHORS for details
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
+*/
+
+#ifndef KNCONVERT_H
+#define KNCONVERT_H
+
+#include <time.h>
+
+#include <qdialog.h>
+
+#include <qglobal.h>
+#include <qvaluelist.h>
+#include <kdepimmacros.h>
+
+class QListBox;
+class QLabel;
+class QWidgetStack;
+class QCheckBox;
+
+class KLineEdit;
+class KProcess;
+
+
+class KDE_EXPORT KNConvert : public QDialog {
+
+ Q_OBJECT
+
+ public:
+ static bool needToConvert(const QString &oldVersion);
+
+ KNConvert(const QString &version);
+ ~KNConvert();
+ bool conversionDone()const { return c_onversionDone; }
+
+
+ protected:
+
+ //------------ <Converter-classes> ---------------
+
+ //Base class for all converters
+ class Converter {
+
+ public:
+ Converter(QStringList *log) { l_og=log; }
+ virtual ~Converter() {}
+ virtual bool doConvert()=0;
+
+ protected:
+ QStringList *l_og;
+ };
+
+
+ //Converter for version 0.4
+ class Converter04 : public Converter {
+
+ public:
+ Converter04(QStringList *log) : Converter(log) {}
+ ~Converter04() {}
+ bool doConvert();
+
+ protected:
+ int convertFolder(QString srcPrefix, QString dstPrefix);
+
+ struct OldFolderIndex {
+ int id,
+ status,
+ so,
+ eo,
+ sId;
+ time_t ti;
+ };
+
+ struct NewFolderIndex {
+ int id,
+ so,
+ eo,
+ sId;
+ time_t ti;
+ bool flags[6];
+ };
+ };
+
+ //------------ </Converter-classes> --------------
+
+ QWidgetStack *s_tack;
+ QWidget *w_1,
+ *w_3;
+ QCheckBox *c_reateBkup;
+ QLabel *b_ackupPathLabel,
+ *w_2,
+ *r_esultLabel;
+ KLineEdit *b_ackupPath;
+ QPushButton *b_rowseBtn,
+ *s_tartBtn,
+ *c_ancelBtn;
+ QListBox *l_ogList;
+
+ QValueList<Converter*> mConverters;
+ QStringList l_og;
+ bool c_onversionDone;
+ QString v_ersion;
+ KProcess *t_ar;
+
+ void convert();
+
+ protected slots:
+ void slotStart();
+ void slotCreateBkupToggled(bool b);
+ void slotBrowse();
+ void slotTarExited(KProcess *proc);
+
+};
+
+
+#endif // KNCONVERT_H