[Pkg-voip-commits] r5380 - in /mumble/trunk/debian/patches: 00list 02-copy-children-when-moving.dpatch

the-me-guest at alioth.debian.org the-me-guest at alioth.debian.org
Tue Mar 25 19:08:00 UTC 2008


Author: the-me-guest
Date: Tue Mar 25 19:08:00 2008
New Revision: 5380

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=5380
Log:
Added 02-copy-children-when-moving.dpatch which avoids a crash. Thanks to Torvald Natvig.

Added:
    mumble/trunk/debian/patches/02-copy-children-when-moving.dpatch
Modified:
    mumble/trunk/debian/patches/00list

Modified: mumble/trunk/debian/patches/00list
URL: http://svn.debian.org/wsvn/pkg-voip/mumble/trunk/debian/patches/00list?rev=5380&op=diff
==============================================================================
--- mumble/trunk/debian/patches/00list (original)
+++ mumble/trunk/debian/patches/00list Tue Mar 25 19:08:00 2008
@@ -1,1 +1,2 @@
 01-use-external-speex.dpatch
+02-copy-children-when-moving.dpatch

Added: mumble/trunk/debian/patches/02-copy-children-when-moving.dpatch
URL: http://svn.debian.org/wsvn/pkg-voip/mumble/trunk/debian/patches/02-copy-children-when-moving.dpatch?rev=5380&op=file
==============================================================================
--- mumble/trunk/debian/patches/02-copy-children-when-moving.dpatch (added)
+++ mumble/trunk/debian/patches/02-copy-children-when-moving.dpatch Tue Mar 25 19:08:00 2008
@@ -1,0 +1,44 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 02-copy-children-when-moving.dpatch by Thorvald Natvig.
+##
+## DP: Avoid crash when renaming tree objects.
+
+ at DPATCH@
+
+--- mumble-1.1.3.orig/src/mumble/PlayerModel.cpp
++++ mumble-1.1.3/src/mumble/PlayerModel.cpp
+@@ -75,6 +75,15 @@
+ 		c_qhPlayers.remove(pPlayer);
+ }
+ 
++void ModelItem::stealChildren(ModelItem *other) {
++	Q_ASSERT(qlChildren.count() == 0);
++
++	qlChildren = other->qlChildren;
++	other->qlChildren.clear();
++	foreach(ModelItem *mi, qlChildren)
++	mi->parent = this;
++}
++
+ ModelItem *ModelItem::child(int idx) const {
+ 	if (! validRow(idx))
+ 		return NULL;
+@@ -488,6 +497,8 @@
+ 		newparent->cChan->addPlayer(item->pPlayer);
+ 	}
+ 
++	t->stealChildren(item);
++
+ 	endInsertRows();
+ 
+ 	changePersistentIndex(createIndex(oldrow, 0, item), createIndex(newrow, 0, t));
+--- mumble-1.1.3.orig/src/mumble/PlayerModel.h
++++ mumble-1.1.3/src/mumble/PlayerModel.h
+@@ -74,6 +74,7 @@
+ 	int rows() const;
+ 	int insertIndex(Channel *c) const;
+ 	int insertIndex(ClientPlayer *p) const;
++	void stealChildren(ModelItem *other);
+ };
+ 
+ class ChannelItem;




More information about the Pkg-voip-commits mailing list