// for each directory. If the "split view" option is enabled, two
// directories are shown inside one tab (see openDirectories()).
QList<QUrl> dirs;
- foreach (const QUrl& url, files) {
+ for (const QUrl& url : files) {
const QUrl dir(url.adjusted(QUrl::RemoveFilename));
if (!dirs.contains(dir)) {
dirs.append(dir);
}
DolphinTabPage* tabPage = tabPageAt(index);
- emit rememberClosedTab(tabPage->activeViewContainer()->url(), tabPage->saveState());
+ Q_EMIT rememberClosedTab(tabPage->activeViewContainer()->url(), tabPage->saveState());
removeTab(index);
tabPage->deleteLater();
const int index = indexOf(qobject_cast<QWidget*>(sender()));
if (index >= 0) {
tabBar()->setTabText(index, tabName(tabPageAt(index)));
+ tabBar()->setTabToolTip(index, url.toDisplayString(QUrl::PreferLocalFile));
if (tabBar()->isVisible()) {
tabBar()->setTabIcon(index, QIcon::fromTheme(KIO::iconNameForUrl(url)));
} else {
// Emit the currentUrlChanged signal if the url of the current tab has been changed.
if (index == currentIndex()) {
- emit currentUrlChanged(url);
+ Q_EMIT currentUrlChanged(url);
}
}
}
}
DolphinTabPage* tabPage = tabPageAt(index);
DolphinViewContainer* viewContainer = tabPage->activeViewContainer();
- emit activeViewChanged(viewContainer);
- emit currentUrlChanged(viewContainer->url());
+ Q_EMIT activeViewChanged(viewContainer);
+ Q_EMIT currentUrlChanged(viewContainer->url());
tabPage->setActive(true);
m_lastViewedTab = index;
}
if (count() > 1) {
// Resolve all pending tab icons
for (int i = 0; i < count(); ++i) {
+ const QUrl url = tabPageAt(i)->activeViewContainer()->url();
if (tabBar()->tabIcon(i).isNull()) {
- tabBar()->setTabIcon(i, QIcon::fromTheme(KIO::iconNameForUrl(tabPageAt(i)->activeViewContainer()->url())));
+ tabBar()->setTabIcon(i, QIcon::fromTheme(KIO::iconNameForUrl(url)));
+ }
+ if (tabBar()->tabToolTip(i).isEmpty()) {
+ tabBar()->setTabToolTip(index, url.toDisplayString(QUrl::PreferLocalFile));
}
}
tabBar()->show();
}
- emit tabCountChanged(count());
+ Q_EMIT tabCountChanged(count());
}
void DolphinTabWidget::tabRemoved(int index)
tabBar()->hide();
}
- emit tabCountChanged(count());
+ Q_EMIT tabCountChanged(count());
}
QString DolphinTabWidget::tabName(DolphinTabPage* tabPage) const