Description: support Qt 6.10 Author: Nicolas Werner Origin: upstream, https://github.com/Nheko-Reborn/nheko/commit/93ce60d Bug-Debian: https://bugs.debian.org/1127886 Last-Update: 2026-02-14 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -712,7 +712,9 @@ # # 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 --- a/src/MxcImageProvider.cpp +++ b/src/MxcImageProvider.cpp @@ -299,12 +299,10 @@ "/media_cache", fileName); QDir().mkpath(fileInfo.absolutePath()); + QFile f(fileInfo.absoluteFilePath()); - if (fileInfo.exists()) { + if (fileInfo.exists() && f.open(QIODevice::ReadOnly)) { if (encryptionInfo) { - QFile f(fileInfo.absoluteFilePath()); - f.open(QIODevice::ReadOnly); - QByteArray fileData = f.readAll(); auto tempData = mtx::crypto::to_string( mtx::crypto::decrypt_file(fileData.toStdString(), encryptionInfo.value())); --- a/src/timeline/RoomlistModel.cpp +++ b/src/timeline/RoomlistModel.cpp @@ -977,6 +977,10 @@ void FilteredRoomlistModel::updateHiddenTagsAndSpaces() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0) + beginFilterChange(); +#endif + hiddenTags.clear(); hiddenSpaces.clear(); hideDMs = false; @@ -991,7 +995,11 @@ hideDMs = true; } +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) + endFilterChange(); +#else invalidateFilter(); +#endif } bool --- a/src/timeline/RoomlistModel.h +++ b/src/timeline/RoomlistModel.h @@ -212,6 +212,10 @@ 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 @@ filterStr.clear(); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) + endFilterChange(); +#else invalidateFilter(); +#endif } void updateHiddenTagsAndSpaces(); --- a/src/timeline/TimelineFilter.cpp +++ b/src/timeline/TimelineFilter.cpp @@ -41,7 +41,13 @@ { incrementalSearchIndex = 0; emit isFilteringChanged(); + +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) + endFilterChange(); +#else invalidateFilter(); +#endif + beginResetModel(); endResetModel(); @@ -157,6 +163,10 @@ 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; @@ -191,7 +201,12 @@ emit sourceChanged(); emit isFilteringChanged(); + +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) + endFilterChange(); +#else invalidateFilter(); +#endif } }