summaryrefslogtreecommitdiffstats
path: root/src/translators/filelistingimporter.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
commit2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch)
tree18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/translators/filelistingimporter.cpp
parent1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff)
downloadtellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz
tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip
TQt4 port tellico
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/translators/filelistingimporter.cpp')
-rw-r--r--src/translators/filelistingimporter.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/translators/filelistingimporter.cpp b/src/translators/filelistingimporter.cpp
index bef9288..00e0709 100644
--- a/src/translators/filelistingimporter.cpp
+++ b/src/translators/filelistingimporter.cpp
@@ -28,12 +28,12 @@
#include <kio/job.h>
#include <kio/netaccess.h>
-#include <qcheckbox.h>
-#include <qvgroupbox.h>
-#include <qlayout.h>
-#include <qwhatsthis.h>
-#include <qfile.h>
-#include <qfileinfo.h>
+#include <tqcheckbox.h>
+#include <tqvgroupbox.h>
+#include <tqlayout.h>
+#include <tqwhatsthis.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
#include <stdio.h>
@@ -62,17 +62,17 @@ Tellico::Data::CollPtr FileListingImporter::collection() {
ProgressItem& item = ProgressManager::self()->newProgressItem(this, i18n("Scanning files..."), true);
item.setTotalSteps(100);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
// going to assume only one volume will ever be imported
- QString volume = volumeName();
+ TQString volume = volumeName();
m_job = m_recursive->isChecked()
? KIO::listRecursive(url(), true, false)
: KIO::listDir(url(), true, false);
- connect(m_job, SIGNAL(entries(KIO::Job*, const KIO::UDSEntryList&)),
- SLOT(slotEntries(KIO::Job*, const KIO::UDSEntryList&)));
+ connect(m_job, TQT_SIGNAL(entries(KIO::Job*, const KIO::UDSEntryList&)),
+ TQT_SLOT(slotEntries(KIO::Job*, const KIO::UDSEntryList&)));
if(!KIO::NetAccess::synchronousRun(m_job, Kernel::self()->widget()) || m_cancelled) {
return 0;
@@ -80,24 +80,24 @@ Tellico::Data::CollPtr FileListingImporter::collection() {
const bool usePreview = m_filePreview->isChecked();
- const QString title = QString::fromLatin1("title");
- const QString url = QString::fromLatin1("url");
- const QString desc = QString::fromLatin1("description");
- const QString vol = QString::fromLatin1("volume");
- const QString folder = QString::fromLatin1("folder");
- const QString type = QString::fromLatin1("mimetype");
- const QString size = QString::fromLatin1("size");
- const QString perm = QString::fromLatin1("permissions");
- const QString owner = QString::fromLatin1("owner");
- const QString group = QString::fromLatin1("group");
- const QString created = QString::fromLatin1("created");
- const QString modified = QString::fromLatin1("modified");
- const QString metainfo = QString::fromLatin1("metainfo");
- const QString icon = QString::fromLatin1("icon");
+ const TQString title = TQString::tqfromLatin1("title");
+ const TQString url = TQString::tqfromLatin1("url");
+ const TQString desc = TQString::tqfromLatin1("description");
+ const TQString vol = TQString::tqfromLatin1("volume");
+ const TQString folder = TQString::tqfromLatin1("folder");
+ const TQString type = TQString::tqfromLatin1("mimetype");
+ const TQString size = TQString::tqfromLatin1("size");
+ const TQString perm = TQString::tqfromLatin1("permissions");
+ const TQString owner = TQString::tqfromLatin1("owner");
+ const TQString group = TQString::tqfromLatin1("group");
+ const TQString created = TQString::tqfromLatin1("created");
+ const TQString modified = TQString::tqfromLatin1("modified");
+ const TQString metainfo = TQString::tqfromLatin1("metainfo");
+ const TQString icon = TQString::tqfromLatin1("icon");
m_coll = new Data::FileCatalog(true);
- QString tmp;
- const uint stepSize = QMAX(1, m_files.count()/100);
+ TQString tmp;
+ const uint stepSize = TQMAX(1, m_files.count()/100);
const bool showProgress = options() & ImportProgress;
item.setTotalSteps(m_files.count());
@@ -121,30 +121,30 @@ Tellico::Data::CollPtr FileListingImporter::collection() {
time_t t = it.current()->time(KIO::UDS_CREATION_TIME);
if(t > 0) {
- QDateTime dt;
+ TQDateTime dt;
dt.setTime_t(t);
entry->setField(created, dt.toString(Qt::ISODate));
}
t = it.current()->time(KIO::UDS_MODIFICATION_TIME);
if(t > 0) {
- QDateTime dt;
+ TQDateTime dt;
dt.setTime_t(t);
entry->setField(modified, dt.toString(Qt::ISODate));
}
const KFileMetaInfo& meta = it.current()->metaInfo();
if(meta.isValid() && !meta.isEmpty()) {
- const QStringList keys = meta.supportedKeys();
- QStringList strings;
- for(QStringList::ConstIterator it2 = keys.begin(); it2 != keys.end(); ++it2) {
+ const TQStringList keys = meta.supportedKeys();
+ TQStringList strings;
+ for(TQStringList::ConstIterator it2 = keys.begin(); it2 != keys.end(); ++it2) {
KFileMetaInfoItem item = meta.item(*it2);
if(item.isValid()) {
- QString s = item.string();
+ TQString s = item.string();
if(!s.isEmpty()) {
strings << item.key() + "::" + s;
}
}
}
- entry->setField(metainfo, strings.join(QString::fromLatin1("; ")));
+ entry->setField(metainfo, strings.join(TQString::tqfromLatin1("; ")));
}
if(!m_cancelled && usePreview) {
@@ -158,7 +158,7 @@ Tellico::Data::CollPtr FileListingImporter::collection() {
if(!m_pixmap.isNull()) {
// is png best option?
- QString id = ImageFactory::addImage(m_pixmap, QString::fromLatin1("PNG"));
+ TQString id = ImageFactory::addImage(m_pixmap, TQString::tqfromLatin1("PNG"));
if(!id.isEmpty()) {
entry->setField(icon, id);
}
@@ -180,23 +180,23 @@ Tellico::Data::CollPtr FileListingImporter::collection() {
return m_coll;
}
-QWidget* FileListingImporter::widget(QWidget* parent_, const char* name_) {
+TQWidget* FileListingImporter::widget(TQWidget* tqparent_, const char* name_) {
if(m_widget) {
return m_widget;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QVGroupBox* box = new QVGroupBox(i18n("File Listing Options"), m_widget);
+ TQVGroupBox* box = new TQVGroupBox(i18n("File Listing Options"), m_widget);
- m_recursive = new QCheckBox(i18n("Recursive folder search"), box);
- QWhatsThis::add(m_recursive, i18n("If checked, folders are recursively searched for all files."));
+ m_recursive = new TQCheckBox(i18n("Recursive folder search"), box);
+ TQWhatsThis::add(m_recursive, i18n("If checked, folders are recursively searched for all files."));
// by default, make it checked
m_recursive->setChecked(true);
- m_filePreview = new QCheckBox(i18n("Generate file previews"), box);
- QWhatsThis::add(m_filePreview, i18n("If checked, previews of the file contents are generated, which can slow down "
+ m_filePreview = new TQCheckBox(i18n("Generate file previews"), box);
+ TQWhatsThis::add(m_filePreview, i18n("If checked, previews of the file contents are generated, which can slow down "
"the folder listing."));
// by default, make it no previews
m_filePreview->setChecked(false);
@@ -223,9 +223,9 @@ void FileListingImporter::slotEntries(KIO::Job* job_, const KIO::UDSEntryList& l
}
}
-QString FileListingImporter::volumeName() const {
+TQString FileListingImporter::volumeName() const {
// this functions turns /media/cdrom into /dev/hdc, then reads 32 bytes after the 16 x 2048 header
- QString volume;
+ TQString volume;
const KMountPoint::List mountPoints = KMountPoint::currentMountPoints(KMountPoint::NeedRealDeviceName);
for(KMountPoint::List::ConstIterator it = mountPoints.begin(), end = mountPoints.end(); it != end; ++it) {
// path() could be /media/cdrom
@@ -236,11 +236,11 @@ QString FileListingImporter::volumeName() const {
|| (*it)->mountType() == Latin1Literal("udf"))) {
volume = (*it)->mountPoint();
if(!(*it)->realDeviceName().isEmpty()) {
- QString devName = (*it)->realDeviceName();
- if(devName.endsWith(QChar('/'))) {
+ TQString devName = (*it)->realDeviceName();
+ if(devName.endsWith(TQChar('/'))) {
devName.truncate(devName.length()-1);
}
- // QFile can't do a sequential seek, and I don't want to do a 32808x loop on getch()
+ // TQFile can't do a sequential seek, and I don't want to do a 32808x loop on getch()
FILE* dev = 0;
if((dev = fopen(devName.latin1(), "rb")) != 0) {
// returns 0 on success
@@ -248,7 +248,7 @@ QString FileListingImporter::volumeName() const {
char buf[VOLUME_NAME_SIZE];
int ret = fread(buf, 1, VOLUME_NAME_SIZE, dev);
if(ret == VOLUME_NAME_SIZE) {
- volume = QString::fromLatin1(buf, VOLUME_NAME_SIZE).stripWhiteSpace();
+ volume = TQString::tqfromLatin1(buf, VOLUME_NAME_SIZE).stripWhiteSpace();
}
} else {
myDebug() << "FileListingImporter::volumeName() - can't seek " << devName << endl;