Remove Qt5 compatibility ifdefs
This commit is contained in:
@@ -134,7 +134,7 @@ int ChatDocumentHandler::completionStartIndex() const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(Q_OS_ANDROID) && QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
|
#if !defined(Q_OS_ANDROID)
|
||||||
const long long cursor = cursorPosition();
|
const long long cursor = cursorPosition();
|
||||||
#else
|
#else
|
||||||
const auto cursor = cursorPosition();
|
const auto cursor = cursorPosition();
|
||||||
|
|||||||
@@ -4,11 +4,7 @@
|
|||||||
|
|
||||||
#include "controller.h"
|
#include "controller.h"
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
#include <qt5keychain/keychain.h>
|
|
||||||
#else
|
|
||||||
#include <qt6keychain/keychain.h>
|
#include <qt6keychain/keychain.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <KConfig>
|
#include <KConfig>
|
||||||
#include <KConfigGroup>
|
#include <KConfigGroup>
|
||||||
|
|||||||
10
src/main.cpp
10
src/main.cpp
@@ -140,19 +140,13 @@ Q_DECL_EXPORT
|
|||||||
#endif
|
#endif
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||||
|
|
||||||
#ifdef HAVE_WEBVIEW
|
#ifdef HAVE_WEBVIEW
|
||||||
QtWebView::initialize();
|
QtWebView::initialize();
|
||||||
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
|
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
|
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef Q_OS_ANDROID
|
#ifdef Q_OS_ANDROID
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
@@ -311,10 +305,6 @@ int main(int argc, char *argv[])
|
|||||||
return engine->toScriptValue(LocationHelper());
|
return engine->toScriptValue(LocationHelper());
|
||||||
});
|
});
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
qRegisterMetaTypeStreamOperators<Emoji>();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
|
|
||||||
#ifdef HAVE_KDBUSADDONS
|
#ifdef HAVE_KDBUSADDONS
|
||||||
|
|||||||
@@ -22,11 +22,7 @@ bool CompletionProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &so
|
|||||||
&& sourceModel()
|
&& sourceModel()
|
||||||
->data(sourceModel()->index(sourceRow, 0), secondaryFilterRole())
|
->data(sourceModel()->index(sourceRow, 0), secondaryFilterRole())
|
||||||
.toString()
|
.toString()
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
.startsWith(QStringView(m_filterText).sliced(1), Qt::CaseInsensitive));
|
.startsWith(QStringView(m_filterText).sliced(1), Qt::CaseInsensitive));
|
||||||
#else
|
|
||||||
.startsWith(m_filterText.midRef(1), Qt::CaseInsensitive));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CompletionProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
|
bool CompletionProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
|
||||||
|
|||||||
@@ -10,11 +10,7 @@
|
|||||||
#include "jobs/neochatdeactivateaccountjob.h"
|
#include "jobs/neochatdeactivateaccountjob.h"
|
||||||
#include "roommanager.h"
|
#include "roommanager.h"
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
#include <qt5keychain/keychain.h>
|
|
||||||
#else
|
|
||||||
#include <qt6keychain/keychain.h>
|
#include <qt6keychain/keychain.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
|
||||||
|
|||||||
@@ -178,17 +178,9 @@ QCoro::Task<void> NeoChatRoom::doUploadFile(QUrl url, QString body)
|
|||||||
content = new EventContent::AudioContent(url, fileInfo.size(), mime, fileInfo.fileName());
|
content = new EventContent::AudioContent(url, fileInfo.size(), mime, fileInfo.fileName());
|
||||||
} else if (mime.name().startsWith("video/"_ls)) {
|
} else if (mime.name().startsWith("video/"_ls)) {
|
||||||
QMediaPlayer player;
|
QMediaPlayer player;
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
player.setSource(url);
|
player.setSource(url);
|
||||||
#else
|
|
||||||
player.setMedia(url);
|
|
||||||
#endif
|
|
||||||
co_await qCoro(&player, &QMediaPlayer::mediaStatusChanged);
|
co_await qCoro(&player, &QMediaPlayer::mediaStatusChanged);
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
auto resolution = player.metaData().value(QMediaMetaData::Resolution).toSize();
|
auto resolution = player.metaData().value(QMediaMetaData::Resolution).toSize();
|
||||||
#else
|
|
||||||
auto resolution = player.metaData(QMediaMetaData::Resolution).toSize();
|
|
||||||
#endif
|
|
||||||
content = new EventContent::VideoContent(url, fileInfo.size(), mime, resolution, fileInfo.fileName());
|
content = new EventContent::VideoContent(url, fileInfo.size(), mime, resolution, fileInfo.fileName());
|
||||||
} else {
|
} else {
|
||||||
content = new EventContent::FileContent(url, fileInfo.size(), mime, fileInfo.fileName());
|
content = new EventContent::FileContent(url, fileInfo.size(), mime, fileInfo.fileName());
|
||||||
|
|||||||
@@ -17,11 +17,7 @@ TrayIcon::TrayIcon(QObject *parent)
|
|||||||
});
|
});
|
||||||
|
|
||||||
connect(&WindowController::instance(), &WindowController::windowChanged, this, [this] {
|
connect(&WindowController::instance(), &WindowController::windowChanged, this, [this] {
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
setAssociatedWindow(WindowController::instance().window());
|
setAssociatedWindow(WindowController::instance().window());
|
||||||
#else
|
|
||||||
Q_UNUSED(this);
|
|
||||||
#endif
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user