-rw-r--r-- | pwmanager/pwmanager/csv.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/pwmanager/pwmanager/csv.cpp b/pwmanager/pwmanager/csv.cpp index 194edf2..226cc08 100644 --- a/pwmanager/pwmanager/csv.cpp +++ b/pwmanager/pwmanager/csv.cpp @@ -24,4 +24,6 @@ #include <kmessagebox.h> #include <klocale.h> +//Added by qt3to4: +#include <Q3CString> #define MAX_CSV_FILE_SIZE (50 * 1024 * 1024) // bytes @@ -43,5 +45,5 @@ bool Csv::importData(const QString &filepath, QByteArray d; QFile f(filepath); - if (!f.open(IO_ReadOnly)) { + if (!f.open(QIODevice::ReadOnly)) { KMessageBox::error(parent, i18n("Could not open file.\n" @@ -90,5 +92,5 @@ bool Csv::doImport(const QByteArray &d, int refIndex = 0; int ret; - QCString s, curCat; + Q3CString s, curCat; int fieldIndex = 0; bool inRecord = false; @@ -122,25 +124,25 @@ bool Csv::doImport(const QByteArray &d, break; case 1: // desc - di.desc = s; + di.desc = std::string(s); ++fieldIndex; break; case 2: // name - di.name = s; + di.name = std::string(s); ++fieldIndex; break; case 3: // pw - di.pw = s; + di.pw = std::string(s); ++fieldIndex; break; case 4: // url - di.url = s; + di.url = std::string(s); ++fieldIndex; break; case 5: // launcher - di.launcher = s; + di.launcher = std::string(s); ++fieldIndex; break; case 6: // comment - di.comment = s; + di.comment = std::string(s); ++fieldIndex; break; @@ -155,5 +157,5 @@ bool Csv::doImport(const QByteArray &d, // record complete. if (fieldIndex == 6) - di.comment = s; + di.comment = std::string(s); inRecord = false; fieldIndex = 0; @@ -176,5 +178,5 @@ bool Csv::doImport(const QByteArray &d, } -int Csv::nextField(QCString *ret, +int Csv::nextField(Q3CString *ret, const QByteArray &in, bool inRecord, @@ -354,5 +356,5 @@ bool Csv::exportData(const QString &filepath, } QFile f(filepath); - if (!f.open(IO_ReadWrite)) { + if (!f.open(QIODevice::ReadWrite)) { KMessageBox::error(parent, i18n("Could not open file for writing."), @@ -377,5 +379,5 @@ bool Csv::doExport(QFile &f, unsigned int i, j; PwMDataItem d; - QCString s, catName; + Q3CString s, catName; QByteArray b; @@ -402,5 +404,5 @@ bool Csv::doExport(QFile &f, // remove \0 termination #ifndef PWM_EMBEDDED - b.resize(b.size() - 1, QGArray::SpeedOptim); + b.resize(b.size() - 1, Q3GArray::SpeedOptim); #else b.resize(b.size() - 1); @@ -413,13 +415,13 @@ bool Csv::doExport(QFile &f, } -QCString Csv::newField(QCString s) +Q3CString Csv::newField(Q3CString s) { if (s.isEmpty()) - return QCString(); - QCString ret("\""); + return Q3CString(); + Q3CString ret("\""); #ifndef PWM_EMBEDDED s.replace('\"', "\"\""); #else - s.replace(QRegExp("\""), "\"\""); + s.replace("\"", "\"\""); #endif ret += s; |