| 531 | } |
| 532 | |
| 533 | void Container::documentTitleChanged(Sublime::Document* doc) |
| 534 | { |
| 535 | Q_D(Container); |
| 536 | |
| 537 | QHashIterator<QWidget*, View*> it = d->viewForWidget; |
| 538 | while (it.hasNext()) { |
| 539 | Sublime::View* view = it.next().value(); |
| 540 | if (view->document() == doc) { |
| 541 | if (currentView() == view) { |
| 542 | d->fileNameCorner->setText( doc->title(Document::Extended) ); |
| 543 | // TODO KF6: remove this as soon as it is included upstream and we reqire |
| 544 | // that version |
| 545 | // NOTE: this has languished and is still not upstream as of 6.3.0 |
| 546 | // see https://phabricator.kde.org/D7010 |
| 547 | d->fileNameCorner->updateGeometry(); |
| 548 | } |
| 549 | int tabIndex = d->stack->indexOf(it.key()); |
| 550 | if (tabIndex != -1) { |
| 551 | d->tabBar->setTabText(tabIndex, doc->title()); |
| 552 | } |
| 553 | |
| 554 | // Update document list popup title (and icon in case the extension changes and affects the MIME type) |
| 555 | d->renameInDocumentListMenu(view); |
| 556 | break; |
| 557 | } |
| 558 | } |
| 559 | } |
| 560 | |
| 561 | int Container::count() const |
| 562 | { |