summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-11-08 23:54:37 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-11-14 05:52:20 +0100
commite1bd91da7a5c4980a4d6a1e29e51a828644508e8 (patch)
treee5a66fd7c277a16d9c59ec2e08fc5b482eabd35f /src/mainview.cpp
parentRemove postLaunch calls (diff)
downloadrekonq-e1bd91da7a5c4980a4d6a1e29e51a828644508e8.tar.xz
Remove mainWindow pointer from mainview class.
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r--src/mainview.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 80457252..15c78f5a 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -59,12 +59,11 @@
//Hack:
QString temporaryUglyHackString = "";
-MainView::MainView(MainWindow *parent)
+MainView::MainView(QWidget *parent)
: KTabWidget(parent)
, m_widgetBar(new StackedUrlBar(this))
, m_addTabButton(0)
, m_currentTabIndex(0)
- , m_parentWindow(parent)
{
// setting tabbar
TabBar *tabBar = new TabBar(this);
@@ -107,9 +106,9 @@ MainView::MainView(MainWindow *parent)
}
-void MainView::addNewTabButton()
+void MainView::addNewTabButton(QAction *newTabAction)
{
- m_addTabButton->setDefaultAction(m_parentWindow->actionByName("new_tab"));
+ m_addTabButton->setDefaultAction(newTabAction);
m_addTabButton->setAutoRaise(true);
m_addTabButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
@@ -367,7 +366,8 @@ void MainView::windowCloseRequested()
{
if (count() == 1)
{
- m_parentWindow->close();
+ MainWindow *w = qobject_cast<MainWindow *>(parent());
+ w->close();
}
else
{
@@ -423,7 +423,8 @@ void MainView::closeTab(int index, bool del)
if (ReKonfig::lastTabClosesWindow())
{
// closing window...
- m_parentWindow->close();
+ MainWindow *w = qobject_cast<MainWindow *>(parent());
+ w->close();
return;
}