fix #LINQT-1796 don't scroll to main list when selecting contact from favorites \

fix crash
This commit is contained in:
Gaëlle Braud 2025-07-17 13:31:47 +00:00
parent dce74eb958
commit 98d9179419
7 changed files with 16 additions and 14 deletions

View file

@ -22,7 +22,7 @@ set(APP_TARGETS ${LinphoneCxx_TARGET}
${LibLinphone_TARGET})#Liblinphone
set(QT_DEFAULT_MAJOR_VERSION 6)
set(QT_PACKAGES Core Quick Qml Widgets Svg Multimedia Test NetworkAuth Concurrent)# Search Core at first for initialize Qt scripts for next find_packages.
set(QT_PACKAGES Quick Qml Widgets Svg Multimedia Test NetworkAuth Concurrent Core5Compat)# Search Core at first for initialize Qt scripts for next find_packages.
if (UNIX AND NOT APPLE)
list(APPEND QT_PACKAGES DBus)
endif()
@ -214,6 +214,7 @@ foreach(T ${APP_TARGETS})
target_link_libraries(${TARGET_NAME} PUBLIC ${T})
endforeach()
target_link_libraries(${TARGET_NAME} PRIVATE Qt6::Core)
foreach(T ${QT_PACKAGES})
target_link_libraries(${TARGET_NAME} PRIVATE Qt6::${T})
endforeach()

View file

@ -101,8 +101,11 @@ void ChatList::setSelf(QSharedPointer<ChatList> me) {
connectItem(chat);
}
mustBeInMainThread(getClassName());
resetData<ChatCore>(*chats);
delete chats;
clearData();
for(auto chat: *chats) {
add(chat);
}
delete chats;
});
});
});

View file

@ -57,7 +57,8 @@ void ParticipantInfoList::setChatCore(const QSharedPointer<ChatCore> &chatCore)
QStringList participantAddresses;
QList<QSharedPointer<ParticipantGui>> participantList;
auto participants = mChatCore->getParticipants();
resetData<ParticipantCore>(participants);
resetData();
for(auto p: participants) add(p);
};
connect(mChatCore.get(), &ChatCore::participantsChanged, this, buildList);
buildList();

View file

@ -409,7 +409,7 @@ void CoreModel::onCallStateChanged(const std::shared_ptr<linphone::Core> &core,
linphone::Call::State state,
const std::string &message) {
if (state == linphone::Call::State::IncomingReceived) {
App::getInstance()->getNotifier()->notifyReceivedCall(call);
if (App::getInstance()->getNotifier()) App::getInstance()->getNotifier()->notifyReceivedCall(call);
if (!core->getConfig()->getBool(SettingsModel::UiSection, "disable_command_line", false) &&
!core->getConfig()->getString(SettingsModel::UiSection, "command_line", "").empty()) {
QString command = Utils::coreStringToAppString(
@ -513,14 +513,14 @@ void CoreModel::onMessageReceived(const std::shared_ptr<linphone::Core> &core,
emit unreadNotificationsChanged();
std::list<std::shared_ptr<linphone::ChatMessage>> messages;
messages.push_back(message);
App::getInstance()->getNotifier()->notifyReceivedMessages(room, messages);
if (App::getInstance()->getNotifier()) App::getInstance()->getNotifier()->notifyReceivedMessages(room, messages);
emit messageReceived(core, room, message);
}
void CoreModel::onMessagesReceived(const std::shared_ptr<linphone::Core> &core,
const std::shared_ptr<linphone::ChatRoom> &room,
const std::list<std::shared_ptr<linphone::ChatMessage>> &messages) {
emit unreadNotificationsChanged();
App::getInstance()->getNotifier()->notifyReceivedMessages(room, messages);
if (App::getInstance()->getNotifier()) App::getInstance()->getNotifier()->notifyReceivedMessages(room, messages);
emit messagesReceived(core, room, messages);
}

View file

@ -169,6 +169,7 @@ ListView {
if (isFullyVisible)
modelData.core.lMarkAsRead()
}
Component.onCompleted: if (index === mainItem.count - 1) mainItem.lastItemVisible = isFullyVisible
chatMessage: modelData
chat: mainItem.chat
searchedTextPart: mainItem.filterText

View file

@ -59,10 +59,6 @@ ListView {
onVisibleChanged: if (visible && !expanded) expanded = true
property var _currentItemY: currentItem?.y
on_CurrentItemYChanged: if(_currentItemY){
updatePosition()
}
onYChanged: updatePosition()
// Qt bug: sometimes, containsMouse may not be send and update on each MouseArea.

View file

@ -28,7 +28,7 @@ AbstractWindow {
property var accountProxy
// TODO : use this to make the border transparent
flags: Qt.Window | Qt.WindowTitleHint
flags: Qt.Window
// menuBar: Rectangle {
// width: parent.width
// height: Math.round(40 * DefaultStyle.dp)