Compare commits

..

15 Commits

Author SHA1 Message Date
Joshua Goins
a4e6f0c4c2 Add spell-checking suggestions to the chat bar context menu
This is natively integrated into the existing chat document handler, and
emulates normal Sonnet behavior.
2023-09-13 13:06:05 +00:00
Tobias Fella
6439fa48f9 Adapt to QML api changes 2023-09-13 12:57:27 +00:00
Tobias Fella
823f3cdd4e Remove QML Qt5/Qt6 compatibility hacks 2023-09-13 12:57:27 +00:00
Tobias Fella
f542d0b9fd Change rowStride in runner to qsizetype 2023-09-13 14:53:07 +02:00
Tobias Fella
a43990559b Rename source property of MessageDelegateContextMenu
Starting with Qt6.6, this collides with a FINAL property of Loader and thus doesn't run
2023-09-13 14:16:48 +02:00
Tobias Fella
feb2dbc9fb Don't try finding KStatusNotifierItem on android 2023-09-13 12:05:40 +00:00
Tobias Fella
f299d5a245 Fix KF6 crash in emoji completion 2023-09-13 13:41:08 +02:00
Tobias Fella
d69b8fbf8c Fix compilation on FreeBSD 2023-09-13 13:27:33 +02:00
Tobias Fella
234e5c49c4 Re-enable FreeBSD CI
Was accidentally disabled during a merge
2023-09-13 13:23:45 +02:00
Tobias Fella
cee72b6d48 Remove Qt5 compatibility ifdefs 2023-09-13 11:16:02 +00:00
Tobias Fella
539fdcaf2e Remove compatibility with Qt5 in CMake 2023-09-13 11:09:41 +00:00
Joshua Goins
32b3861c3e Only show the "View Source" message action when dev tools are enabled
This is a very developer-oriented action, and other uses of this dialog
(such as interacting with room state events under a room debug page) is
also locked behind this option.
2023-09-13 07:12:18 +00:00
l10n daemon script
f1076a5ced GIT_SILENT Sync po/docbooks with svn 2023-09-13 02:24:16 +00:00
Joshua Goins
bf8f5705d0 Fix message event source dialog not showing any data 2023-09-12 17:10:23 -04:00
Tobias Fella
2656a93ee7 Disable Qt5 CI 2023-09-12 15:39:25 +00:00
34 changed files with 953 additions and 922 deletions

View File

@@ -3,12 +3,8 @@
include:
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/reuse-lint.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/android.yml
# - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/android-qt6.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux-qt6.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/windows.yml
# - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/windows-qt6.yml
# - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml
# - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd-qt6.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/flatpak.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd-qt6.yml
# - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/flatpak.yml

View File

@@ -2,35 +2,7 @@
# SPDX-License-Identifier: BSD-2-Clause
Dependencies:
- 'on': ['Linux/Qt5', 'Android/Qt5', 'FreeBSD/Qt5', 'Windows/Qt5']
'require':
'frameworks/extra-cmake-modules': '@stable'
'frameworks/kcoreaddons': '@stable'
'frameworks/kirigami': '@stable'
'frameworks/ki18n': '@stable'
'frameworks/kconfig': '@stable'
'frameworks/syntax-highlighting': '@stable'
'frameworks/kitemmodels': '@stable'
'frameworks/kquickcharts': '@stable'
'frameworks/knotifications': '@stable'
'libraries/kquickimageeditor': '@stable'
'frameworks/sonnet': '@stable'
'libraries/kirigami-addons': '@latest'
'third-party/libquotient': '@latest'
'third-party/qtkeychain': '@latest'
'third-party/cmark': '@latest'
'third-party/qcoro': '@latest'
- 'on': ['Windows/Qt5', 'Linux/Qt5', 'FreeBSD/Qt5']
'require':
'frameworks/qqc2-desktop-style': '@stable'
'frameworks/kio': '@stable'
'frameworks/kwindowsystem': '@stable'
'frameworks/kconfigwidgets': '@stable'
- 'on': ['Linux/Qt5', 'FreeBSD/Qt5']
'require':
'frameworks/kdbusaddons': '@stable'
- 'on': ['Linux/Qt6', 'Android/Qt6', 'FreeBSD/Qt6', 'Windows/Qt6']
- 'on': ['Linux', 'Android', 'FreeBSD', 'Windows']
'require':
'frameworks/extra-cmake-modules': '@latest-kf6'
'frameworks/kcoreaddons': '@latest-kf6'
@@ -48,21 +20,21 @@ Dependencies:
'third-party/qtkeychain': '@latest'
'third-party/cmark': '@latest'
'third-party/qcoro': '@latest'
- 'on': ['Windows/Qt6', 'Linux/Qt6', 'FreeBSD/Qt6']
- 'on': ['Windows', 'Linux', 'FreeBSD']
'require':
'frameworks/qqc2-desktop-style': '@latest-kf6'
'frameworks/kio': '@latest-kf6'
'frameworks/kwindowsystem': '@latest-kf6'
'frameworks/kconfigwidgets': '@latest-kf6'
- 'on': ['Linux/Qt6', 'FreeBSD/Qt6']
- 'on': ['Linux', 'FreeBSD']
'require':
'frameworks/kdbusaddons': '@latest-kf6'
'frameworks/kstatusnotifieritem': '@latest-kf6'
- 'on': ['Linux/Qt6', 'Linux/Qt5']
- 'on': ['Linux']
'require':
'sdk/selenium-webdriver-at-spi': '@latest-kf6'
Options:
per-test-timeout: 90
require-passing-tests-on: [ 'Linux/Qt5', 'FreeBSD', 'Windows' ]
require-passing-tests-on: [ 'FreeBSD', 'Windows' ]

View File

