From 1b68bcbe0363b23e15f0bea0fb4707b405c1c02d Mon Sep 17 00:00:00 2001 From: Tian Shilin Date: Thu, 14 May 2026 14:57:14 +0800 Subject: [PATCH] fix: reset m_fIsDeleting on cancel by listening to DFDeleteDialog::rejected log: Pressing Cancel on the delete-confirmation dialog triggers reject() + close() on an already-hidden dialog, on which DDialog::closed is not reliably emitted. As a result cancelDelete() was never called and m_fIsDeleting stayed at Deleting, so the next call to delCurrentFont() was blocked at the entry gate 'if (m_fIsDeleting > UnDeleting) return;', making the confirmation dialog fail to appear on every subsequent right-click delete. Connect DFDeleteDialog::rejected directly to cancelDelete() so the delete state flag is always reset on the cancel path. pms: bug-347229 --- deepin-font-manager/views/dfontmgrmainwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/deepin-font-manager/views/dfontmgrmainwindow.cpp b/deepin-font-manager/views/dfontmgrmainwindow.cpp index f8cd23f8..8da04610 100644 --- a/deepin-font-manager/views/dfontmgrmainwindow.cpp +++ b/deepin-font-manager/views/dfontmgrmainwindow.cpp @@ -2194,6 +2194,7 @@ void DFontMgrMainWindow::delCurrentFont(bool activatedByRightmenu) DFDeleteDialog *confirmDelDlg = new DFDeleteDialog(this, m_menuDelCnt, m_menuSysCnt, m_menuCurCnt > 0, this); connect(confirmDelDlg, &DFDeleteDialog::accepted, this, &DFontMgrMainWindow::onconfirmDelDlgAccept); + connect(confirmDelDlg, &DFDeleteDialog::rejected, this, &DFontMgrMainWindow::cancelDelete); //confirmDelDlg->move((this->width() - confirmDelDlg->width() - 230 + mapToGlobal(QPoint(0, 0)).x()), (mapToGlobal(QPoint(0, 0)).y() + 180)); confirmDelDlg->move(this->geometry().center() - confirmDelDlg->rect().center());