From d758c4b7f91c31fa8ef8bee7e753b5dc974d9d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Fri, 29 Sep 2023 01:47:23 +0200 Subject: [PATCH] Fix FTBFS caused by taglib as a result of the QString -> TQString renaming. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit 8d80a449ebcb1b0d19ac9fac82f7f2fe886fe02a) --- src/metadata/tagengine.cpp | 56 ++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/src/metadata/tagengine.cpp b/src/metadata/tagengine.cpp index 9f9626c..f8064d2 100644 --- a/src/metadata/tagengine.cpp +++ b/src/metadata/tagengine.cpp @@ -34,6 +34,8 @@ #include "m4a/mp4itunestag.h" #endif +#define TStringToTQString(s) TQString::fromUtf8((s).toCString(true)) + // TODO COMPILATION tag // FIXME BPM tag @@ -67,7 +69,7 @@ TagEngine::TagEngine() { TagLib::StringList genres = TagLib::ID3v1::genreList(); for( TagLib::StringList::ConstIterator it = genres.begin(), end = genres.end(); it != end; ++it ) - genreList += TStringToQString( (*it) ); + genreList += TStringToTQString( (*it) ); genreList.sort(); } @@ -92,11 +94,11 @@ TagData* TagEngine::readTags( const TQString& file ) if( tag ) { - tagData->title = TQString(TStringToQString( tag->title() )).stripWhiteSpace(); - tagData->artist = TQString(TStringToQString( tag->artist() )).stripWhiteSpace(); - tagData->album = TQString(TStringToQString( tag->album() )).stripWhiteSpace(); - tagData->genre = TQString(TStringToQString( tag->genre() )).stripWhiteSpace(); - tagData->comment = TQString(TStringToQString( tag->comment() )).stripWhiteSpace(); + tagData->title = TStringToTQString( tag->title() ).stripWhiteSpace(); + tagData->artist = TStringToTQString( tag->artist() ).stripWhiteSpace(); + tagData->album = TStringToTQString( tag->album() ).stripWhiteSpace(); + tagData->genre = TStringToTQString( tag->genre() ).stripWhiteSpace(); + tagData->comment = TStringToTQString( tag->comment() ).stripWhiteSpace(); tagData->track = tag->track(); tagData->year = tag->year(); } @@ -121,18 +123,18 @@ TagData* TagEngine::readTags( const TQString& file ) if ( file->ID3v2Tag() ) { if ( !file->ID3v2Tag()->frameListMap()[ "TPOS" ].isEmpty() ) - disc = TQString(TStringToQString( file->ID3v2Tag()->frameListMap()["TPOS"].front()->toString() )).stripWhiteSpace(); + disc = TStringToTQString( file->ID3v2Tag()->frameListMap()["TPOS"].front()->toString() ).stripWhiteSpace(); if ( !file->ID3v2Tag()->frameListMap()[ "TCOM" ].isEmpty() ) - tagData->composer = TQString(TStringToQString( file->ID3v2Tag()->frameListMap()["TCOM"].front()->toString() )).stripWhiteSpace(); + tagData->composer = TStringToTQString( file->ID3v2Tag()->frameListMap()["TCOM"].front()->toString() ).stripWhiteSpace(); } if ( file->APETag() ) { if ( !file->APETag()->itemListMap()[ "REPLAYGAIN_TRACK_GAIN" ].isEmpty() ) - track_gain = TQString(TStringToQString( file->APETag()->itemListMap()["REPLAYGAIN_TRACK_GAIN"].toString() )).stripWhiteSpace(); + track_gain = TStringToTQString( file->APETag()->itemListMap()["REPLAYGAIN_TRACK_GAIN"].toString() ).stripWhiteSpace(); if ( !file->APETag()->itemListMap()[ "REPLAYGAIN_ALBUM_GAIN" ].isEmpty() ) - album_gain = TQString(TStringToQString( file->APETag()->itemListMap()["REPLAYGAIN_ALBUM_GAIN"].toString() )).stripWhiteSpace(); + album_gain = TStringToTQString( file->APETag()->itemListMap()["REPLAYGAIN_ALBUM_GAIN"].toString() ).stripWhiteSpace(); } } else if ( TagLib::Ogg::Vorbis::File *file = dynamic_cast( fileref.file() ) ) @@ -140,16 +142,16 @@ TagData* TagEngine::readTags( const TQString& file ) if ( file->tag() ) { if ( !file->tag()->fieldListMap()[ "COMPOSER" ].isEmpty() ) - tagData->composer = TQString(TStringToQString( file->tag()->fieldListMap()["COMPOSER"].front() )).stripWhiteSpace(); + tagData->composer = TStringToTQString( file->tag()->fieldListMap()["COMPOSER"].front() ).stripWhiteSpace(); if ( !file->tag()->fieldListMap()[ "DISCNUMBER" ].isEmpty() ) - disc = TQString(TStringToQString( file->tag()->fieldListMap()["DISCNUMBER"].front() )).stripWhiteSpace(); + disc = TStringToTQString( file->tag()->fieldListMap()["DISCNUMBER"].front() ).stripWhiteSpace(); if ( !file->tag()->fieldListMap()[ "REPLAYGAIN_TRACK_GAIN" ].isEmpty() ) - track_gain = TQString(TStringToQString( file->tag()->fieldListMap()["REPLAYGAIN_TRACK_GAIN"].front() )).stripWhiteSpace(); + track_gain = TStringToTQString( file->tag()->fieldListMap()["REPLAYGAIN_TRACK_GAIN"].front() ).stripWhiteSpace(); if ( !file->tag()->fieldListMap()[ "REPLAYGAIN_ALBUM_GAIN" ].isEmpty() ) - album_gain = TQString(TStringToQString( file->tag()->fieldListMap()["REPLAYGAIN_ALBUM_GAIN"].front() )).stripWhiteSpace(); + album_gain = TStringToTQString( file->tag()->fieldListMap()["REPLAYGAIN_ALBUM_GAIN"].front() ).stripWhiteSpace(); } } else if ( TagLib::FLAC::File *file = dynamic_cast( fileref.file() ) ) @@ -157,25 +159,25 @@ TagData* TagEngine::readTags( const TQString& file ) if ( file->xiphComment() ) { if ( !file->xiphComment()->fieldListMap()[ "COMPOSER" ].isEmpty() ) - tagData->composer = TQString(TStringToQString( file->xiphComment()->fieldListMap()["COMPOSER"].front() )).stripWhiteSpace(); + tagData->composer = TStringToTQString( file->xiphComment()->fieldListMap()["COMPOSER"].front() ).stripWhiteSpace(); if ( !file->xiphComment()->fieldListMap()[ "DISCNUMBER" ].isEmpty() ) - disc = TQString(TStringToQString( file->xiphComment()->fieldListMap()["DISCNUMBER"].front() )).stripWhiteSpace(); + disc = TStringToTQString( file->xiphComment()->fieldListMap()["DISCNUMBER"].front() ).stripWhiteSpace(); if ( !file->xiphComment()->fieldListMap()[ "REPLAYGAIN_TRACK_GAIN" ].isEmpty() ) - track_gain = TQString(TStringToQString( file->xiphComment()->fieldListMap()["REPLAYGAIN_TRACK_GAIN"].front() )).stripWhiteSpace(); + track_gain = TStringToTQString( file->xiphComment()->fieldListMap()["REPLAYGAIN_TRACK_GAIN"].front() ).stripWhiteSpace(); if ( !file->xiphComment()->fieldListMap()[ "REPLAYGAIN_ALBUM_GAIN" ].isEmpty() ) - album_gain = TQString(TStringToQString( file->xiphComment()->fieldListMap()["REPLAYGAIN_ALBUM_GAIN"].front() )).stripWhiteSpace(); + album_gain = TStringToTQString( file->xiphComment()->fieldListMap()["REPLAYGAIN_ALBUM_GAIN"].front() ).stripWhiteSpace(); } /*if ( file->tag() ) { if ( !file->tag()->fieldListMap()[ "REPLAYGAIN_TRACK_GAIN" ].isEmpty() ) - track_gain = TQString(TStringToQString( file->tag()->fieldListMap()["REPLAYGAIN_TRACK_GAIN"].front() )).stripWhiteSpace(); + track_gain = TStringToTQString( file->tag()->fieldListMap()["REPLAYGAIN_TRACK_GAIN"].front() ).stripWhiteSpace(); if ( !file->tag()->fieldListMap()[ "REPLAYGAIN_ALBUM_GAIN" ].isEmpty() ) - album_gain = TQString(TStringToQString( file->tag()->fieldListMap()["REPLAYGAIN_ALBUM_GAIN"].front() )).stripWhiteSpace(); + album_gain = TStringToTQString( file->tag()->fieldListMap()["REPLAYGAIN_ALBUM_GAIN"].front() ).stripWhiteSpace(); }*/ } else if ( TagLib::MP4::File *file = dynamic_cast( fileref.file() ) ) @@ -183,7 +185,7 @@ TagData* TagEngine::readTags( const TQString& file ) TagLib::MP4::Tag *mp4tag = dynamic_cast( file->tag() ); if( mp4tag ) { - tagData->composer = TStringToQString( mp4tag->composer() ); + tagData->composer = TStringToTQString( mp4tag->composer() ); disc = TQString::number( mp4tag->disk() ); } @@ -193,10 +195,10 @@ TagData* TagEngine::readTags( const TQString& file ) if ( file->APETag() ) { if ( !file->APETag()->itemListMap()[ "REPLAYGAIN_TRACK_GAIN" ].isEmpty() ) - track_gain = TQString(TStringToQString( file->APETag()->itemListMap()["REPLAYGAIN_TRACK_GAIN"].toString() )).stripWhiteSpace(); + track_gain = TStringToTQString( file->APETag()->itemListMap()["REPLAYGAIN_TRACK_GAIN"].toString() ).stripWhiteSpace(); if ( !file->APETag()->itemListMap()[ "REPLAYGAIN_ALBUM_GAIN" ].isEmpty() ) - album_gain = TQString(TStringToQString( file->APETag()->itemListMap()["REPLAYGAIN_ALBUM_GAIN"].toString() )).stripWhiteSpace(); + album_gain = TStringToTQString( file->APETag()->itemListMap()["REPLAYGAIN_ALBUM_GAIN"].toString() ).stripWhiteSpace(); } }*/ else if ( TagLib::WavPack::File *file = dynamic_cast( fileref.file() ) ) @@ -204,10 +206,10 @@ TagData* TagEngine::readTags( const TQString& file ) if ( file->APETag() ) { if ( !file->APETag()->itemListMap()[ "REPLAYGAIN_TRACK_GAIN" ].isEmpty() ) - track_gain = TQString(TStringToQString( file->APETag()->itemListMap()["REPLAYGAIN_TRACK_GAIN"].toString() )).stripWhiteSpace(); + track_gain = TStringToTQString( file->APETag()->itemListMap()["REPLAYGAIN_TRACK_GAIN"].toString() ).stripWhiteSpace(); if ( !file->APETag()->itemListMap()[ "REPLAYGAIN_ALBUM_GAIN" ].isEmpty() ) - album_gain = TQString(TStringToQString( file->APETag()->itemListMap()["REPLAYGAIN_ALBUM_GAIN"].toString() )).stripWhiteSpace(); + album_gain = TStringToTQString( file->APETag()->itemListMap()["REPLAYGAIN_ALBUM_GAIN"].toString() ).stripWhiteSpace(); } } else if ( TagLib::TTA::File *file = dynamic_cast( fileref.file() ) ) @@ -215,10 +217,10 @@ TagData* TagEngine::readTags( const TQString& file ) if ( file->ID3v2Tag() ) { if ( !file->ID3v2Tag()->frameListMap()[ "TPOS" ].isEmpty() ) - disc = TQString(TStringToQString( file->ID3v2Tag()->frameListMap()["TPOS"].front()->toString() )).stripWhiteSpace(); + disc = TStringToTQString( file->ID3v2Tag()->frameListMap()["TPOS"].front()->toString() ).stripWhiteSpace(); if ( !file->ID3v2Tag()->frameListMap()[ "TCOM" ].isEmpty() ) - tagData->composer = TQString(TStringToQString( file->ID3v2Tag()->frameListMap()["TCOM"].front()->toString() )).stripWhiteSpace(); + tagData->composer = TStringToTQString( file->ID3v2Tag()->frameListMap()["TCOM"].front()->toString() ).stripWhiteSpace(); } }