@@ -14,11 +14,8 @@ set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_
project(NeoChat VERSION ${RELEASE_SERVICE_VERSION})
set(KF_MIN_VERSION "5.105.0")
set(QT_MIN_VERSION "5.15.2")
if (ANDROID)
set(QT_MIN_VERSION "5.15.10")
endif()
set(KF_MIN_VERSION "5.240.0")
set(QT_MIN_VERSION "6.5")
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
@@ -48,28 +45,6 @@ if(NEOCHAT_FLATPAK)
include(cmake/Flatpak.cmake)
endif()
if(QT_MAJOR_VERSION STREQUAL "6")
set(BASICLISTITEM_BOLD "font.bold")
set(OVERLAYSHEET_OPEN "onOpened")
set(QTQUICK_MODULE_QML_VERSION "")
set(QTLOCATION_MODULE_QML_VERSION "")
set(QTMULTIMEDIA_MODULE_QML_VERSION "")
set(QTMULTIMEDIA_AUDIO "MediaPlayer")
# in Audio qt6 we don't have it but we disable it in qt5 => it seems ok
set(QTMULTIMEDIA_AUDIO_AUTOLOAD "")
# In Video qml qt6 we don't have it.
set(QTMULTIMEDIA_VIDEO_FLUSHMODE "")
else()
set(BASICLISTITEM_BOLD "bold")
set(OVERLAYSHEET_OPEN "onSheetOpenChanged")
set(QTQUICK_MODULE_QML_VERSION "2.15")
set(QTLOCATION_MODULE_QML_VERSION "5.15")
set(QTMULTIMEDIA_MODULE_QML_VERSION "5.15")
set(QTMULTIMEDIA_AUDIO "Audio")
set(QTMULTIMEDIA_AUDIO_AUTOLOAD "autoLoad: false")
set(QTMULTIMEDIA_VIDEO_FLUSHMODE "flushMode: VideoOutput.FirstFrame")
endif()
set(QUOTIENT_FORCE_NAMESPACED_INCLUDES TRUE)
ecm_setup_version(${PROJECT_VERSION}
@@ -77,25 +52,21 @@ ecm_setup_version(${PROJECT_VERSION}
VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/neochat-version.h
)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} NO_MODULE COMPONENTS Core Quick Gui QuickControls2 Multimedia Svg WebView)
set_package_properties(Qt${QT_MAJOR_VERSION} PROPERTIES
find_package(Qt6 ${QT_MIN_VERSION} NO_MODULE COMPONENTS Core Quick Gui QuickControls2 Multimedia Svg WebView)
set_package_properties(Qt6 PROPERTIES
TYPE REQUIRED
PURPOSE "Basic application components"
)
find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} COMPONENTS Kirigami2 I18n Notifications Config CoreAddons Sonnet ItemModels SyntaxHighlighting)
set_package_properties(KF${QT_MAJOR_VERSION} PROPERTIES
find_package(KF6 ${KF_MIN_VERSION} COMPONENTS Kirigami2 I18n Notifications Config CoreAddons Sonnet ItemModels)
set_package_properties(KF6 PROPERTIES
TYPE REQUIRED
PURPOSE "Basic application components"
)
set_package_properties(KF${QT_MAJOR_VERSION}Kirigami2 PROPERTIES
set_package_properties(KF6Kirigami2 PROPERTIES
TYPE REQUIRED
PURPOSE "Kirigami application UI framework"
)
find_package(KF${QT_MAJOR_VERSION}KirigamiAddons 0.7.2 REQUIRED)
if(QT_MAJOR_VERSION STREQUAL "6")
find_package(KF6StatusNotifierItem ${KF_MIN_VERSION} REQUIRED)
endif()
find_package(KF6KirigamiAddons 0.7.2 REQUIRED)
if(ANDROID)
find_package(OpenSSL)
@@ -104,24 +75,20 @@ if(ANDROID)
PURPOSE "Encrypted communications"
)
else()
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} COMPONENTS Widgets)
find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS QQC2DesktopStyle ConfigWidgets KIO WindowSystem)
set_package_properties(KF${QT_MAJOR_VERSION}QQC2DesktopStyle PROPERTIES
find_package(Qt6 ${QT_MIN_VERSION} COMPONENTS Widgets)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS QQC2DesktopStyle ConfigWidgets KIO WindowSystem StatusNotifierItem)
set_package_properties(KF6QQC2DesktopStyle PROPERTIES
TYPE RUNTIME
)
ecm_find_qmlmodule(org.kde.syntaxhighlighting 1.0)
endif()
if (NOT ANDROID AND NOT WIN32 AND NOT APPLE)
find_package(KF${QT_MAJOR_VERSION}DBusAddons ${KF_MIN_VERSION} REQUIRED)
find_package(KF6DBusAddons ${KF_MIN_VERSION} REQUIRED)
endif()
if(QT_MAJOR_VERSION STREQUAL "6" AND NOT ANDROID AND NOT WIN32)
set(QUOTIENT_SUFFIX "Qt6")
endif()
find_package(Quotient${QUOTIENT_SUFFIX} 0.7)
set_package_properties(Quotient${QUOTIENT_SUFFIX} PROPERTIES
find_package(QuotientQt6 0.7)
set_package_properties(QuotientQt6 PROPERTIES
TYPE REQUIRED
DESCRIPTION "Qt wrapper around Matrix API"
URL "https://github.com/quotient-im/libQuotient/"
@@ -154,12 +121,12 @@ set_package_properties(KQuickImageEditor PROPERTIES
PURPOSE "Add image editing capability to image attachments"
)
find_package(QCoro${QT_MAJOR_VERSION} 0.4 COMPONENTS Core REQUIRED)
find_package(QCoro6 0.4 COMPONENTS Core REQUIRED)
qcoro_enable_coroutines()
find_package(KF${QT_MAJOR_VERSION}DocTools ${KF_MIN_VERSION})
set_package_properties(KF${QT_MAJOR_VERSION}DocTools PROPERTIES DESCRIPTION
find_package(KF6DocTools ${KF_MIN_VERSION})
set_package_properties(KF6DocTools PROPERTIES DESCRIPTION
"Tools to generate documentation"
TYPE OPTIONAL
)
@@ -181,12 +148,12 @@ add_definitions(-DQT_NO_FOREACH)
add_subdirectory(src)
if (BUILD_TESTING)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} NO_MODULE COMPONENTS Test)
find_package(Qt6 ${QT_MIN_VERSION} NO_MODULE COMPONENTS Test)
add_subdirectory(autotests)
add_subdirectory(appiumtests)
endif()
if(KF${QT_MAJOR_VERSION}DocTools_FOUND)
if(KF6DocTools_FOUND)
kdoctools_install(po)
add_subdirectory(doc)
endif()

File diff suppressed because it is too large Load Diff

View File

@@ -3,15 +3,6 @@
# SPDX-FileCopyrightText: 2020-2021 Tobias Fella <tobias.fella@kde.org>
# SPDX-License-Identifier: BSD-2-Clause
configure_file(qml/Page/RoomList/RoomDelegate.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Page/RoomList/RoomDelegate.qml)
configure_file(qml/Component/QuickSwitcher.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Component/QuickSwitcher.qml)
configure_file(qml/Dialog/PowerLevelDialog.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Dialog/PowerLevelDialog.qml)
configure_file(qml/Component/Timeline/AudioDelegate.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Component/Timeline/AudioDelegate.qml)
configure_file(qml/Component/Timeline/VideoDelegate.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Component/Timeline/VideoDelegate.qml)
configure_file(qml/Component/Timeline/OsmLocationPlugin.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Component/Timeline/OsmLocationPlugin.qml)
configure_file(res.qrc ${CMAKE_CURRENT_SOURCE_DIR}/res.generated.qrc)
add_library(neochat STATIC
controller.cpp
controller.h
@@ -136,7 +127,6 @@ add_library(neochat STATIC
mediasizehelper.h
eventhandler.cpp
enums/delegatetype.h
messageformatter.cpp
)
ecm_qt_declare_logging_category(neochat
@@ -157,7 +147,7 @@ ecm_qt_declare_logging_category(neochat
add_executable(neochat-app
main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/res.generated.qrc
res.qrc
)
if(TARGET Qt::WebView)
@@ -179,13 +169,11 @@ if(NOT ANDROID)
target_sources(neochat PRIVATE colorschemer.cpp colorschemer.h)
if (NOT WIN32 AND NOT APPLE)
target_sources(neochat PRIVATE trayicon_sni.cpp trayicon_sni.h)
if(QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(neochat PRIVATE KF6::StatusNotifierItem)
endif()
target_link_libraries(neochat PRIVATE KF6::StatusNotifierItem)
else()
target_sources(neochat PRIVATE trayicon.cpp trayicon.h)
endif()
target_link_libraries(neochat PUBLIC KF${QT_MAJOR_VERSION}::ConfigWidgets KF${QT_MAJOR_VERSION}::WindowSystem)
target_link_libraries(neochat PUBLIC KF6::ConfigWidgets KF6::WindowSystem)
target_compile_definitions(neochat PUBLIC -DHAVE_COLORSCHEME)
target_compile_definitions(neochat PUBLIC -DHAVE_WINDOWSYSTEM)
endif()
@@ -200,7 +188,7 @@ else()
endif()
target_include_directories(neochat PRIVATE ${CMAKE_BINARY_DIR})
target_link_libraries(neochat PUBLIC Qt::Core Qt::Quick Qt::Qml Qt::Gui Qt::Multimedia Qt::Network Qt::QuickControls2 Qt::Xml KF${QT_MAJOR_VERSION}::I18n KF${QT_MAJOR_VERSION}::Kirigami2 KF${QT_MAJOR_VERSION}::Notifications KF${QT_MAJOR_VERSION}::ConfigCore KF${QT_MAJOR_VERSION}::ConfigGui KF${QT_MAJOR_VERSION}::CoreAddons KF${QT_MAJOR_VERSION}::SonnetCore KF${QT_MAJOR_VERSION}::ItemModels KF${QT_MAJOR_VERSION}::SyntaxHighlighting Quotient${QUOTIENT_SUFFIX} cmark::cmark QCoro::Core)
target_link_libraries(neochat PUBLIC Qt::Core Qt::Quick Qt::Qml Qt::Gui Qt::Multimedia Qt::Network Qt::QuickControls2 KF6::I18n KF6::Kirigami2 KF6::Notifications KF6::ConfigCore KF6::ConfigGui KF6::CoreAddons KF6::SonnetCore KF6::ItemModels QuotientQt6 cmark::cmark QCoro::Core)
kconfig_add_kcfg_files(neochat GENERATE_MOC neochatconfig.kcfgc)
@@ -288,7 +276,7 @@ if(ANDROID)
"gps"
)
else()
target_link_libraries(neochat PUBLIC Qt::Widgets KF${QT_MAJOR_VERSION}::KIOWidgets)
target_link_libraries(neochat PUBLIC Qt::Widgets KF6::KIOWidgets)
install(FILES neochat.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
endif()
@@ -296,12 +284,12 @@ if(NOT ANDROID)
set_target_properties(neochat-app PROPERTIES OUTPUT_NAME "neochat")
endif()
if(TARGET KF${QT_MAJOR_VERSION}::DBusAddons)
target_link_libraries(neochat PUBLIC KF${QT_MAJOR_VERSION}::DBusAddons)
if(TARGET KF6::DBusAddons)
target_link_libraries(neochat PUBLIC KF6::DBusAddons)
target_compile_definitions(neochat PUBLIC -DHAVE_KDBUSADDONS)
endif()
if (TARGET KF${QT_MAJOR_VERSION}::KIOWidgets)
if (TARGET KF6::KIOWidgets)
target_compile_definitions(neochat PUBLIC -DHAVE_KIO)
endif()

View File

@@ -90,6 +90,11 @@ public:
}),
mentions->end());
}
QStringList suggestions(const QString &word) const
{
return checker->suggest(word);
}
};
ChatDocumentHandler::ChatDocumentHandler(QObject *parent)
@@ -134,7 +139,7 @@ int ChatDocumentHandler::completionStartIndex() const
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();
#else
const auto cursor = cursorPosition();
@@ -263,6 +268,47 @@ void ChatDocumentHandler::complete(int index)
}
}
QStringList ChatDocumentHandler::getSuggestions(int mousePosition)
{
QTextCursor cursorAtMouse(document()->textDocument());
cursorAtMouse.setPosition(mousePosition);
// Get the word under the (mouse-)cursor and see if it is misspelled.
// Don't include apostrophes at the start/end of the word in the selection.
QTextCursor wordSelectCursor(cursorAtMouse);
wordSelectCursor.clearSelection();
wordSelectCursor.select(QTextCursor::WordUnderCursor);
m_selectedWord = wordSelectCursor.selectedText();
return m_highlighter->suggestions(m_selectedWord);
}
bool ChatDocumentHandler::getActive() const
{
return m_highlighter->settings.checkerEnabledByDefault();
}
bool ChatDocumentHandler::getIsWordIsMisspelled() const
{
return !m_highlighter->errors.isEmpty();
}
QString ChatDocumentHandler::getWordUnderMouse() const
{
return m_selectedWord;
}
void ChatDocumentHandler::replaceWord(const QString &word)
{
QTextCursor cursor(document()->textDocument());
const auto &text = m_room->chatBoxText();
auto at = text.indexOf(m_highlighter->previousText);
cursor.setPosition(at);
cursor.setPosition(at + m_highlighter->previousText.length(), QTextCursor::KeepAnchor);
cursor.insertText(word);
}
CompletionModel *ChatDocumentHandler::completionModel() const
{
return m_completionModel;

View File

@@ -87,6 +87,10 @@ class ChatDocumentHandler : public QObject
*/
Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged)
Q_PROPERTY(bool active READ getActive NOTIFY cursorPositionChanged)
Q_PROPERTY(bool wordIsMisspelled READ getIsWordIsMisspelled NOTIFY cursorPositionChanged)
Q_PROPERTY(QString wordUnderMouse READ getWordUnderMouse NOTIFY cursorPositionChanged)
/**
* @brief The current CompletionModel.
*
@@ -133,6 +137,12 @@ public:
Q_INVOKABLE void complete(int index);
Q_INVOKABLE void replaceWord(const QString &word);
Q_INVOKABLE QStringList getSuggestions(int mousePosition);
bool getActive() const;
bool getIsWordIsMisspelled() const;
QString getWordUnderMouse() const;
void updateCompletions();
CompletionModel *completionModel() const;
@@ -178,4 +188,6 @@ private:
CompletionModel::AutoCompletionType m_completionType = CompletionModel::None;
CompletionModel *m_completionModel = nullptr;
QString m_selectedWord;
};

View File

@@ -4,11 +4,7 @@
#include "controller.h"
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <qt5keychain/keychain.h>
#else
#include <qt6keychain/keychain.h>
#endif
#include <KConfig>
#include <KConfigGroup>

View File

@@ -107,8 +107,6 @@
#include <Windows.h>
#endif
#include "messageformatter.h"
using namespace Quotient;
class NetworkAccessManagerFactory : public QQmlNetworkAccessManagerFactory
@@ -142,19 +140,13 @@ Q_DECL_EXPORT
#endif
int main(int argc, char *argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QNetworkProxyFactory::setUseSystemConfiguration(true);
#ifdef HAVE_WEBVIEW
QtWebView::initialize();
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
#endif
#endif
#ifdef Q_OS_ANDROID
QGuiApplication app(argc, argv);
@@ -230,12 +222,6 @@ int main(int argc, char *argv[])
Login *login = new Login();
UrlHelper urlHelper;
MessageFormatter formatter;
// formatter.formatInternal("<p>hrrejoire</p>\n<pre><code class=\"language-js\">var i = 0; i++; function\n</code></pre>\n<p>rekore</p>\n", new
// QTextDocument);
// return 0;
#ifdef HAVE_COLORSCHEME
ColorSchemer colorScheme;
qmlRegisterSingletonInstance<ColorSchemer>("org.kde.neochat", 1, 0, "ColorSchemer", &colorScheme);
@@ -244,7 +230,6 @@ int main(int argc, char *argv[])
}
#endif
qmlRegisterSingletonInstance<MessageFormatter>("org.kde.neochat", 1, 0, "MessageFormatter", &formatter);
qmlRegisterSingletonInstance("org.kde.neochat", 1, 0, "Controller", &Controller::instance());
qmlRegisterSingletonInstance("org.kde.neochat", 1, 0, "NotificationsManager", &NotificationsManager::instance());
qmlRegisterSingletonInstance("org.kde.neochat", 1, 0, "Clipboard", &clipboard);
@@ -300,6 +285,7 @@ int main(int argc, char *argv[])
qmlRegisterUncreatableType<NeoChatRoom>("org.kde.neochat", 1, 0, "NeoChatRoom", {});
qmlRegisterUncreatableType<NeoChatConnection>("org.kde.neochat", 1, 0, "NeoChatConnection", {});
qmlRegisterSingletonType(QUrl("qrc:/ContextMenu.qml"), "org.kde.neochat", 1, 0, "ContextMenu");
qRegisterMetaType<User *>("User*");
qRegisterMetaType<User *>("const User*");
qRegisterMetaType<User *>("const Quotient::User*");
@@ -320,10 +306,6 @@ int main(int argc, char *argv[])
return engine->toScriptValue(LocationHelper());
});
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
qRegisterMetaTypeStreamOperators<Emoji>();
#endif
QQmlApplicationEngine engine;
#ifdef HAVE_KDBUSADDONS

View File

@@ -1,133 +0,0 @@
// SPDX-FileCopyrightText: 2021 Carson Black <uhhadd@gmail.com>
// SPDX-FileCopyrightText: 2022 Carl Schwan <carl@carlschwan.eu>
// SPDX-License-Identifier: GPL-3.0-or-later
#include "messageformatter.h"
#include <QDomDocument>
#include <QGuiApplication>
#include <QPalette>
#include <QQmlContext>
#include <QQmlProperty>
#include <QTextCursor>
#include <QTextDocumentFragment>
#include <KSyntaxHighlighting/definition.h>
#include <KSyntaxHighlighting/repository.h>
#include <KSyntaxHighlighting/syntaxhighlighter.h>
#include <KSyntaxHighlighting/theme.h>
QTextDocumentFragment copyTextLayoutFrom(QTextDocument *document)
{
QTextCursor sourceCursor(document);
sourceCursor.select(QTextCursor::Document);
QTextDocument helper;
// copy the content fragment from the source document into our helper document
QTextCursor curs(&helper);
curs.insertFragment(sourceCursor.selection());
curs.select(QTextCursor::Document);
// not sure why, but fonts get lost. since this is for codeblocks, we can
// just force the mono font. anyone copying this code would probably want
// to fix the problem proper if it's not also for codeblocks.
const auto fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
const int docStart = sourceCursor.selectionStart();
const int docEnd = helper.characterCount() - 1;
// since the copied fragment above lost the qsyntaxhighlighter stuff,
// we gotta go through the qtextlayout and apply those styles to the
// document
const auto end = document->findBlock(sourceCursor.selectionEnd()).next();
for (auto current = document->findBlock(docStart); current.isValid() && current != end; current = current.next()) {
const auto layout = current.layout();
// iterate through the formats, applying them to our document
for (const auto &span : layout->formats()) {
const int start = current.position() + span.start - docStart;
const int end = start + span.length;
curs.setPosition(qMax(start, 0));
curs.setPosition(qMin(end, docEnd), QTextCursor::KeepAnchor);
auto fmt = span.format;
fmt.setFont(fixedFont);
curs.setCharFormat(fmt);
}
}
return QTextDocumentFragment(&helper);
}
QTextDocumentFragment highlight(const QString &code, const QString &language)
{
using namespace KSyntaxHighlighting;
static Repository repo;
auto theme = repo.themeForPalette(QGuiApplication::palette());
auto definition = repo.definitionForFileName(QLatin1String("file.") + language);
QTextDocument doku(code);
QScopedPointer<SyntaxHighlighter> highlighter(new SyntaxHighlighter(&doku));
highlighter->setTheme(theme);
highlighter->setDefinition(definition);
return copyTextLayoutFrom(&doku);
}
bool extractCodeBlock(QTextCursor cursor, QDomElement element)
{
const auto codeNode = element.firstChild();
if (!codeNode.isNull()) {
const auto code = codeNode.toElement();
if (!code.isNull() && code.tagName() == QLatin1String("code")) {
QString lang;
auto langClass = code.attribute(QLatin1String("class"), QLatin1String("none"));
if (langClass != QLatin1String("none") && langClass.startsWith(QLatin1String("language-"))) {
lang = langClass.remove(0, 9);
}
if (!lang.isNull()) {
cursor.insertFragment(highlight(code.text(), lang));
return true;
}
}
}
return false;
}
QString MessageFormatter::formatInternal(const QString &messageBody, QTextDocument *document)
{
QTextCursor curs(document);
QDomDocument doc(QLatin1String("htmlement"));
doc.setContent(QStringLiteral("<div>%1</div>").arg(messageBody));
QDomElement docElem = doc.documentElement();
QDomNode n = docElem.firstChild();
while (!n.isNull()) {
QDomElement e = n.toElement();
if (!e.isNull()) {
if (e.tagName() != QLatin1String("pre") || !extractCodeBlock(curs, e)) {
QString outText;
QTextStream out(&outText);
e.save(out, 0);
curs.insertHtml(outText);
}
}
n = n.nextSibling();
}
Q_EMIT document->contentsChanged();
return document->toHtml();
}
QString MessageFormatter::format(const QString &messageBody, QQuickTextDocument *doc, QQuickItem *item)
{
QColor linkColor = QQmlProperty(item, QLatin1String("Kirigami.Theme.linkColor"), qmlContext(item)).read().value<QColor>();
return formatInternal(messageBody, doc->textDocument());
}

View File

@@ -1,13 +0,0 @@
// SPDX-FileCopyrightText: 2022 Carl Schwan <carl@carlschwan.eu>
// SPDX-License-Identifier: GPL-3.0-or-later
#include <QQuickItem>
#include <QQuickTextDocument>
class MessageFormatter : public QObject
{
Q_OBJECT
public:
Q_INVOKABLE QString format(const QString &messageBody, QQuickTextDocument *doc, QQuickItem *item);
Q_INVOKABLE QString formatInternal(const QString &messageBody, QTextDocument *doc);
};

View File

@@ -145,7 +145,7 @@ void CompletionModel::updateCompletion()
m_filterModel->setFullText(m_fullText);
m_filterModel->setFilterText(m_text);
m_filterModel->invalidate();
} else if (text().startsWith(QLatin1Char(':')) && !text()[1].isUpper()
} else if (text().startsWith(QLatin1Char(':')) && text().size() > 1 && !text()[1].isUpper()
&& (m_fullText.indexOf(QLatin1Char(':'), 1) == -1
|| (m_fullText.indexOf(QLatin1Char(' ')) != -1 && m_fullText.indexOf(QLatin1Char(':'), 1) > m_fullText.indexOf(QLatin1Char(' '), 1)))) {
m_filterModel->setSourceModel(m_emojiModel);

View File

@@ -22,11 +22,7 @@ bool CompletionProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &so
&& sourceModel()
->data(sourceModel()->index(sourceRow, 0), secondaryFilterRole())
.toString()
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
.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

View File

@@ -10,11 +10,7 @@
#include "jobs/neochatdeactivateaccountjob.h"
#include "roommanager.h"
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <qt5keychain/keychain.h>
#else
#include <qt6keychain/keychain.h>
#endif
#include <KLocalizedString>

View File

@@ -178,17 +178,9 @@ QCoro::Task<void> NeoChatRoom::doUploadFile(QUrl url, QString body)
content = new EventContent::AudioContent(url, fileInfo.size(), mime, fileInfo.fileName());
} else if (mime.name().startsWith("video/"_ls)) {
QMediaPlayer player;
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
player.setSource(url);
#else
player.setMedia(url);
#endif
co_await qCoro(&player, &QMediaPlayer::mediaStatusChanged);
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
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());
} else {
content = new EventContent::FileContent(url, fileInfo.size(), mime, fileInfo.fileName());

View File

@@ -177,6 +177,18 @@ QQC2.Control {
interval: 5000
}
TapHandler {
enabled: true
acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
acceptedButtons: Qt.LeftButton | Qt.RightButton
// unfortunately, taphandler's pressed event only triggers when the press is lifted
// we need to use the longpress signal since it triggers when the button is first pressed
longPressThreshold: 0
onLongPressed: ContextMenu.targetClick(point, textField, documentHandler, textField.positionAt(point.position.x, point.position.y));
}
onTextChanged: {
if (!repeatTimer.running && Config.typingNotifications) {
var textExists = text.length > 0

View File

@@ -0,0 +1,245 @@
pragma Singleton
import QtQuick 2.6
import QtQml 2.2
import QtQuick.Controls 2.15
import org.kde.kirigami 2.5 as Kirigami
Menu {
id: contextMenu
property Item target
property bool deselectWhenMenuClosed: true
property int restoredCursorPosition: 0
property int restoredSelectionStart
property int restoredSelectionEnd
property bool persistentSelectionSetting
property var chatdocumenthandler: null
property var suggestions: []
Component.onCompleted: persistentSelectionSetting = persistentSelectionSetting // break binding
property var runOnMenuClose: () => {}
parent: Overlay.overlay
function storeCursorAndSelection() {
contextMenu.restoredCursorPosition = target.cursorPosition;
contextMenu.restoredSelectionStart = target.selectionStart;
contextMenu.restoredSelectionEnd = target.selectionEnd;
}
// target is pressed with mouse
function targetClick(handlerPoint, newTarget, chatdocumenthandler, mousePosition) {
if (handlerPoint.pressedButtons === Qt.RightButton) { // only accept just right click
if (contextMenu.visible) {
deselectWhenMenuClosed = false; // don't deselect text if menu closed by right click on textfield
dismiss();
} else {
contextMenu.target = newTarget;
contextMenu.target.persistentSelection = true; // persist selection when menu is opened
contextMenu.chatdocumenthandler = chatdocumenthandler;
contextMenu.suggestions = mousePosition ? chatdocumenthandler.getSuggestions(mousePosition) : [];
storeCursorAndSelection();
popup(contextMenu.target);
// slightly locate context menu away from mouse so no item is selected when menu is opened
x += 1
y += 1
}
} else {
dismiss();
}
}
// context menu keyboard key
function targetKeyPressed(event, newTarget) {
if (event.modifiers === Qt.NoModifier && event.key === Qt.Key_Menu) {
contextMenu.target = newTarget;
target.persistentSelection = true; // persist selection when menu is opened
storeCursorAndSelection();
popup(contextMenu.target);
}
}
readonly property bool targetIsPassword: target !== null && (target.echoMode === TextInput.PasswordEchoOnEdit || target.echoMode === TextInput.Password)
onAboutToShow: {
if (Overlay.overlay) {
let tempZ = 0
for (let i in Overlay.overlay.visibleChildren) {
tempZ = Math.max(tempZ, Overlay.overlay.visibleChildren[i].z)
}
z = tempZ + 1
}
}
// deal with whether or not text should be deselected
onClosed: {
// restore text field's original persistent selection setting
target.persistentSelection = persistentSelectionSetting
// deselect text field text if menu is closed not because of a right click on the text field
if (deselectWhenMenuClosed) {
target.deselect();
}
deselectWhenMenuClosed = true;
// restore cursor position
target.forceActiveFocus();
target.cursorPosition = restoredCursorPosition;
target.select(restoredSelectionStart, restoredSelectionEnd);
// run action, and free memory
runOnMenuClose();
runOnMenuClose = () => {};
}
onOpened: {
runOnMenuClose = () => {};
}
Instantiator {
active: target !== null && !target.readOnly && chatdocumenthandler !== null && chatdocumenthandler.active && chatdocumenthandler.wordIsMisspelled
model: suggestions
delegate: MenuItem {
text: modelData
onClicked: {
deselectWhenMenuClosed = false;
runOnMenuClose = () => chatdocumenthandler.replaceWord(modelData);
}
}
onObjectAdded: {
contextMenu.insertItem(0, object)
}
onObjectRemoved: contextMenu.removeItem(0)
}
MenuItem {
visible: target !== null && !target.readOnly && chatdocumenthandler !== null && chatdocumenthandler.active && chatdocumenthandler.wordIsMisspelled && suggestions.length === 0
action: Action {
text: chatdocumenthandler ? qsTr("No suggestions for \"%1\"").arg(chatdocumenthandler.wordUnderMouse) : ''
enabled: false
}
}
MenuItem {
visible: target !== null && !target.readOnly && chatdocumenthandler !== null && chatdocumenthandler.active && chatdocumenthandler.wordIsMisspelled
action: Action {
text: chatdocumenthandler ? qsTr("Add \"%1\" to dictionary").arg(chatdocumenthandler.wordUnderMouse) : ''
onTriggered: {
deselectWhenMenuClosed = false;
runOnMenuClose = () => chatdocumenthandler.addWordToDictionary(chatdocumenthandler.wordUnderMouse);
}
}
}
MenuItem {
visible: target !== null && !target.readOnly && chatdocumenthandler !== null && chatdocumenthandler.active && chatdocumenthandler.wordIsMisspelled
action: Action {
text: qsTr("Ignore")
onTriggered: {
deselectWhenMenuClosed = false;
runOnMenuClose = () => chatdocumenthandler.ignoreWord(chatdocumenthandler.wordUnderMouse);
}
}
}
MenuSeparator {
visible: target !== null && !target.readOnly && ((chatdocumenthandler !== null && chatdocumenthandler.active && chatdocumenthandler.wordIsMisspelled))
}
MenuItem {
visible: target !== null && !target.readOnly && !targetIsPassword
action: Action {
icon.name: "edit-undo-symbolic"
text: qsTr("Undo")
shortcut: StandardKey.Undo
}
enabled: target !== null && target.canUndo
onTriggered: {
deselectWhenMenuClosed = false;
runOnMenuClose = () => target.undo();
}
}
MenuItem {
visible: target !== null && !target.readOnly && !targetIsPassword
action: Action {
icon.name: "edit-redo-symbolic"
text: qsTr("Redo")
shortcut: StandardKey.Redo
}
enabled: target !== null && target.canRedo
onTriggered: {
deselectWhenMenuClosed = false;
runOnMenuClose = () => target.redo();
}
}
MenuSeparator {
visible: target !== null && !target.readOnly && !targetIsPassword
}
MenuItem {
visible: target !== null && !target.readOnly && !targetIsPassword
action: Action {
icon.name: "edit-cut-symbolic"
text: qsTr("Cut")
shortcut: StandardKey.Cut
}
enabled: target !== null && target.selectedText
onTriggered: {
deselectWhenMenuClosed = false;
runOnMenuClose = () => target.cut();
}
}
MenuItem {
action: Action {
icon.name: "edit-copy-symbolic"
text: qsTr("Copy")
shortcut: StandardKey.Copy
}
enabled: target !== null && target.selectedText
visible: !targetIsPassword
onTriggered: {
deselectWhenMenuClosed = false;
runOnMenuClose = () => target.copy();
}
}
MenuItem {
visible: target !== null && !target.readOnly
action: Action {
icon.name: "edit-paste-symbolic"
text: qsTr("Paste")
shortcut: StandardKey.Paste
}
enabled: target !== null && target.canPaste
onTriggered: {
deselectWhenMenuClosed = false;
runOnMenuClose = () => target.paste();
}
}
MenuItem {
visible: target !== null && !target.readOnly
action: Action {
icon.name: "edit-delete-symbolic"
text: qsTr("Delete")
shortcut: StandardKey.Delete
}
enabled: target !== null && target.selectedText
onTriggered: {
deselectWhenMenuClosed = false;
runOnMenuClose = () => target.remove(target.selectionStart, target.selectionEnd);
}
}
MenuSeparator {
visible: !targetIsPassword
}
MenuItem {
action: Action {
icon.name: "edit-select-all-symbolic"
text: qsTr("Select All")
shortcut: StandardKey.SelectAll
}
visible: !targetIsPassword
onTriggered: {
deselectWhenMenuClosed = false;
runOnMenuClose = () => target.selectAll();
}
}
}

View File

@@ -4,7 +4,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.15 as QQC2
import QtQuick.Layouts 1.15
import QtMultimedia @QTMULTIMEDIA_MODULE_QML_VERSION@
import QtMultimedia
import org.kde.kirigami 2.15 as Kirigami
@@ -42,10 +42,9 @@ TimelineContainer {
Layout.fillWidth: true
Layout.maximumWidth: root.contentMaxWidth
@QTMULTIMEDIA_AUDIO@ {
MediaPlayer {
id: audio
source: root.progressInfo.localPath
@QTMULTIMEDIA_AUDIO_AUTOLOAD@
}
states: [

View File

@@ -3,8 +3,8 @@
pragma Singleton
import QtQuick @QTQUICK_MODULE_QML_VERSION@
import QtLocation @QTLOCATION_MODULE_QML_VERSION@
import QtQuick
import QtLocation
QtObject {
property var plugin: Plugin {

View File

@@ -44,7 +44,6 @@ TextEdit {
property bool spoilerRevealed: !hasSpoiler.test(textMessage)
ListView.onReused: Qt.binding(() => !hasSpoiler.test(textMessage))
onTextMessageChanged: text = MessageFormatter.format(textMessage, contentLabel.textDocument, contentLabel)
persistentSelection: true
@@ -53,7 +52,6 @@ TextEdit {
Controller.forceRefreshTextDocument(root.textDocument, root)
}
/*
text: "<style>
table {
width:100%;
@@ -86,11 +84,7 @@ a{
background: " + Kirigami.Theme.textColor + ";
}
" : "") + "
<<<<<<< HEAD:src/qml/Component/Timeline/RichLabel.qml
</style>" + textMessage
=======
</style>" + (isEmote ? "* <a href='https://matrix.to/#/" + author.id + "' style='color: " + author.color + "'>" + author.displayName + "</a> " : "") + textMessage + (isEdited ? (" <span style=\"color: " + Kirigami.Theme.disabledTextColor + "\">" + "<span style='font-size: " + Kirigami.Theme.defaultFont.pixelSize +"px'>" + i18n(" (edited)") + "</span>") : "")
*/
color: Kirigami.Theme.textColor
selectedTextColor: Kirigami.Theme.highlightedTextColor

