- connect(tabPage, SIGNAL(activeViewChanged(DolphinViewContainer*)),
- this, SIGNAL(activeViewChanged(DolphinViewContainer*)));
- connect(tabPage, SIGNAL(activeViewUrlChanged(KUrl)),
- this, SLOT(tabUrlChanged(KUrl)));
- addTab(tabPage, KIcon(KMimeType::iconNameForUrl(primaryUrl)), tabName(primaryUrl));
+ connect(tabPage, &DolphinTabPage::activeViewChanged,
+ this, &DolphinTabWidget::activeViewChanged);
+ connect(tabPage, &DolphinTabPage::activeViewUrlChanged,
+ this, &DolphinTabWidget::tabUrlChanged);
+ int newTabIndex = -1;
+ if (tabPlacement == AfterCurrentTab) {
+ newTabIndex = currentIndex() + 1;
+ }
+ insertTab(newTabIndex, tabPage, QIcon::fromTheme(KIO::iconNameForUrl(primaryUrl)), tabName(tabPage));