mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
VFileList: do not close current tab when opening Unknown file in single click
This commit is contained in:
parent
4e744f30f9
commit
f2c26d8353
@ -685,6 +685,11 @@ void VFileList::handleItemClicked(QListWidgetItem *p_item)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EditArea will open Unknown file using system's default program, in which
|
||||||
|
// case we should now close current file even after single click.
|
||||||
|
if (file->getDocType() == DocType::Unknown) {
|
||||||
|
m_fileToCloseInSingleClick = NULL;
|
||||||
|
} else {
|
||||||
// Get current tab which will be closed if click timer timeouts.
|
// Get current tab which will be closed if click timer timeouts.
|
||||||
VEditTab *tab = editArea->getCurrentTab();
|
VEditTab *tab = editArea->getCurrentTab();
|
||||||
if (tab) {
|
if (tab) {
|
||||||
@ -693,6 +698,7 @@ void VFileList::handleItemClicked(QListWidgetItem *p_item)
|
|||||||
m_fileToCloseInSingleClick = NULL;
|
m_fileToCloseInSingleClick = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Activate it.
|
// Activate it.
|
||||||
activateItem(p_item, true);
|
activateItem(p_item, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user