summaryrefslogtreecommitdiffstats
path: root/kfile-plugins/torrent/kfile_torrent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kfile-plugins/torrent/kfile_torrent.cpp')
-rw-r--r--kfile-plugins/torrent/kfile_torrent.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/kfile-plugins/torrent/kfile_torrent.cpp b/kfile-plugins/torrent/kfile_torrent.cpp
index 4aca75bc..a5de60f0 100644
--- a/kfile-plugins/torrent/kfile_torrent.cpp
+++ b/kfile-plugins/torrent/kfile_torrent.cpp
@@ -35,11 +35,11 @@ typedef KGenericFactory<KTorrentPlugin> TorrentFactory;
K_EXPORT_COMPONENT_FACTORY(kfile_torrent, TorrentFactory("kfile_torrent"))
TQStringList filesList (BList *list);
-Q_ULLONG filesLength (BList *list);
+TQ_ULLONG filesLength (BList *list);
-KTorrentPlugin::KTorrentPlugin (TQObject *parent, const char *name,
+KTorrentPlugin::KTorrentPlugin (TQObject *tqparent, const char *name,
const TQStringList &args)
- : KFilePlugin (parent, name, args), m_failed(true), m_dict(0)
+ : KFilePlugin (tqparent, name, args), m_failed(true), m_dict(0)
{
KFileMimeTypeInfo *info = addMimeTypeInfo ("application/x-bittorrent");
if (!info)
@@ -140,7 +140,7 @@ bool KTorrentPlugin::readInfo (KFileMetaInfo &info, unsigned int)
TQByteArray buf = file.readAll();
file.close();
- if (!buf)
+ if (buf.isEmpty())
{
kdError() << "Empty file: " << info.path() << endl;
return false;
@@ -166,7 +166,7 @@ bool KTorrentPlugin::readInfo (KFileMetaInfo &info, unsigned int)
// If a torrent has a key, but it is of the wrong type, then it isn't a valid
// torrent, and so we should just die.
- if (m_dict->contains("announce"))
+ if (m_dict->tqcontains("announce"))
{
BString *str = m_dict->findStr ("announce");
if (!str)
@@ -174,7 +174,7 @@ bool KTorrentPlugin::readInfo (KFileMetaInfo &info, unsigned int)
appendItem (group, "announce", TQString(str->get_string()));
}
- if (m_dict->contains("creation date"))
+ if (m_dict->tqcontains("creation date"))
{
BInt *the_data = m_dict->findInt ("creation date");
TQDateTime my_date;
@@ -193,12 +193,12 @@ bool KTorrentPlugin::readInfo (KFileMetaInfo &info, unsigned int)
// it.
BDict *info_dict = m_dict->findDict("info");
int num_files = 1;
- Q_ULLONG length = 0;
+ TQ_ULLONG length = 0;
if (!info_dict)
return false;
- if (!info_dict->contains("length"))
+ if (!info_dict->tqcontains("length"))
{
/* Has more than one file. The list of files is contained in a
* list called, appropriately enough, 'files'
@@ -223,7 +223,7 @@ bool KTorrentPlugin::readInfo (KFileMetaInfo &info, unsigned int)
appendItem (group, "NumFiles", num_files);
appendItem (group, "length", length);
- if (info_dict->contains("name"))
+ if (info_dict->tqcontains("name"))
{
BString *str = info_dict->findStr("name");
if (!str)
@@ -244,7 +244,7 @@ bool KTorrentPlugin::readInfo (KFileMetaInfo &info, unsigned int)
appendItem (group, "piece length", piece_length->get_value());
- if (m_dict->contains("comment"))
+ if (m_dict->tqcontains("comment"))
{
BString *comment = m_dict->findStr("comment");
if (!comment)
@@ -315,9 +315,9 @@ TQStringList filesList (BList *list)
/* This function determines the total length of a torrent stream.
* The list provided should be the same one provided for filesList.
*/
-Q_ULLONG filesLength (BList *list)
+TQ_ULLONG filesLength (BList *list)
{
- Q_ULLONG length = 0;
+ TQ_ULLONG length = 0;
for (unsigned int i = 0; i < list->count(); ++i)
{
@@ -383,7 +383,7 @@ bool KTorrentPlugin::writeInfo(const KFileMetaInfo &info) const
TQString the_name = info[*it][key].value().toString();
// Remove trailing slashes
- the_name.replace (TQRegExp("/*$"), "");
+ the_name.tqreplace (TQRegExp("/*$"), "");
name_str->setValue (the_name);
}
@@ -396,7 +396,7 @@ bool KTorrentPlugin::writeInfo(const KFileMetaInfo &info) const
if (!output.open(IO_WriteOnly | IO_Truncate))
return false;
- return m_dict->writeToDevice(output);
+ return m_dict->writeToDevice(*TQT_TQIODEVICE(&output));
}
#include "kfile_torrent.moc"