MdTab: fix bug which will open two tabs for the same file

This commit is contained in:
Le Tan 2019-06-06 20:00:11 +08:00
parent 357604a38d
commit e0ba7210f3

View File

@ -94,11 +94,13 @@ VMdTab::VMdTab(VFile *p_file, VEditArea *p_editArea,
} }
}); });
if (p_mode == OpenFileMode::Edit) { QTimer::singleShot(50, this, [this, p_mode]() {
showFileEditMode(); if (p_mode == OpenFileMode::Edit) {
} else { showFileEditMode();
showFileReadMode(); } else {
} showFileReadMode();
}
});
} }
void VMdTab::setupUI() void VMdTab::setupUI()
@ -940,7 +942,7 @@ void VMdTab::focusChild()
break; break;
default: default:
Q_ASSERT(false); this->setFocus();
break; break;
} }
} }