summaryrefslogtreecommitdiff
path: root/src/tabwindow
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-10-08 19:41:55 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:05 +0100
commit43b0121f717dda8a1f179fb585a3c78e3552430c (patch)
tree60b7132e4440685d7e905fae8afc7df447993748 /src/tabwindow
parentSaving the "pinned" state in the sessionmanager (diff)
downloadrekonq-43b0121f717dda8a1f179fb585a3c78e3552430c.tar.xz
Restoring pinned tabs, yeah!!!! :D
Diffstat (limited to 'src/tabwindow')
-rw-r--r--src/tabwindow/tabbar.cpp8
-rw-r--r--src/tabwindow/tabwindow.cpp9
2 files changed, 12 insertions, 5 deletions
diff --git a/src/tabwindow/tabbar.cpp b/src/tabwindow/tabbar.cpp
index 7e493fec..feb3fd8d 100644
--- a/src/tabwindow/tabbar.cpp
+++ b/src/tabwindow/tabbar.cpp
@@ -34,6 +34,7 @@
#include "webwindow.h"
#include "iconmanager.h"
+#include "sessionmanager.h"
#include <KAcceleratorManager>
#include <KAction>
@@ -511,7 +512,7 @@ void TabBar::pinTab()
tabButton(index, QTabBar::RightSide)->hide();
setTabText(index, QString());
- // workaround: "fix" the icon
+ // workaround: "fix" the icon (or at least, try to...)
QLabel *label = qobject_cast<QLabel* >(tabButton(index, QTabBar::LeftSide));
if (!label)
label = new QLabel(this);
@@ -522,6 +523,7 @@ void TabBar::pinTab()
KIcon ic = IconManager::self()->iconForUrl(w->webWindow(index)->url());
label->setPixmap(ic.pixmap(16, 16));
+ SessionManager::self()->saveSession();
}
@@ -554,7 +556,7 @@ void TabBar::unpinTab()
tabButton(index, QTabBar::RightSide)->show();
setTabText(index, w->webWindow(index)->title());
- // workaround: "fix" the icon
+ // workaround: "fix" the icon (or at least, try to...)
QLabel *label = qobject_cast<QLabel* >(tabButton(index, QTabBar::LeftSide));
if (!label)
label = new QLabel(this);
@@ -564,4 +566,6 @@ void TabBar::unpinTab()
KIcon ic = IconManager::self()->iconForUrl(w->webWindow(index)->url());
label->setPixmap(ic.pixmap(16, 16));
+
+ SessionManager::self()->saveSession();
}
diff --git a/src/tabwindow/tabwindow.cpp b/src/tabwindow/tabwindow.cpp
index 55d680b5..203da30a 100644
--- a/src/tabwindow/tabwindow.cpp
+++ b/src/tabwindow/tabwindow.cpp
@@ -331,9 +331,12 @@ void TabWindow::tabLoadFinished(bool ok)
QLabel *label = qobject_cast<QLabel* >(tabBar()->tabButton(index, QTabBar::LeftSide));
QMovie *movie = label->movie();
- movie->stop();
- delete movie;
-
+ if (movie)
+ {
+ movie->stop();
+ delete movie;
+ }
+
label->setMovie(0);
KIcon ic = IconManager::self()->iconForUrl(tab->url());