| 1 |
Description: support Qt 6.10 |
| 2 |
Author: Nicolas Werner <[email protected]> |
| 3 |
Origin: upstream, https://github.com/Nheko-Reborn/nheko/commit/93ce60d |
| 4 |
Bug-Debian: https://bugs.debian.org/1127886 |
| 5 |
Last-Update: 2026-02-14 |
| 6 |
--- |
| 7 |
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ |
| 8 |
--- a/CMakeLists.txt |
| 9 |
+++ b/CMakeLists.txt |
| 10 |
@@ -712,7 +712,9 @@ |
| 11 |
# |
| 12 |
# Add qml files |
| 13 |
# |
| 14 |
|
| 15 |
+if(QT_KNOWN_POLICY_QTP0004) |
| 16 |
+ qt_policy(SET QTP0004 NEW) |
| 17 |
+endif() |
| 18 |
set(QML_SOURCES |
| 19 |
resources/qml/Root.qml |
| 20 |
resources/qml/ChatPage.qml |
| 21 |
--- a/src/MxcImageProvider.cpp |
| 22 |
+++ b/src/MxcImageProvider.cpp |
| 23 |
@@ -299,12 +299,10 @@ |
| 24 |
"/media_cache", |
| 25 |
fileName); |
| 26 |
QDir().mkpath(fileInfo.absolutePath()); |
| 27 |
+ QFile f(fileInfo.absoluteFilePath()); |
| 28 |
|
| 29 |
|
| 30 |
+ if (fileInfo.exists() && f.open(QIODevice::ReadOnly)) { |
| 31 |
if (encryptionInfo) { |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
QByteArray fileData = f.readAll(); |
| 36 |
auto tempData = mtx::crypto::to_string( |
| 37 |
mtx::crypto::decrypt_file(fileData.toStdString(), encryptionInfo.value())); |
| 38 |
--- a/src/timeline/RoomlistModel.cpp |
| 39 |
+++ b/src/timeline/RoomlistModel.cpp |
| 40 |
@@ -977,6 +977,10 @@ |
| 41 |
void |
| 42 |
FilteredRoomlistModel::updateHiddenTagsAndSpaces() |
| 43 |
{ |
| 44 |
+#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0) |
| 45 |
+ beginFilterChange(); |
| 46 |
+#endif |
| 47 |
+ |
| 48 |
hiddenTags.clear(); |
| 49 |
hiddenSpaces.clear(); |
| 50 |
hideDMs = false; |
| 51 |
@@ -991,7 +995,11 @@ |
| 52 |
hideDMs = true; |
| 53 |
} |
| 54 |
|
| 55 |
+#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 56 |
+ endFilterChange(); |
| 57 |
+#else |
| 58 |
invalidateFilter(); |
| 59 |
+#endif |
| 60 |
} |
| 61 |
|
| 62 |
bool |
| 63 |
--- a/src/timeline/RoomlistModel.h |
| 64 |
+++ b/src/timeline/RoomlistModel.h |
| 65 |
@@ -212,6 +212,10 @@ |
| 66 |
|
| 67 |
void updateFilterTag(QString tagId) |
| 68 |
{ |
| 69 |
+#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 70 |
+ beginFilterChange(); |
| 71 |
+#endif |
| 72 |
+ |
| 73 |
if (tagId.startsWith(QLatin1String("tag:"))) { |
| 74 |
filterType = FilterBy::Tag; |
| 75 |
filterStr = tagId.mid(4); |
| 76 |
@@ -227,7 +231,11 @@ |
| 77 |
filterStr.clear(); |
| 78 |
} |
| 79 |
|
| 80 |
+#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 81 |
+ endFilterChange(); |
| 82 |
+#else |
| 83 |
invalidateFilter(); |
| 84 |
+#endif |
| 85 |
} |
| 86 |
|
| 87 |
void updateHiddenTagsAndSpaces(); |
| 88 |
--- a/src/timeline/TimelineFilter.cpp |
| 89 |
+++ b/src/timeline/TimelineFilter.cpp |
| 90 |
@@ -41,7 +41,13 @@ |
| 91 |
{ |
| 92 |
incrementalSearchIndex = 0; |
| 93 |
emit isFilteringChanged(); |
| 94 |
+ |
| 95 |
+#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 96 |
+ endFilterChange(); |
| 97 |
+#else |
| 98 |
invalidateFilter(); |
| 99 |
+#endif |
| 100 |
+ |
| 101 |
beginResetModel(); |
| 102 |
endResetModel(); |
| 103 |
|
| 104 |
@@ -157,6 +163,10 @@ |
| 105 |
TimelineFilter::setSource(TimelineModel *s) |
| 106 |
{ |
| 107 |
if (auto orig = this->source(); orig != s) { |
| 108 |
+#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 109 |
+ beginFilterChange(); |
| 110 |
+#endif |
| 111 |
+ |
| 112 |
cachedCount = 0; |
| 113 |
incrementalSearchIndex = 0; |
| 114 |
|
| 115 |
@@ -191,7 +201,12 @@ |
| 116 |
|
| 117 |
emit sourceChanged(); |
| 118 |
emit isFilteringChanged(); |
| 119 |
+ |
| 120 |
+#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) |
| 121 |
+ endFilterChange(); |
| 122 |
+#else |
| 123 |
invalidateFilter(); |
| 124 |
+#endif |
| 125 |
} |
| 126 |
} |
| 127 |
|