|
|
@ -40,6 +40,8 @@
|
|
|
|
#include <id3v1genres.h>
|
|
|
|
#include <id3v1genres.h>
|
|
|
|
#include <id3v2framefactory.h>
|
|
|
|
#include <id3v2framefactory.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TStringToTQString(s) TQString::fromUtf8((s).toCString(true))
|
|
|
|
|
|
|
|
|
|
|
|
typedef KGenericFactory<KMp3Plugin> Mp3Factory;
|
|
|
|
typedef KGenericFactory<KMp3Plugin> Mp3Factory;
|
|
|
|
|
|
|
|
|
|
|
|
K_EXPORT_COMPONENT_FACTORY(tdefile_mp3, Mp3Factory( "tdefile_mp3" ))
|
|
|
|
K_EXPORT_COMPONENT_FACTORY(tdefile_mp3, Mp3Factory( "tdefile_mp3" ))
|
|
|
@ -154,21 +156,21 @@ bool KMp3Plugin::readInfo(KFileMetaInfo &info, uint what)
|
|
|
|
TQString date = file.tag()->year() > 0 ? TQString::number(file.tag()->year()) : TQString();
|
|
|
|
TQString date = file.tag()->year() > 0 ? TQString::number(file.tag()->year()) : TQString();
|
|
|
|
TQString track = file.tag()->track() > 0 ? TQString::number(file.tag()->track()) : TQString();
|
|
|
|
TQString track = file.tag()->track() > 0 ? TQString::number(file.tag()->track()) : TQString();
|
|
|
|
|
|
|
|
|
|
|
|
TQString title = TQString(TStringToQString(file.tag()->title())).stripWhiteSpace();
|
|
|
|
TQString title = TStringToTQString(file.tag()->title()).stripWhiteSpace();
|
|
|
|
if (!title.isEmpty())
|
|
|
|
if (!title.isEmpty())
|
|
|
|
appendItem(id3group, "Title", title);
|
|
|
|
appendItem(id3group, "Title", title);
|
|
|
|
TQString artist = TQString(TStringToQString(file.tag()->artist())).stripWhiteSpace();
|
|
|
|
TQString artist = TStringToTQString(file.tag()->artist()).stripWhiteSpace();
|
|
|
|
if (!artist.isEmpty())
|
|
|
|
if (!artist.isEmpty())
|
|
|
|
appendItem(id3group, "Artist", artist);
|
|
|
|
appendItem(id3group, "Artist", artist);
|
|
|
|
TQString album = TQString(TStringToQString(file.tag()->album())).stripWhiteSpace();
|
|
|
|
TQString album = TStringToTQString(file.tag()->album()).stripWhiteSpace();
|
|
|
|
if (!album.isEmpty())
|
|
|
|
if (!album.isEmpty())
|
|
|
|
appendItem(id3group, "Album", album);
|
|
|
|
appendItem(id3group, "Album", album);
|
|
|
|
appendItem(id3group, "Date", date);
|
|
|
|
appendItem(id3group, "Date", date);
|
|
|
|
TQString comment = TQString(TStringToQString(file.tag()->comment())).stripWhiteSpace();
|
|
|
|
TQString comment = TStringToTQString(file.tag()->comment()).stripWhiteSpace();
|
|
|
|
if (!comment.isEmpty())
|
|
|
|
if (!comment.isEmpty())
|
|
|
|
appendItem(id3group, "Comment", comment);
|
|
|
|
appendItem(id3group, "Comment", comment);
|
|
|
|
appendItem(id3group, "Tracknumber", track);
|
|
|
|
appendItem(id3group, "Tracknumber", track);
|
|
|
|
TQString genre = TQString(TStringToQString(file.tag()->genre())).stripWhiteSpace();
|
|
|
|
TQString genre = TStringToTQString(file.tag()->genre()).stripWhiteSpace();
|
|
|
|
if (!genre.isEmpty())
|
|
|
|
if (!genre.isEmpty())
|
|
|
|
appendItem(id3group, "Genre", genre);
|
|
|
|
appendItem(id3group, "Genre", genre);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -294,7 +296,7 @@ TQValidator *KMp3Plugin::createValidator(const TQString & /* mimetype */,
|
|
|
|
TagLib::StringList genres = TagLib::ID3v1::genreList();
|
|
|
|
TagLib::StringList genres = TagLib::ID3v1::genreList();
|
|
|
|
for(TagLib::StringList::ConstIterator it = genres.begin(); it != genres.end(); ++it)
|
|
|
|
for(TagLib::StringList::ConstIterator it = genres.begin(); it != genres.end(); ++it)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
l.append(TStringToQString((*it)));
|
|
|
|
l.append(TStringToTQString((*it)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return new ComboValidator(l, false, true, parent, name);
|
|
|
|
return new ComboValidator(l, false, true, parent, name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|