Q_ASSERT(index < count());
if (count() < 2) {
- // Never close the last tab.
+ // Close Dolphin when closing the last tab.
+ parentWidget()->close();
return;
}
if (!tabPage) {
return QString();
}
- QString name = tabPage->activeViewContainer()->getCaption();
+ QString name = tabPage->activeViewContainer()->caption();
// Make sure that a '&' inside the directory name is displayed correctly
// and not misinterpreted as a keyboard shortcut in QTabBar::setTabText()
return name.replace('&', QLatin1String("&&"));