View File

@@ -622,7 +622,7 @@ ColumnLayout {
selectedText: selectedText,
author: root.author,
eventId: root.eventId,
source: root.jsonSource,
eventSource: root.jsonSource,
eventType: root.delegateType,
plainText: root.plainText,
htmlText: root.display,

View File

@@ -4,7 +4,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.15 as QQC2
import QtQuick.Layouts 1.15
import QtMultimedia @QTMULTIMEDIA_MODULE_QML_VERSION@
import QtMultimedia
import Qt.labs.platform 1.1 as Platform
import org.kde.kirigami 2.13 as Kirigami
@@ -73,7 +73,6 @@ TimelineContainer {
Layout.preferredHeight: mediaSizeHelper.currentSize.height
fillMode: VideoOutput.PreserveAspectFit
@QTMULTIMEDIA_VIDEO_FLUSHMODE@
states: [
State {

View File

@@ -17,7 +17,7 @@ Kirigami.OverlaySheet {
property var userId
property int powerLevel
@OVERLAYSHEET_OPEN@: {
onOpened: {
if (sheetOpen) {
powerLevelComboBox.currentIndex = powerLevelComboBox.indexOfValue(root.powerLevel)
}

View File

@@ -92,7 +92,7 @@ MessageDelegateContextMenu {
icon.name: "code-context"
onTriggered: {
applicationWindow().pageStack.pushDialogLayer('qrc:/MessageSourceSheet.qml', {
sourceText: root.source
sourceText: root.eventSource
}, {
title: i18n("Message Source"),
width: Kirigami.Units.gridUnit * 25

View File

@@ -16,7 +16,7 @@ Loader {
required property var author
required property string eventId
property var eventType
required property string source
required property string eventSource
property string selectedText: ""
required property string plainText
property string htmlText: undefined
@@ -80,6 +80,7 @@ Loader {
})
},
Kirigami.Action {
visible: Config.developerTools
text: i18n("View Source")
icon.name: "code-context"
onTriggered: {

View File

@@ -31,15 +31,15 @@ Kirigami.Page {
imageDoc.crop(selectionTool.selectionX / ratioX, selectionTool.selectionY / ratioY, selectionTool.selectionWidth / ratioX, selectionTool.selectionHeight / ratioY);
}
actions {
left: Kirigami.Action {
actions: [
Kirigami.Action {
id: undoAction
text: i18nc("@action:button Undo modification", "Undo")
icon.name: "edit-undo"
onTriggered: imageDoc.undo();
visible: imageDoc.edited
}
main: Kirigami.Action {
},
Kirigami.Action {
id: okAction
text: i18nc("@action:button Accept image modification", "Accept")
icon.name: "dialog-ok"
@@ -54,7 +54,7 @@ Kirigami.Page {
}
}
}
}
]

View File

@@ -138,10 +138,10 @@ Kirigami.ScrollablePage {
title: i18nc("@title:window", "Add server")
onSheetOpenChanged: if (!serverUrlField.isValidServer && !sheetOpen) {
onOpened: if (!serverUrlField.isValidServer && !opened) {
serverField.currentIndex = 0
server = serverField.currentValue
} else if (sheetOpen) {
} else if (opened) {
serverUrlField.forceActiveFocus()
}

View File

@@ -27,13 +27,13 @@ Kirigami.Page {
focus: true
padding: 0
actions {
main: Kirigami.Action {
actions: [
Kirigami.Action {
visible: Kirigami.Settings.isMobile || !applicationWindow().pageStack.wideMode
icon.name: "view-right-new"
onTriggered: applicationWindow().openRoomDrawer()
}
}
]
KeyNavigation.left: pageStack.get(0)

View File

@@ -38,14 +38,14 @@ Kirigami.Page {
Component.onCompleted: infoAction.toggle()
actions {
main: Kirigami.Action {
actions: [
Kirigami.Action {
displayHint: Kirigami.DisplayHint.IconOnly
text: i18n("Settings")
icon.name: "settings-configure"
onTriggered: applicationWindow().pageStack.pushDialogLayer('qrc:/Categories.qml', {room: root.room}, { title: i18n("Room Settings") })
}
}
]
Loader {
id: drawerItemLoader

View File

@@ -173,9 +173,9 @@ QQC2.ScrollView {
room: root.room
}
sortRole: "powerLevel"
sortRoleName: "powerLevel"
sortOrder: Qt.DescendingOrder
filterRole: "name"
filterRoleName: "name"
filterCaseSensitivity: Qt.CaseInsensitive
}

View File

@@ -9,7 +9,7 @@
<file alias="RoomList/ExploreComponent.qml">qml/Page/RoomList/ExploreComponent.qml</file>
<file alias="RoomList/ContextMenu.qml">qml/Page/RoomList/ContextMenu.qml</file>
<file alias="RoomList/CollapsedRoomDelegate.qml">qml/Page/RoomList/CollapsedRoomDelegate.qml</file>
<file alias="RoomList/RoomDelegate.qml">@CMAKE_CURRENT_BINARY_DIR@/qml/Page/RoomList/RoomDelegate.qml</file>
<file alias="RoomList/RoomDelegate.qml">qml/Page/RoomList/RoomDelegate.qml</file>
<file alias="RoomList/Page.qml">qml/Page/RoomList/Page.qml</file>
<file alias="SpaceListContextMenu.qml">qml/Page/RoomList/SpaceListContextMenu.qml</file>
<file alias="RoomList/UserInfo.qml">qml/Page/RoomList/UserInfo.qml</file>
@@ -32,10 +32,11 @@
<file alias="FancyEffectsContainer.qml">qml/Component/FancyEffectsContainer.qml</file>
<file alias="TypingPane.qml">qml/Component/TypingPane.qml</file>
<file alias="ShimmerGradient.qml">qml/Component/ShimmerGradient.qml</file>
<file alias="QuickSwitcher.qml">@CMAKE_CURRENT_BINARY_DIR@/qml/Component/QuickSwitcher.qml</file>
<file alias="QuickSwitcher.qml">qml/Component/QuickSwitcher.qml</file>
<file alias="HoverActions.qml">qml/Component/HoverActions.qml</file>
<file alias="ChatBox.qml">qml/Component/ChatBox/ChatBox.qml</file>
<file alias="ChatBar.qml">qml/Component/ChatBox/ChatBar.qml</file>
<file alias="ContextMenu.qml">qml/Component/ChatBox/ContextMenu.qml</file>
<file alias="AttachmentPane.qml">qml/Component/ChatBox/AttachmentPane.qml</file>
<file alias="ReplyPane.qml">qml/Component/ChatBox/ReplyPane.qml</file>
<file alias="CompletionMenu.qml">qml/Component/ChatBox/CompletionMenu.qml</file>
@@ -49,10 +50,10 @@
<file alias="RichLabel.qml">qml/Component/Timeline/RichLabel.qml</file>
<file alias="TimelineContainer.qml">qml/Component/Timeline/TimelineContainer.qml</file>
<file alias="SectionDelegate.qml">qml/Component/Timeline/SectionDelegate.qml</file>
<file alias="VideoDelegate.qml">@CMAKE_CURRENT_BINARY_DIR@/qml/Component/Timeline/VideoDelegate.qml</file>
<file alias="VideoDelegate.qml">qml/Component/Timeline/VideoDelegate.qml</file>
<file alias="ReactionDelegate.qml">qml/Component/Timeline/ReactionDelegate.qml</file>
<file alias="LinkPreviewDelegate.qml">qml/Component/Timeline/LinkPreviewDelegate.qml</file>
<file alias="AudioDelegate.qml">@CMAKE_CURRENT_BINARY_DIR@/qml/Component/Timeline/AudioDelegate.qml</file>
<file alias="AudioDelegate.qml">qml/Component/Timeline/AudioDelegate.qml</file>
<file alias="FileDelegate.qml">qml/Component/Timeline/FileDelegate.qml</file>
<file alias="ImageDelegate.qml">qml/Component/Timeline/ImageDelegate.qml</file>
<file alias="EncryptedDelegate.qml">qml/Component/Timeline/EncryptedDelegate.qml</file>
@@ -84,7 +85,7 @@
<file alias="OpenFileDialog.qml">qml/Dialog/OpenFileDialog.qml</file>
<file alias="KeyVerificationDialog.qml">qml/Dialog/KeyVerification/KeyVerificationDialog.qml</file>
<file alias="Dialog/ConfirmLogout.qml">qml/Dialog/ConfirmLogout.qml</file>
<file alias="PowerLevelDialog.qml">@CMAKE_CURRENT_BINARY_DIR@/qml/Dialog/PowerLevelDialog.qml</file>
<file alias="PowerLevelDialog.qml">qml/Dialog/PowerLevelDialog.qml</file>
<file alias="Message.qml">qml/Dialog/KeyVerification/Message.qml</file>
<file alias="EmojiItem.qml">qml/Dialog/KeyVerification/EmojiItem.qml</file>
<file alias="EmojiRow.qml">qml/Dialog/KeyVerification/EmojiRow.qml</file>
@@ -132,7 +133,7 @@
<file alias="InvitationView.qml">qml/Component/InvitationView.qml</file>
<file alias="AvatarTabButton.qml">qml/Component/AvatarTabButton.qml</file>
<file alias="SpaceDrawer.qml">qml/Page/RoomList/SpaceDrawer.qml</file>
<file alias="OsmLocationPlugin.qml">@CMAKE_CURRENT_BINARY_DIR@/qml/Component/Timeline/OsmLocationPlugin.qml</file>
<file alias="OsmLocationPlugin.qml">qml/Component/Timeline/OsmLocationPlugin.qml</file>
<file alias="LiveLocationDelegate.qml">qml/Component/Timeline/LiveLocationDelegate.qml</file>
<file alias="FullScreenMap.qml">qml/Component/FullScreenMap.qml</file>
<file alias="LocationsPage.qml">qml/Component/LocationPage.qml</file>

View File

@@ -16,7 +16,7 @@ RemoteImage Runner::serializeImage(const QImage &image)
RemoteImage remoteImage{
convertedImage.width(),
convertedImage.height(),
convertedImage.bytesPerLine(),
static_cast<int>(convertedImage.bytesPerLine()),
true, // hasAlpha
8, // bitsPerSample
4, // channels

View File

@@ -64,7 +64,7 @@ struct RemoteImage {
// iiibiiay (matching notification spec image-data attribute)
int width;
int height;
int rowStride;
qsizetype rowStride;
bool hasAlpha;
int bitsPerSample;
int channels;

View File

@@ -17,11 +17,7 @@ TrayIcon::TrayIcon(QObject *parent)
});
connect(&WindowController::instance(), &WindowController::windowChanged, this, [this] {
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
setAssociatedWindow(WindowController::instance().window());
#else
Q_UNUSED(this);
#endif
});
}