Commit f074bda4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some qt6 compile error

parent 970106d8
......@@ -617,7 +617,9 @@ void MANProtocol::outputHeader(QTextStream &os, const QString &header, const QSt
{
const QString pageTitle = (!title.isEmpty() ? title : header);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
os.setCodec("UTF-8");
#endif
// The same header and styling as generated by man2html
os << "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
......@@ -1125,7 +1127,9 @@ void MANProtocol::showIndex(const QString& section)
QByteArray array_d;
QTextStream os(&array_d, QIODevice::WriteOnly);
os.setCodec( "UTF-8" );
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
os.setCodec("UTF-8");
#endif
os << "<div class=\"secidxmain\">\n";
// compose list of search paths -------------------------------------------------------------
......
......@@ -338,7 +338,7 @@ void ThumbnailProtocol::get(const QUrl &url)
static QVector<KPluginMetaData> availablePlugins()
{
auto jsonMetaDataPlugins = KPluginMetaData::findPlugins(QStringLiteral("kf5/thumbcreator"));
auto jsonMetaDataPlugins = KPluginMetaData::findPlugins(QStringLiteral("kf" QT_STRINGIFY(QT_VERSION_MAJOR) "/thumbcreator"));
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
......@@ -364,7 +364,7 @@ QString ThumbnailProtocol::pluginForMimeType(const QString& mimeType) {
const QStringList mimeTypes = plugin.mimeTypes() + plugin.value(QStringLiteral("ServiceTypes"), QStringList());
for (const QString& mime : mimeTypes) {
if(mime.endsWith('*')) {
const auto mimeGroup = mime.leftRef(mime.length()-1);
const auto mimeGroup = QStringView(mime).left(mime.length()-1);
if(mimeType.startsWith(mimeGroup))
return plugin.fileName();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment