* GuiView.C (updateTab): do not update early if current tab has

changed (bug 3254)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17344 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2007-02-25 19:42:48 +00:00
parent 7dd29bb818
commit e5a46922e9

View File

@ -107,7 +107,8 @@ public:
struct GuiView::GuiViewPrivate
{
std::vector<std::string> tabnames;
vector<string> tabnames;
string cur_title;
TabWidget* tabWidget;
@ -488,11 +489,17 @@ void GuiView::updateTab()
{
std::vector<string> const & names = theBufferList().getFileNames();
string cur_title;
if (view()->buffer()) {
cur_title = view()->buffer()->fileName();
}
// avoid unnecessary tabbar rebuild:
// check if something has changed
if (d.tabnames == names)
if (d.tabnames == names && d.cur_title == cur_title)
return;
d.tabnames = names;
d.cur_title = cur_title;
QTabBar & tabbar = *d.tabWidget->tabbar;
@ -502,11 +509,6 @@ void GuiView::updateTab()
// remove all tab bars
d.tabWidget->clearTabbar();
string cur_title;
if (view()->buffer()) {
cur_title = view()->buffer()->fileName();
}
// rebuild tabbar and function map from scratch
if (names.size() > 1) {
for(size_t i = 0; i < names.size(); i++) {