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.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/kfile-plugins/torrent/kfile_torrent.cpp b/kfile-plugins/torrent/kfile_torrent.cpp
index 2d97915e..4aca75bc 100644
--- a/kfile-plugins/torrent/kfile_torrent.cpp
+++ b/kfile-plugins/torrent/kfile_torrent.cpp
@@ -16,11 +16,11 @@
* If not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qdatetime.h>
-#include <qfile.h>
-#include <qregexp.h>
-#include <qdir.h>
-#include <qstringlist.h>
+#include <tqdatetime.h>
+#include <tqfile.h>
+#include <tqregexp.h>
+#include <tqdir.h>
+#include <tqstringlist.h>
#include <kmessagebox.h>
#include <kgenericfactory.h>
@@ -34,11 +34,11 @@
typedef KGenericFactory<KTorrentPlugin> TorrentFactory;
K_EXPORT_COMPONENT_FACTORY(kfile_torrent, TorrentFactory("kfile_torrent"))
-QStringList filesList (BList *list);
+TQStringList filesList (BList *list);
Q_ULLONG filesLength (BList *list);
-KTorrentPlugin::KTorrentPlugin (QObject *parent, const char *name,
- const QStringList &args)
+KTorrentPlugin::KTorrentPlugin (TQObject *parent, const char *name,
+ const TQStringList &args)
: KFilePlugin (parent, name, args), m_failed(true), m_dict(0)
{
KFileMimeTypeInfo *info = addMimeTypeInfo ("application/x-bittorrent");
@@ -59,7 +59,7 @@ KTorrentPlugin::KTorrentPlugin (QObject *parent, const char *name,
KFileMimeTypeInfo::ItemInfo *item = 0;
- item = addItemInfo(group, "name", i18n("Name"), QVariant::String);
+ item = addItemInfo(group, "name", i18n("Name"), TQVariant::String);
if (!item)
{
kdError() << "Error adding Name to group!\n";
@@ -68,7 +68,7 @@ KTorrentPlugin::KTorrentPlugin (QObject *parent, const char *name,
setHint (item, KFileMimeTypeInfo::Name);
setAttributes (item, KFileMimeTypeInfo::Modifiable);
- item = addItemInfo(group, "length", i18n("Torrent Length"), QVariant::ULongLong);
+ item = addItemInfo(group, "length", i18n("Torrent Length"), TQVariant::ULongLong);
if (!item)
{
kdError() << "Error adding Length to group!\n";
@@ -77,28 +77,28 @@ KTorrentPlugin::KTorrentPlugin (QObject *parent, const char *name,
setHint (item, KFileMimeTypeInfo::Length);
setUnit (item, KFileMimeTypeInfo::Bytes);
- item = addItemInfo(group, "announce", i18n("Tracker URL"), QVariant::String);
+ item = addItemInfo(group, "announce", i18n("Tracker URL"), TQVariant::String);
if (!item)
{
kdError() << "Error adding Announce to group!\n";
return;
}
- item = addItemInfo(group, "creation date", i18n("Date Created"), QVariant::DateTime);
+ item = addItemInfo(group, "creation date", i18n("Date Created"), TQVariant::DateTime);
if (!item)
{
kdError() << "Error adding DateCreated to group!\n";
return;
}
- item = addItemInfo(group, "NumFiles", i18n("Number of Files"), QVariant::Int);
+ item = addItemInfo(group, "NumFiles", i18n("Number of Files"), TQVariant::Int);
if (!item)
{
kdError() << "Error adding NumFiles to group!\n";
return;
}
- item = addItemInfo(group, "piece length", i18n("File Piece Length"), QVariant::Int);
+ item = addItemInfo(group, "piece length", i18n("File Piece Length"), TQVariant::Int);
if (!item)
{
kdError() << "Error adding PieceLength to group!\n";
@@ -106,7 +106,7 @@ KTorrentPlugin::KTorrentPlugin (QObject *parent, const char *name,
}
setUnit (item, KFileMimeTypeInfo::Bytes);
- item = addItemInfo(group, "comment", i18n("Comment"), QVariant::String);
+ item = addItemInfo(group, "comment", i18n("Comment"), TQVariant::String);
if (!item)
{
kdError() << "Error adding Comment to group!\n";
@@ -129,7 +129,7 @@ bool KTorrentPlugin::readInfo (KFileMetaInfo &info, unsigned int)
return false;
}
- QFile file (info.path());
+ TQFile file (info.path());
if (!file.open(IO_ReadOnly))
{
kdError() << "Unable to open given file!\n";
@@ -137,7 +137,7 @@ bool KTorrentPlugin::readInfo (KFileMetaInfo &info, unsigned int)
}
// We need to read in the entire file to parse the dictionary structure.
- QByteArray buf = file.readAll();
+ TQByteArray buf = file.readAll();
file.close();
if (!buf)
@@ -171,20 +171,20 @@ bool KTorrentPlugin::readInfo (KFileMetaInfo &info, unsigned int)
BString *str = m_dict->findStr ("announce");
if (!str)
return false;
- appendItem (group, "announce", QString(str->get_string()));
+ appendItem (group, "announce", TQString(str->get_string()));
}
if (m_dict->contains("creation date"))
{
BInt *the_data = m_dict->findInt ("creation date");
- QDateTime my_date;
+ TQDateTime my_date;
if (!the_data)
return false;
unsigned int the_time = the_data->get_value();
- /* Hopefully the_time is UTC, because that's what QDateTime does. */
+ /* Hopefully the_time is UTC, because that's what TQDateTime does. */
my_date.setTime_t (the_time);
appendItem (group, "creation date", my_date);
}
@@ -229,7 +229,7 @@ bool KTorrentPlugin::readInfo (KFileMetaInfo &info, unsigned int)
if (!str)
return false;
- QString real_str (str->get_string());
+ TQString real_str (str->get_string());
if (num_files > 1 && !real_str.endsWith("/"))
real_str.append('/');
@@ -253,18 +253,18 @@ bool KTorrentPlugin::readInfo (KFileMetaInfo &info, unsigned int)
appendItem (group, "comment", comment->get_string());
}
else
- appendItem (group, "comment", QString());
+ appendItem (group, "comment", TQString());
return true;
}
-/* Returns a QStringList containing file names within the list. The list
+/* Returns a TQStringList containing file names within the list. The list
* should be the one contained within the info dictionary of the torrent,
* keyed by 'files'
*/
-QStringList filesList (BList *list)
+TQStringList filesList (BList *list)
{
- QStringList str_list, failList;
+ TQStringList str_list, failList;
for (unsigned int i = 0; i < list->count(); ++i)
{
@@ -283,7 +283,7 @@ QStringList filesList (BList *list)
if (!list_path)
return failList;
- QString str;
+ TQString str;
BString *temp_str;
if (list_path->count() > 0)
@@ -295,10 +295,10 @@ QStringList filesList (BList *list)
str.append (temp_str->get_string());
}
- /* Construct QString consisting of path and file name */
+ /* Construct TQString consisting of path and file name */
for (unsigned int j = 1; j < list_path->count(); ++j)
{
- str.append (QDir::separator());
+ str.append (TQDir::separator());
temp_str = list_path->indexStr (j);
if (!temp_str)
return failList;
@@ -347,17 +347,17 @@ bool KTorrentPlugin::writeInfo(const KFileMetaInfo &info) const
// The m_dict is ready, all we have to do is open a file, and
// let 'er go.
- QStringList list = info.groups();
- QStringList::Iterator it = list.begin();
+ TQStringList list = info.groups();
+ TQStringList::Iterator it = list.begin();
for (; it != list.end(); ++it)
{
- QStringList list2 = info[*it].keys();
- QStringList::Iterator it2 = list2.begin();
+ TQStringList list2 = info[*it].keys();
+ TQStringList::Iterator it2 = list2.begin();
for (; it2 != list2.end(); ++it2)
{
- QString key = *it2;
+ TQString key = *it2;
if (info[*it][key].isModified())
{
@@ -380,10 +380,10 @@ bool KTorrentPlugin::writeInfo(const KFileMetaInfo &info) const
if (!name_str)
return false;
- QString the_name = info[*it][key].value().toString();
+ TQString the_name = info[*it][key].value().toString();
// Remove trailing slashes
- the_name.replace (QRegExp("/*$"), "");
+ the_name.replace (TQRegExp("/*$"), "");
name_str->setValue (the_name);
}
@@ -391,7 +391,7 @@ bool KTorrentPlugin::writeInfo(const KFileMetaInfo &info) const
}
}
- QFile output (info.path());
+ TQFile output (info.path());
if (!output.open(IO_WriteOnly | IO_Truncate))
return false;