From dc6b8e72fed2586239e3514819238c520636c9d9 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:54:04 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kfilereplace/kfilereplacelib.cpp | 62 ++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'kfilereplace/kfilereplacelib.cpp') diff --git a/kfilereplace/kfilereplacelib.cpp b/kfilereplace/kfilereplacelib.cpp index e57a3a84..6e0d8323 100644 --- a/kfilereplace/kfilereplacelib.cpp +++ b/kfilereplace/kfilereplacelib.cpp @@ -20,10 +20,10 @@ ***************************************************************************/ //QT -#include -#include -#include -#include +#include +#include +#include +#include //KDE #include @@ -48,10 +48,10 @@ const double tera = 1099511627776.0;//1024^4 .................* fileName: second path (can be "/doc/html/", or "doc/html/" or "doc/html/index.html" for example) Return values:...* Full valid path (without double "/") */ -QString KFileReplaceLib::formatFullPath(const QString& basePath, const QString &fileName) +TQString KFileReplaceLib::formatFullPath(const TQString& basePath, const TQString &fileName) { - QString fullPath = basePath; - QString fname = fileName; + TQString fullPath = basePath; + TQString fname = fileName; if (fname.startsWith("/")) // skip beginning '/' fname = fname.remove(0,1); @@ -70,10 +70,10 @@ QString KFileReplaceLib::formatFullPath(const QString& basePath, const QString & .................* extension: extension to add without "." (ex: "html", "kfr") Return values:...* Filename / Filepath with the extension */ -QString KFileReplaceLib::addExtension(const QString& fileName, const QString& extension) +TQString KFileReplaceLib::addExtension(const TQString& fileName, const TQString& extension) { - QString fullExtension = "."; - QString fname = fileName; + TQString fullExtension = "."; + TQString fname = fileName; fullExtension.append(extension); @@ -89,9 +89,9 @@ QString KFileReplaceLib::addExtension(const QString& fileName, const QString& ex return fname; } -QString KFileReplaceLib::formatFileSize(double size) +TQString KFileReplaceLib::formatFileSize(double size) { - QString stringSize; + TQString stringSize; if(size < kilo) { @@ -102,24 +102,24 @@ QString KFileReplaceLib::formatFileSize(double size) if(size >= kilo && size < mega) { double d = size / kilo; - stringSize = i18n("%1 KB").arg(QString::number(d,'f',2)); + stringSize = i18n("%1 KB").arg(TQString::number(d,'f',2)); } else if(size >= mega && size < giga) { double d = size / mega; - stringSize = i18n("%1 MB").arg(QString::number(d,'f',2)); + stringSize = i18n("%1 MB").arg(TQString::number(d,'f',2)); } else if(size >= giga) { double d = size / giga; - stringSize = i18n("%1 GB").arg(QString::number(d,'f',2)); + stringSize = i18n("%1 GB").arg(TQString::number(d,'f',2)); } return stringSize; } -void KFileReplaceLib::convertOldToNewKFRFormat(const QString& fileName, KListView* stringView) +void KFileReplaceLib::convertOldToNewKFRFormat(const TQString& fileName, KListView* stringView) { //this method convert old format in new XML-based format typedef struct @@ -133,7 +133,7 @@ void KFileReplaceLib::convertOldToNewKFRFormat(const QString& fileName, KListVie FILE* f = fopen(fileName.ascii(),"rb"); int err = fread(&head, sizeof(KFRHeader), 1, f); - QString pgm(head.pgm); + TQString pgm(head.pgm); if(!f || (err != 1) || (pgm != "KFileReplace")) { @@ -147,7 +147,7 @@ void KFileReplaceLib::convertOldToNewKFRFormat(const QString& fileName, KListVie newTextSize, errors = 0, stringSize; - QStringList l; + TQStringList l; int i ; for (i=0; i < head.stringNumber; i++) @@ -177,7 +177,7 @@ void KFileReplaceLib::convertOldToNewKFRFormat(const QString& fileName, KListVie KMessageBox::error(0, i18n("Cannot read data.")); else { - QListViewItem* lvi = new QListViewItem(stringView); + TQListViewItem* lvi = new TQListViewItem(stringView); lvi->setText(0,oldString); lvi->setText(1,newString); @@ -195,13 +195,13 @@ void KFileReplaceLib::convertOldToNewKFRFormat(const QString& fileName, KListVie return ; } -bool KFileReplaceLib::isAnAccessibleFile(const QString& filePath, const QString& fileName, RCOptions* info) +bool KFileReplaceLib::isAnAccessibleFile(const TQString& filePath, const TQString& fileName, RCOptions* info) { - QString bkExt = info->m_backupExtension; + TQString bkExt = info->m_backupExtension; if(fileName == ".." || fileName == "." || (!bkExt.isEmpty() && fileName.right(bkExt.length()) == bkExt)) return false; - QFileInfo fi; + TQFileInfo fi; if(filePath.isEmpty()) fi.setFile(fileName); else @@ -212,12 +212,12 @@ bool KFileReplaceLib::isAnAccessibleFile(const QString& filePath, const QString& int minSize = info->m_minSize, maxSize = info->m_maxSize; - QString minDate = info->m_minDate, + TQString minDate = info->m_minDate, maxDate = info->m_maxDate, dateAccess = info->m_dateAccess; // Avoid files that not match access date requirements - QString last = "unknown"; + TQString last = "unknown"; if(dateAccess == "Last Writing Access") last = fi.lastModified().toString(Qt::ISODate); if(dateAccess == "Last Reading Access") @@ -255,11 +255,11 @@ bool KFileReplaceLib::isAnAccessibleFile(const QString& filePath, const QString& // Avoid files that not match ownership requirements if(info->m_ownerUserIsChecked) { - QString fileOwnerUser; + TQString fileOwnerUser; if(info->m_ownerUserType == "Name") fileOwnerUser = fi.owner(); else - fileOwnerUser = QString::number(fi.ownerId(),10); + fileOwnerUser = TQString::number(fi.ownerId(),10); if(info->m_ownerUserBool == "Equals To") { @@ -275,11 +275,11 @@ bool KFileReplaceLib::isAnAccessibleFile(const QString& filePath, const QString& if(info->m_ownerGroupIsChecked) { - QString fileOwnerGroup; + TQString fileOwnerGroup; if(info->m_ownerGroupType == "Name") fileOwnerGroup = fi.group(); else - fileOwnerGroup = QString::number(fi.groupId(),10); + fileOwnerGroup = TQString::number(fi.groupId(),10); if(info->m_ownerGroupBool == "Equals To") { if(info->m_ownerGroupValue != fileOwnerGroup) @@ -296,10 +296,10 @@ bool KFileReplaceLib::isAnAccessibleFile(const QString& filePath, const QString& return true; } -void KFileReplaceLib::setIconForFileEntry(QListViewItem* item, QString path) +void KFileReplaceLib::setIconForFileEntry(TQListViewItem* item, TQString path) { - QFileInfo fi(path); - QString extension = fi.extension(), + TQFileInfo fi(path); + TQString extension = fi.extension(), baseName = fi.baseName(); KeyValueMap extensionMap; -- cgit v1.2.1