summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Funk <[email protected]>2017-12-19 13:30:06 +0100
committerKevin Funk <[email protected]>2017-12-19 13:30:06 +0100
commit5e6c6fe0c7a1cc6f16c9c8df1332697c41148fa9 (patch)
treee1b30368523dc9664eeb756a90586b939bed348a
parent575e25d3fb0230aff341850ca37f71db62c587d2 (diff)
Fix TagLib detection and build on Windows
Summary: Due to stricter setups on Windows, TagLib was detected but the includes were not found. This patch fixes this discrepancy. It further fixes some implicit conversions which were disallowed (from QByteArray to TagLib::Filename). End result: kio-extras builds on Windows again. No idea how long it's been like this, but it's a long time. Test Plan: Without patch: cmake finishes and finds taglib, build fails because includes are not found With patch: cmake finishes and finds taglib, build competes because includes are found, and implicit conversions are now explicit. Reviewers: #frameworks, kfunk Reviewed By: kfunk Subscribers: vonreth Differential Revision: https://phabricator.kde.org/D9398
-rw-r--r--cmake/FindTaglib.cmake5
-rw-r--r--thumbnail/audiocreator.cpp18
2 files changed, 12 insertions, 11 deletions
diff --git a/cmake/FindTaglib.cmake b/cmake/FindTaglib.cmake
index a87ffca..d09fb6f 100644
--- a/cmake/FindTaglib.cmake
+++ b/cmake/FindTaglib.cmake
@@ -68,10 +68,11 @@ else(TAGLIBCONFIG_EXECUTABLE)
include(FindPackageHandleStandardArgs)
+ # To avoid issues, make the same assumption as above:
+ # Assume software will include by things like #include <taglib/tfile.h> instead of <tfile.h>
find_path(TAGLIB_INCLUDES
NAMES
- tag.h
- PATH_SUFFIXES taglib
+ taglib/tag.h
PATHS
${INCLUDE_INSTALL_DIR}
)
diff --git a/thumbnail/audiocreator.cpp b/thumbnail/audiocreator.cpp
index d3d3fc8..fb8f92f 100644
--- a/thumbnail/audiocreator.cpp
+++ b/thumbnail/audiocreator.cpp
@@ -163,31 +163,31 @@ bool AudioCreator::create(const QString &path, int, int, QImage &img)
}
if (type.inherits("audio/mpeg")) {
- TagLib::MPEG::File file(QFile::encodeName(path));
+ TagLib::MPEG::File file(QFile::encodeName(path).data());
return parseID3v2Tag(file, img) || parseAPETag(file, img);
}
if (type.inherits("audio/x-flac") || type.inherits("audio/flac")) {
- TagLib::FLAC::File file(QFile::encodeName(path));
+ TagLib::FLAC::File file(QFile::encodeName(path).data());
return parseFlacTag(file, img) || parseID3v2Tag(file, img);
}
if (type.inherits("audio/mp4") || type.inherits("audio/x-m4a")) {
- TagLib::MP4::File file(QFile::encodeName(path));
+ TagLib::MP4::File file(QFile::encodeName(path).data());
return parseMP4Tag(file, img);
}
if (type.inherits("audio/x-ape")) {
- TagLib::APE::File file(QFile::encodeName(path));
+ TagLib::APE::File file(QFile::encodeName(path).data());
return parseAPETag(file, img);
}
if (type.inherits("audio/x-wavpack") || type.inherits("audio/x-vw")) {
- TagLib::WavPack::File file(QFile::encodeName(path));
+ TagLib::WavPack::File file(QFile::encodeName(path).data());
return parseAPETag(file, img);
}
if (type.inherits("audio/x-musepack")) {
- TagLib::MPC::File file(QFile::encodeName(path));
+ TagLib::MPC::File file(QFile::encodeName(path).data());
return parseAPETag(file, img);
}
if (type.inherits("audio/ogg") || type.inherits("audio/vorbis")) {
- TagLib::FileRef fileRef(QFile::encodeName(path));
+ TagLib::FileRef fileRef(QFile::encodeName(path).data());
if (fileRef.isNull()) {
return false;
}
@@ -198,11 +198,11 @@ bool AudioCreator::create(const QString &path, int, int, QImage &img)
return parseFlacTag(*xiphComment, img);
}
if (type.inherits("audio/x-aiff")) {
- TagLib::RIFF::AIFF::FileExt file(QFile::encodeName(path));
+ TagLib::RIFF::AIFF::FileExt file(QFile::encodeName(path).data());
return parseID3v2Tag(file, img);
}
if (type.inherits("audio/x-wav")) {
- TagLib::RIFF::WAV::File file(QFile::encodeName(path));
+ TagLib::RIFF::WAV::File file(QFile::encodeName(path).data());
return parseID3v2Tag(file, img);
}
return false;