927 return; |
927 return; |
928 } |
928 } |
929 |
929 |
930 // If this is the current file, it also needs to be the selected item on |
930 // If this is the current file, it also needs to be the selected item on |
931 // the list. |
931 // the list. |
932 log ("%1 <-> %2\n", f, getCurrentDocument()); |
|
933 if (f == getCurrentDocument()) |
932 if (f == getCurrentDocument()) |
934 { |
|
935 log ("New index: %1\n", f->getTabIndex()); |
|
936 m_tabs->setCurrentIndex (f->getTabIndex()); |
933 m_tabs->setCurrentIndex (f->getTabIndex()); |
937 } |
|
938 |
934 |
939 m_tabs->setTabText (f->getTabIndex(), f->getDisplayName()); |
935 m_tabs->setTabText (f->getTabIndex(), f->getDisplayName()); |
940 |
936 |
941 // If the document.has unsaved changes, draw a little icon next to it to mark that. |
937 // If the document.has unsaved changes, draw a little icon next to it to mark that. |
942 m_tabs->setTabIcon (f->getTabIndex(), f->hasUnsavedChanges() ? getIcon ("file-save") : QIcon()); |
938 m_tabs->setTabIcon (f->getTabIndex(), f->hasUnsavedChanges() ? getIcon ("file-save") : QIcon()); |