From c4022cf9bdfcda991a574c49cf31059305d893e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?=
 <luisangelsm@gmail.com>
Date: Wed, 10 Dec 2014 16:24:04 +0100
Subject: [PATCH] fixed regression in main tool bar title (not being shown)

---
 YACReaderLibrary/library_window.cpp                  | 10 ++++++++++
 YACReaderLibrary/library_window.h                    |  1 +
 YACReaderLibrary/yacreader_navigation_controller.cpp |  4 ++++
 3 files changed, 15 insertions(+)

diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp
index c688fe3f..eaf91cb8 100644
--- a/YACReaderLibrary/library_window.cpp
+++ b/YACReaderLibrary/library_window.cpp
@@ -1732,6 +1732,16 @@ void LibraryWindow::onAddComicsToLabel()
     comicsModel->addComicsToLabel(comics,labelId);
 }
 
+void LibraryWindow::setToolbarTitle(const QModelIndex &modelIndex)
+{
+#ifndef Q_OS_MAC
+    if(!modelIndex.isValid())
+        libraryToolBar->setCurrentFolderName(selectedLibrary->currentText());
+    else
+        libraryToolBar->setCurrentFolderName(modelIndex.data().toString());
+#endif
+}
+
 void LibraryWindow::selectSubfolder(const QModelIndex &mi, int child)
 {
     QModelIndex dest = foldersModel->index(child,0,mi);
diff --git a/YACReaderLibrary/library_window.h b/YACReaderLibrary/library_window.h
index abc88731..a2b7a9e3 100644
--- a/YACReaderLibrary/library_window.h
+++ b/YACReaderLibrary/library_window.h
@@ -394,6 +394,7 @@ public slots:
     void showComicsItemContextMenu(const QPoint & point);
     void setupAddToSubmenu(QMenu & menu);
     void onAddComicsToLabel();
+    void setToolbarTitle(const QModelIndex & modelIndex);
 
 };
 
diff --git a/YACReaderLibrary/yacreader_navigation_controller.cpp b/YACReaderLibrary/yacreader_navigation_controller.cpp
index 57e43c72..3996932b 100644
--- a/YACReaderLibrary/yacreader_navigation_controller.cpp
+++ b/YACReaderLibrary/yacreader_navigation_controller.cpp
@@ -43,6 +43,8 @@ void YACReaderNavigationController::selectedFolder(const QModelIndex &mi)
     }
 
     loadFolderInfo(modelIndex);
+
+    libraryWindow->setToolbarTitle(modelIndex);
 }
 
 void YACReaderNavigationController::reselectCurrentFolder()
@@ -202,6 +204,8 @@ void YACReaderNavigationController::selectedList(const QModelIndex &mi)
     }
 
     loadListInfo(modelIndex);
+
+    libraryWindow->setToolbarTitle(modelIndex);
 }
 
 void YACReaderNavigationController::reselectCurrentList()