Reload tabs before changing selected tab index

This worked previously because selected tab was stored using an index and we were only changing it (before reload) when closing tabs, so the new index would be valid both before and after reload.

With the new OakTabBarView the index of selected tab is instantly converted into a reference to a tab item.
This commit is contained in:
Allan Odgaard
2014-09-26 17:44:23 +02:00
parent cb463534b8
commit 89d2450c88

View File

@@ -591,8 +591,8 @@ namespace
if(createIfEmptyFlag && newDocuments.empty())
newDocuments.push_back(create_untitled_document_in_folder(to_s(self.untitledSavePath)));
self.selectedTabIndex = newSelectedTabIndex;
self.documents = newDocuments;
self.selectedTabIndex = newSelectedTabIndex;
if(!newDocuments.empty() && newDocuments[newSelectedTabIndex]->identifier() != selectedUUID)
[self openAndSelectDocument:newDocuments[newSelectedTabIndex]];