Qt 6.10 compat

This commit is contained in:
Nicolas Werner 2025-12-26 18:34:30 +01:00
parent 1bd2970c4d
commit 93ce60d6f1
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
5 changed files with 36 additions and 5 deletions

View file

@ -712,7 +712,9 @@ set_target_properties(nheko
#
# Add qml files
#
if(QT_KNOWN_POLICY_QTP0004)
qt_policy(SET QTP0004 NEW)
endif()
set(QML_SOURCES
resources/qml/Root.qml
resources/qml/ChatPage.qml

View file

@ -299,12 +299,10 @@ MxcImageProvider::download(const QString &id,
"/media_cache",
fileName);
QDir().mkpath(fileInfo.absolutePath());
if (fileInfo.exists()) {
if (encryptionInfo) {
QFile f(fileInfo.absoluteFilePath());
f.open(QIODevice::ReadOnly);
if (fileInfo.exists() && f.open(QIODevice::ReadOnly)) {
if (encryptionInfo) {
QByteArray fileData = f.readAll();
auto tempData = mtx::crypto::to_string(
mtx::crypto::decrypt_file(fileData.toStdString(), encryptionInfo.value()));

View file

@ -977,6 +977,10 @@ FilteredRoomlistModel::getRoomById(const QString &id) const
void
FilteredRoomlistModel::updateHiddenTagsAndSpaces()
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
beginFilterChange();
#endif
hiddenTags.clear();
hiddenSpaces.clear();
hideDMs = false;
@ -991,7 +995,11 @@ FilteredRoomlistModel::updateHiddenTagsAndSpaces()
hideDMs = true;
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
endFilterChange();
#else
invalidateFilter();
#endif
}
bool

View file

@ -212,6 +212,10 @@ public slots:
void updateFilterTag(QString tagId)
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
beginFilterChange();
#endif
if (tagId.startsWith(QLatin1String("tag:"))) {
filterType = FilterBy::Tag;
filterStr = tagId.mid(4);
@ -227,7 +231,11 @@ public slots:
filterStr.clear();
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
endFilterChange();
#else
invalidateFilter();
#endif
}
void updateHiddenTagsAndSpaces();

View file

@ -41,7 +41,13 @@ TimelineFilter::startFiltering()
{
incrementalSearchIndex = 0;
emit isFilteringChanged();
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
endFilterChange();
#else
invalidateFilter();
#endif
beginResetModel();
endResetModel();
@ -181,6 +187,10 @@ void
TimelineFilter::setSource(TimelineModel *s)
{
if (auto orig = this->source(); orig != s) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
beginFilterChange();
#endif
cachedCount = 0;
incrementalSearchIndex = 0;
@ -215,7 +225,12 @@ TimelineFilter::setSource(TimelineModel *s)
emit sourceChanged();
emit isFilteringChanged();
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
endFilterChange();
#else
invalidateFilter();
#endif
}
}