Commit 1cc5014e authored by Joris Guisson's avatar Joris Guisson
Browse files

Backport dangling pointer to menu crash fix from trunk

svn path=/branches/stable/extragear-kde4/network/ktorrent/; revision=991830
parent ecfa8de9
......@@ -4,6 +4,7 @@ Changes in 3.2.3:
- Fix bug in sleep suppression feature causing it to not work when torrents get started at startup (195991)
- Also announce to DHT node when we get back a GetPeers with nodes (194366)
- Use deleteLater when removing torrents this should prevent a crash (197421)
- Do not keep pointer to view menu and groupview menu, this causes crashes when toolbars are reconfigured (198963)
Changes in 3.2.2 :
- Fix crash when changing speed limits using system tray menu (188447)
......
......@@ -116,7 +116,6 @@ namespace kt
connect(gman,SIGNAL(defaultGroupAdded(Group*)),this,SLOT(defaultGroupAdded(Group*)));
current_item = 0;
menu = 0;
setupActions(gui->actionCollection());
......@@ -416,9 +415,8 @@ namespace kt
open_in_new_tab->setEnabled(g != 0);
if (!menu)
menu = (KMenu*)gui->container("GroupsMenu");
KMenu* menu = qobject_cast<KMenu*>(gui->container("GroupsMenu"));
if (menu)
menu->popup(mapToGlobal(p));
}
......
......@@ -113,7 +113,6 @@ namespace kt
Group* current;
GroupViewItem* current_item;
KMenu* menu;
KAction* new_group;
KAction* edit_group;
KAction* remove_group;
......
......@@ -44,7 +44,6 @@ namespace kt
{
ViewManager::ViewManager(Group* all_group,GUI* gui,Core* core) : QObject(gui),gui(gui),core(core),current(0),all_group(all_group)
{
view_menu = 0;
}
ViewManager::~ViewManager()
......@@ -640,18 +639,19 @@ namespace kt
if (!v)
return;
KMenu* view_menu = qobject_cast<KMenu*>(gui->container("ViewMenu"));
if (!view_menu)
return;
QList<QAction*> actions;
QMap<Group*,QAction*>::iterator j = group_actions.begin();
while (j != group_actions.end())
{
view_menu = (KMenu*)gui->container("ViewMenu");
if (!view_menu)
{
Out(SYS_GEN|LOG_NOTICE) << "Failed to create ViewMenu" << endl;
return;
}
gui->plugActionList("view_groups_list",group_actions.values());
actions.append(j.value());
j++;
}
gui->plugActionList("view_groups_list",actions);
gui->unplugActionList("view_columns_list");
gui->plugActionList("view_columns_list",v->columnActionList());
......
......@@ -169,7 +169,6 @@ namespace kt
View* current;
QList<View*> views;
Group* all_group;
KMenu* view_menu;
// actions for the view menu
QAction* start_torrent;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment