Paste P169

Masterwork From Distant Lands
ActivePublic

Authored by rkflx on Feb 22 2018, 3:00 PM.
diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp
index 44b69088..d004316d 100644
--- a/app/mainwindow.cpp
+++ b/app/mainwindow.cpp
@@ -521,6 +521,10 @@ struct MainWindow::Private
FileOpsContextManagerItem* fileOpsItem = new FileOpsContextManagerItem(mContextManager, mThumbnailView, actionCollection, q);
// Fill sidebar
+
+ // <comment>
+ SignalBlocker blocker(mSideBar->tabBar());
+
SideBarPage* page;
page = new SideBarPage(i18n("Folders"));
page->setObjectName(QLatin1String("folders"));
diff --git a/app/sidebar.cpp b/app/sidebar.cpp
index 0faac954..16c400e6 100644
--- a/app/sidebar.cpp
+++ b/app/sidebar.cpp
@@ -219,6 +219,10 @@ SideBar::SideBar(QWidget* parent)
tabBar()->setFocusPolicy(Qt::NoFocus);
setTabPosition(QTabWidget::South);
setElideMode(Qt::ElideRight);
+
+ connect(tabBar(), &QTabBar::currentChanged, [=]() {
+ GwenviewConfig::setSideBarPage(currentPage());
+ });
}
SideBar::~SideBar()
@@ -234,13 +238,6 @@ QSize SideBar::sizeHint() const
void SideBar::addPage(SideBarPage* page)
{
addTab(page, page->title());
-
- if (count() == 1) {
- // Don't connect before first addTab() since it emits currentChanged()
- connect(tabBar(), &QTabBar::currentChanged, [=]() {
- GwenviewConfig::setSideBarPage(currentPage());
- });
- }
}
QString SideBar::currentPage() const
rkflx edited the content of this paste. (Show Details)Feb 22 2018, 3:00 PM
rkflx changed the title of this paste from untitled to Masterwork From Distant Lands.
rkflx updated the paste's language from autodetect to autodetect.