Qt 6.10 compat
This commit is contained in:
parent
1bd2970c4d
commit
93ce60d6f1
5 changed files with 36 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue