Skip to content

Commit

Permalink
fix: Cannot reconnect to server after unmounting FTP without closing …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
dengzhongyuan365-dev committed Jan 22, 2025
1 parent 42123a1 commit d4ad757
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
});
Expand Down

0 comments on commit d4ad757

Please sign in to comment.