From d4ad7576b14bf78e4bcd8c2703a6a75b72d099be Mon Sep 17 00:00:00 2001 From: dengzhongyuan Date: Wed, 22 Jan 2025 13:33:19 +0800 Subject: [PATCH] fix: Cannot reconnect to server after unmounting FTP without closing file manager When using finished signal to trigger close(), the close event was being filtered by QDialogPrivate::close()'s event filter. Changed to use buttonClicked signal instead which is emitted before the filter is installed. log: This fixes the issue where closeEvent was not being triggered properly when closing the dialog. bug: https://pms.uniontech.com/bug-view-301837.html --- .../filemanager/dfmplugin-titlebar/utils/titlebarhelper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/filemanager/dfmplugin-titlebar/utils/titlebarhelper.cpp b/src/plugins/filemanager/dfmplugin-titlebar/utils/titlebarhelper.cpp index 9bfa50a6e1..e58b6941df 100644 --- a/src/plugins/filemanager/dfmplugin-titlebar/utils/titlebarhelper.cpp +++ b/src/plugins/filemanager/dfmplugin-titlebar/utils/titlebarhelper.cpp @@ -282,7 +282,7 @@ void TitleBarHelper::showConnectToServerDialog(quint64 windowId) ConnectToServerDialog *dialog = new ConnectToServerDialog(window->currentUrl(), window); dialog->show(); dialog->setAttribute(Qt::WA_DeleteOnClose); - QObject::connect(dialog, &ConnectToServerDialog::finished, dialog, &ConnectToServerDialog::onButtonClicked); + QObject::connect(dialog, &DDialog::buttonClicked, dialog, &ConnectToServerDialog::onButtonClicked); window->setProperty("ConnectToServerDialogShown", true); QObject::connect(dialog, &ConnectToServerDialog::closed, [window] { window->setProperty("ConnectToServerDialogShown", false); @@ -299,7 +299,7 @@ void TitleBarHelper::showUserSharePasswordSettingDialog(quint64 windowId) UserSharePasswordSettingDialog *dialog = new UserSharePasswordSettingDialog(window); dialog->show(); dialog->setAttribute(Qt::WA_DeleteOnClose); - QObject::connect(dialog, &UserSharePasswordSettingDialog::finished, dialog, &UserSharePasswordSettingDialog::onButtonClicked); + QObject::connect(dialog, &UserSharePasswordSettingDialog::buttonClicked, dialog, &UserSharePasswordSettingDialog::onButtonClicked); QObject::connect(dialog, &UserSharePasswordSettingDialog::inputPassword, [=](const QString &password) { dpfSignalDispatcher->publish("dfmplugin_titlebar", "signal_Share_SetPassword", password); });