summaryrefslogtreecommitdiffstats
path: root/kfile-plugins/mp3/kfile_mp3.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
commite654398e46e37abf457b2b1122ab898d2c51c49f (patch)
treed39ee6440f3c3663c3ead84a2d4cc2d034667e96 /kfile-plugins/mp3/kfile_mp3.cpp
parente4f29b18e19394b9352f52a6c0d0d0e3932cf511 (diff)
downloadtdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.tar.gz
tdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kfile-plugins/mp3/kfile_mp3.cpp')
-rw-r--r--kfile-plugins/mp3/kfile_mp3.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/kfile-plugins/mp3/kfile_mp3.cpp b/kfile-plugins/mp3/kfile_mp3.cpp
index 38adce70..c6317946 100644
--- a/kfile-plugins/mp3/kfile_mp3.cpp
+++ b/kfile-plugins/mp3/kfile_mp3.cpp
@@ -28,11 +28,11 @@
#include <kstringvalidator.h>
#include <kdebug.h>
-#include <qdict.h>
-#include <qvalidator.h>
-#include <qcstring.h>
-#include <qfile.h>
-#include <qdatetime.h>
+#include <tqdict.h>
+#include <tqvalidator.h>
+#include <tqcstring.h>
+#include <tqfile.h>
+#include <tqdatetime.h>
#include <tstring.h>
#include <tag.h>
@@ -44,7 +44,7 @@ typedef KGenericFactory<KMp3Plugin> Mp3Factory;
K_EXPORT_COMPONENT_FACTORY(kfile_mp3, Mp3Factory( "kfile_mp3" ))
-KMp3Plugin::KMp3Plugin(QObject *parent, const char *name, const QStringList &args)
+KMp3Plugin::KMp3Plugin(TQObject *parent, const char *name, const TQStringList &args)
: KFilePlugin(parent, name, args)
{
kdDebug(7034) << "mp3 plugin\n";
@@ -60,54 +60,54 @@ KMp3Plugin::KMp3Plugin(QObject *parent, const char *name, const QStringList &arg
KFileMimeTypeInfo::ItemInfo *item;
- item = addItemInfo(group, "Title", i18n("Title"), QVariant::String);
+ item = addItemInfo(group, "Title", i18n("Title"), TQVariant::String);
setAttributes(item, KFileMimeTypeInfo::Modifiable);
setHint(item, KFileMimeTypeInfo::Name);
- item = addItemInfo(group, "Artist", i18n("Artist"), QVariant::String);
+ item = addItemInfo(group, "Artist", i18n("Artist"), TQVariant::String);
setAttributes(item, KFileMimeTypeInfo::Modifiable);
setHint(item, KFileMimeTypeInfo::Author);
- item = addItemInfo(group, "Album", i18n("Album"), QVariant::String);
+ item = addItemInfo(group, "Album", i18n("Album"), TQVariant::String);
setAttributes(item, KFileMimeTypeInfo::Modifiable);
- item = addItemInfo(group, "Date", i18n("Year"), QVariant::String);
+ item = addItemInfo(group, "Date", i18n("Year"), TQVariant::String);
setAttributes(item, KFileMimeTypeInfo::Modifiable);
- item = addItemInfo(group, "Comment", i18n("Comment"), QVariant::String);
+ item = addItemInfo(group, "Comment", i18n("Comment"), TQVariant::String);
setAttributes(item, KFileMimeTypeInfo::Modifiable);
setHint(item, KFileMimeTypeInfo::Description);
- item = addItemInfo(group, "Tracknumber", i18n("Track"), QVariant::Int);
+ item = addItemInfo(group, "Tracknumber", i18n("Track"), TQVariant::Int);
setAttributes(item, KFileMimeTypeInfo::Modifiable);
- item = addItemInfo(group, "Genre", i18n("Genre"), QVariant::String);
+ item = addItemInfo(group, "Genre", i18n("Genre"), TQVariant::String);
setAttributes(item, KFileMimeTypeInfo::Modifiable);
// technical group
group = addGroupInfo(info, "Technical", i18n("Technical Details"));
- item = addItemInfo(group, "Version", i18n("Version"), QVariant::Int);
+ item = addItemInfo(group, "Version", i18n("Version"), TQVariant::Int);
setPrefix(item, i18n("MPEG "));
- item = addItemInfo(group, "Layer", i18n("Layer"), QVariant::Int);
- item = addItemInfo(group, "CRC", i18n("CRC"), QVariant::Bool);
- item = addItemInfo(group, "Bitrate", i18n("Bitrate"), QVariant::Int);
+ item = addItemInfo(group, "Layer", i18n("Layer"), TQVariant::Int);
+ item = addItemInfo(group, "CRC", i18n("CRC"), TQVariant::Bool);
+ item = addItemInfo(group, "Bitrate", i18n("Bitrate"), TQVariant::Int);
setAttributes(item, KFileMimeTypeInfo::Averaged);
setHint(item, KFileMimeTypeInfo::Bitrate);
setSuffix(item, i18n(" kbps"));
- item = addItemInfo(group, "Sample Rate", i18n("Sample Rate"), QVariant::Int);
+ item = addItemInfo(group, "Sample Rate", i18n("Sample Rate"), TQVariant::Int);
setSuffix(item, i18n("Hz"));
- item = addItemInfo(group, "Channels", i18n("Channels"), QVariant::Int);
- item = addItemInfo(group, "Copyright", i18n("Copyright"), QVariant::Bool);
- item = addItemInfo(group, "Original", i18n("Original"), QVariant::Bool);
- item = addItemInfo(group, "Length", i18n("Length"), QVariant::Int);
+ item = addItemInfo(group, "Channels", i18n("Channels"), TQVariant::Int);
+ item = addItemInfo(group, "Copyright", i18n("Copyright"), TQVariant::Bool);
+ item = addItemInfo(group, "Original", i18n("Original"), TQVariant::Bool);
+ item = addItemInfo(group, "Length", i18n("Length"), TQVariant::Int);
setAttributes(item, KFileMimeTypeInfo::Cummulative);
setUnit(item, KFileMimeTypeInfo::Seconds);
- item = addItemInfo(group, "Emphasis", i18n("Emphasis"), QVariant::String);
+ item = addItemInfo(group, "Emphasis", i18n("Emphasis"), TQVariant::String);
}
bool KMp3Plugin::readInfo(KFileMetaInfo &info, uint what)
@@ -139,7 +139,7 @@ bool KMp3Plugin::readInfo(KFileMetaInfo &info, uint what)
if ( info.path().isEmpty() ) // remote file
return false;
- TagLib::MPEG::File file(QFile::encodeName(info.path()).data(), readTech);
+ TagLib::MPEG::File file(TQFile::encodeName(info.path()).data(), readTech);
if(!file.isOpen())
{
@@ -151,24 +151,24 @@ bool KMp3Plugin::readInfo(KFileMetaInfo &info, uint what)
{
KFileMetaInfoGroup id3group = appendGroup(info, "id3");
- QString date = file.tag()->year() > 0 ? QString::number(file.tag()->year()) : QString::null;
- QString track = file.tag()->track() > 0 ? QString::number(file.tag()->track()) : QString::null;
+ TQString date = file.tag()->year() > 0 ? TQString::number(file.tag()->year()) : TQString::null;
+ TQString track = file.tag()->track() > 0 ? TQString::number(file.tag()->track()) : TQString::null;
- QString title = TStringToQString(file.tag()->title()).stripWhiteSpace();
+ TQString title = TStringToQString(file.tag()->title()).stripWhiteSpace();
if (!title.isEmpty())
appendItem(id3group, "Title", title);
- QString artist = TStringToQString(file.tag()->artist()).stripWhiteSpace();
+ TQString artist = TStringToQString(file.tag()->artist()).stripWhiteSpace();
if (!artist.isEmpty())
appendItem(id3group, "Artist", artist);
- QString album = TStringToQString(file.tag()->album()).stripWhiteSpace();
+ TQString album = TStringToQString(file.tag()->album()).stripWhiteSpace();
if (!album.isEmpty())
appendItem(id3group, "Album", album);
appendItem(id3group, "Date", date);
- QString comment = TStringToQString(file.tag()->comment()).stripWhiteSpace();
+ TQString comment = TStringToQString(file.tag()->comment()).stripWhiteSpace();
if (!comment.isEmpty())
appendItem(id3group, "Comment", comment);
appendItem(id3group, "Tracknumber", track);
- QString genre = TStringToQString(file.tag()->genre()).stripWhiteSpace();
+ TQString genre = TStringToQString(file.tag()->genre()).stripWhiteSpace();
if (!genre.isEmpty())
appendItem(id3group, "Genre", genre);
}
@@ -177,7 +177,7 @@ bool KMp3Plugin::readInfo(KFileMetaInfo &info, uint what)
{
KFileMetaInfoGroup techgroup = appendGroup(info, "Technical");
- QString version;
+ TQString version;
switch(file.audioProperties()->version())
{
case TagLib::MPEG::Header::Version1:
@@ -201,8 +201,8 @@ bool KMp3Plugin::readInfo(KFileMetaInfo &info, uint what)
appendItem(techgroup, "Bitrate", file.audioProperties()->bitrate());
appendItem(techgroup, "Sample Rate", file.audioProperties()->sampleRate());
appendItem(techgroup, "Channels", file.audioProperties()->channels());
- appendItem(techgroup, "Copyright", QVariant(file.audioProperties()->isCopyrighted(), dummy));
- appendItem(techgroup, "Original", QVariant(file.audioProperties()->isOriginal(), dummy));
+ appendItem(techgroup, "Copyright", TQVariant(file.audioProperties()->isCopyrighted(), dummy));
+ appendItem(techgroup, "Original", TQVariant(file.audioProperties()->isOriginal(), dummy));
appendItem(techgroup, "Length", file.audioProperties()->length());
// appendItem(techgroup, "Emphasis", file.audioProperties()->empahsis());
}
@@ -235,7 +235,7 @@ private:
bool KMp3Plugin::writeInfo(const KFileMetaInfo &info) const
{
TagLib::ID3v2::FrameFactory::instance()->setDefaultTextEncoding(TagLib::String::UTF8);
- TagLib::MPEG::File file(QFile::encodeName(info.path()).data(), false);
+ TagLib::MPEG::File file(TQFile::encodeName(info.path()).data(), false);
if(!file.isOpen() || !TagLib::File::isWritable(file.name()))
{
@@ -266,33 +266,33 @@ bool KMp3Plugin::writeInfo(const KFileMetaInfo &info) const
class ComboValidator : public KStringListValidator
{
public:
- ComboValidator(const QStringList &list, bool rejecting,
- bool fixupEnabled, QObject *parent, const char *name) :
+ ComboValidator(const TQStringList &list, bool rejecting,
+ bool fixupEnabled, TQObject *parent, const char *name) :
KStringListValidator(list, rejecting, fixupEnabled, parent, name)
{
}
- virtual QValidator::State validate(QString &, int &) const
+ virtual TQValidator::State validate(TQString &, int &) const
{
- return QValidator::Acceptable;
+ return TQValidator::Acceptable;
}
};
-QValidator *KMp3Plugin::createValidator(const QString & /* mimetype */,
- const QString &group, const QString &key,
- QObject *parent, const char *name) const
+TQValidator *KMp3Plugin::createValidator(const TQString & /* mimetype */,
+ const TQString &group, const TQString &key,
+ TQObject *parent, const char *name) const
{
kdDebug(7034) << "making a validator for " << group << "/" << key << endl;
if(key == "Tracknumber" || key == "Date")
{
- return new QIntValidator(0, 9999, parent, name);
+ return new TQIntValidator(0, 9999, parent, name);
}
if(key == "Genre")
{
- QStringList l;
+ TQStringList l;
TagLib::StringList genres = TagLib::ID3v1::genreList();
for(TagLib::StringList::ConstIterator it = genres.begin(); it != genres.end(); ++it)
{