Add support for TagLib 2.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 51d998343c)
r14.1.x
Slávek Banko 4 months ago
parent b71a5b9b6a
commit 98cd7ba5a1
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -200,7 +200,7 @@ bool KFlacPlugin::readInfo( KFileMetaInfo& info, uint what )
appendItem(techgroup, "Bitrate", properties->bitrate()); appendItem(techgroup, "Bitrate", properties->bitrate());
appendItem(techgroup, "Sample Rate", properties->sampleRate()); appendItem(techgroup, "Sample Rate", properties->sampleRate());
appendItem(techgroup, "Sample Width", properties->sampleWidth()); appendItem(techgroup, "Sample Width", properties->bitsPerSample());
appendItem(techgroup, "Channels", properties->channels()); appendItem(techgroup, "Channels", properties->channels());
appendItem(techgroup, "Length", properties->length()); appendItem(techgroup, "Length", properties->length());
} }
@ -234,7 +234,7 @@ bool KFlacPlugin::writeInfo(const KFileMetaInfo& info) const
{ {
TagLib::File *file; TagLib::File *file;
if (!TagLib::File::isWritable(TQFile::encodeName(info.path()).data())) { if (access(info.path().local8Bit().data(), R_OK|W_OK)) {
kdDebug(7034) << "can't write to " << info.path() << endl; kdDebug(7034) << "can't write to " << info.path() << endl;
return false; return false;
} }

@ -237,7 +237,7 @@ bool KMp3Plugin::writeInfo(const KFileMetaInfo &info) const
TagLib::ID3v2::FrameFactory::instance()->setDefaultTextEncoding(TagLib::String::UTF8); TagLib::ID3v2::FrameFactory::instance()->setDefaultTextEncoding(TagLib::String::UTF8);
TagLib::MPEG::File file(TQFile::encodeName(info.path()).data(), false); TagLib::MPEG::File file(TQFile::encodeName(info.path()).data(), false);
if(!file.isOpen() || !TagLib::File::isWritable(file.name())) if(!file.isOpen() || access(info.path().local8Bit().data(), R_OK|W_OK))
{ {
kdDebug(7034) << "couldn't open " << info.path() << endl; kdDebug(7034) << "couldn't open " << info.path() << endl;
return false; return false;

@ -210,7 +210,7 @@ bool KMpcPlugin::writeInfo(const KFileMetaInfo& info) const
{ {
TagLib::File *file; TagLib::File *file;
if (!TagLib::File::isWritable(TQFile::encodeName(info.path()).data())) { if (access(info.path().local8Bit().data(), R_OK|W_OK)) {
kdDebug(7034) << "can't write to " << info.path() << endl; kdDebug(7034) << "can't write to " << info.path() << endl;
return false; return false;
} }

Loading…
Cancel
Save