diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-18 06:46:40 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-18 06:46:40 +0000 |
commit | 7c19562ad065b6729bac8eb9b40dfe0452a72272 (patch) | |
tree | 33325d1e02ecc9ca614c7209296f8f796a1c3478 /kipi-plugins/picasawebexport/mpform.cpp | |
parent | a65baa328fac0a1ce12971fef8d998ce7bfbe237 (diff) | |
download | kipi-plugins-7c19562ad065b6729bac8eb9b40dfe0452a72272.tar.gz kipi-plugins-7c19562ad065b6729bac8eb9b40dfe0452a72272.zip |
TQt4 port kipi-plugins
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/libraries/kipi-plugins@1232561 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kipi-plugins/picasawebexport/mpform.cpp')
-rw-r--r-- | kipi-plugins/picasawebexport/mpform.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/kipi-plugins/picasawebexport/mpform.cpp b/kipi-plugins/picasawebexport/mpform.cpp index 4730bec..3fdeac6 100644 --- a/kipi-plugins/picasawebexport/mpform.cpp +++ b/kipi-plugins/picasawebexport/mpform.cpp @@ -26,11 +26,11 @@ #include <cstring> #include <cstdio> -// Qt includes. +// TQt includes. -#include <qfile.h> -#include <qfileinfo.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqtextstream.h> // KDE includes. @@ -63,20 +63,20 @@ void MPForm::reset() void MPForm::finish() { - QCString str; + TQCString str; str += "--"; str += m_boundary; str += "--"; - QTextStream ts(m_buffer, IO_Append|IO_WriteOnly); - ts.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream ts(m_buffer, IO_Append|IO_WriteOnly); + ts.setEncoding(TQTextStream::UnicodeUTF8); ts << str; } -bool MPForm::addPair(const QString& name, const QString& value, const QString& contentType) +bool MPForm::addPair(const TQString& name, const TQString& value, const TQString& contentType) { - QCString str; - QString content_length = QString("%1").arg(value.length()); + TQCString str; + TQString content_length = TQString("%1").tqarg(value.length()); str += "--"; str += m_boundary; str += "\r\n"; @@ -90,7 +90,7 @@ bool MPForm::addPair(const QString& name, const QString& value, const QString& c if (!contentType.isEmpty()) { - str += "Content-Type: "+ QCString(contentType.ascii()); + str += "Content-Type: "+ TQCString(contentType.ascii()); str += "\r\n"; str += "Mime-version: 1.0 "; str += "\r\n"; @@ -106,17 +106,17 @@ bool MPForm::addPair(const QString& name, const QString& value, const QString& c //m_buffer.resize(oldSize + str.size()); //memcpy(m_buffer.data() + oldSize, str.data(), str.size()); - QTextStream ts(m_buffer, IO_Append|IO_WriteOnly); - ts.setEncoding(QTextStream::UnicodeUTF8); - ts << QString::fromUtf8(str); + TQTextStream ts(m_buffer, IO_Append|IO_WriteOnly); + ts.setEncoding(TQTextStream::UnicodeUTF8); + ts << TQString::fromUtf8(str); return true; } -bool MPForm::addFile(const QString& name,const QString& path) +bool MPForm::addFile(const TQString& name,const TQString& path) { KMimeType::Ptr ptr = KMimeType::findByURL(path); - QString mime = ptr->name(); + TQString mime = ptr->name(); if (mime.isEmpty()) { // if we ourselves can't determine the mime of the local file, @@ -124,14 +124,14 @@ bool MPForm::addFile(const QString& name,const QString& path) return false; } - QFile imageFile(path); + TQFile imageFile(path); if (!imageFile.open(IO_ReadOnly)) return false; - QByteArray imageData = imageFile.readAll(); + TQByteArray imageData = imageFile.readAll(); - QCString str; - QString file_size = QString("%1").arg(imageFile.size()); + TQCString str; + TQString file_size = TQString("%1").tqarg(imageFile.size()); str += "--"; str += m_boundary; @@ -140,7 +140,7 @@ bool MPForm::addFile(const QString& name,const QString& path) str += name.ascii(); str += "\"; "; str += "filename=\""; - str += QFile::encodeName(KURL(path).filename()); + str += TQFile::encodeName(KURL(path).filename()); str += "\"\r\n"; str += "Content-Length: " ; str += file_size.ascii(); @@ -150,8 +150,8 @@ bool MPForm::addFile(const QString& name,const QString& path) str += "\r\n\r\n"; imageFile.close(); - QTextStream ts(m_buffer, IO_Append|IO_WriteOnly); - ts.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream ts(m_buffer, IO_Append|IO_WriteOnly); + ts.setEncoding(TQTextStream::UnicodeUTF8); ts << str; int oldSize = m_buffer.size(); @@ -163,17 +163,17 @@ bool MPForm::addFile(const QString& name,const QString& path) return true; } -QString MPForm::contentType() const +TQString MPForm::contentType() const { - return QString("Content-Type: multipart/related; boundary=" + m_boundary); + return TQString("Content-Type: multipart/related; boundary=" + m_boundary); } -QString MPForm::boundary() const +TQString MPForm::boundary() const { return m_boundary; } -QByteArray MPForm::formData() const +TQByteArray MPForm::formData() const { return m_buffer; } |