summaryrefslogtreecommitdiff
path: root/src/history/historypanel.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-05-04 09:19:16 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-05-04 09:19:16 +0200
commit7ea1b6add7ebef4d475801e15e89992e734617c1 (patch)
treea083886be1493a1616ef380e8ccad40e09e49e1f /src/history/historypanel.cpp
parentFix conflicts (diff)
downloadrekonq-7ea1b6add7ebef4d475801e15e89992e734617c1.tar.xz
Memory leaks fixes
first bunch
Diffstat (limited to 'src/history/historypanel.cpp')
-rw-r--r--src/history/historypanel.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/history/historypanel.cpp b/src/history/historypanel.cpp
index 4c4982e9..c8009afd 100644
--- a/src/history/historypanel.cpp
+++ b/src/history/historypanel.cpp
@@ -122,44 +122,39 @@ void HistoryPanel::setup()
void HistoryPanel::contextMenuItem(const QPoint &pos)
{
- KMenu *menu = new KMenu(this);
+ KMenu menu;
KAction* action;
action = new KAction(KIcon("tab-new"), i18n("Open"), this);
connect(action, SIGNAL(triggered()), m_treeView, SLOT(openInCurrentTab()));
- menu->addAction(action);
+ menu.addAction(action);
action = new KAction(KIcon("tab-new"), i18n("Open in New Tab"), this);
connect(action, SIGNAL(triggered()), m_treeView, SLOT(openInNewTab()));
- menu->addAction(action);
+ menu.addAction(action);
action = new KAction(KIcon("window-new"), i18n("Open in New Window"), this);
connect(action, SIGNAL(triggered()), m_treeView, SLOT(openInNewWindow()));
- menu->addAction(action);
+ menu.addAction(action);
action = new KAction(KIcon("edit-copy"), i18n("Copy Link Address"), this);
connect(action, SIGNAL(triggered()), m_treeView, SLOT(copyToClipboard()));
- menu->addAction(action);
+ menu.addAction(action);
- if (!menu)
- return;
- menu->popup(m_treeView->mapToGlobal(pos));
+ menu.exec(m_treeView->mapToGlobal(pos));
}
void HistoryPanel::contextMenuGroup(const QPoint &pos)
{
- KMenu *menu = new KMenu(this);
+ KMenu menu;
KAction* action;
action = new KAction(KIcon("tab-new"), i18n("Open Folder in Tabs"), this);
connect(action, SIGNAL(triggered()), this, SLOT(openAll()));
+ menu.addAction(action);
- menu->addAction(action);
-
- if (!menu)
- return;
- menu->popup(m_treeView->mapToGlobal(pos));
+ menu.exec(m_treeView->mapToGlobal(pos));
}