VFileList: do not close current tab when opening Unknown file in single click

This commit is contained in:
Le Tan 2018-05-10 20:07:53 +08:00
parent 4e744f30f9
commit f2c26d8353

View File

@ -685,12 +685,18 @@ void VFileList::handleItemClicked(QListWidgetItem *p_item)
return; return;
} }
// Get current tab which will be closed if click timer timeouts. // EditArea will open Unknown file using system's default program, in which
VEditTab *tab = editArea->getCurrentTab(); // case we should now close current file even after single click.
if (tab) { if (file->getDocType() == DocType::Unknown) {
m_fileToCloseInSingleClick = tab->getFile();
} else {
m_fileToCloseInSingleClick = NULL; m_fileToCloseInSingleClick = NULL;
} else {
// Get current tab which will be closed if click timer timeouts.
VEditTab *tab = editArea->getCurrentTab();
if (tab) {
m_fileToCloseInSingleClick = tab->getFile();
} else {
m_fileToCloseInSingleClick = NULL;
}
} }
} }