[PATCH] Accelerator saving

Rob Kaper cap at capsi.com
Tue Mar 30 22:21:33 BST 2004


The saving and re-loading of accelerators breaks if the app's ui.rc file has
a comment as a sibling of the ActionProperties element before that element.
The attached patch by Neil should fix that, though we didn't get a chance to
test, since we just use packaged kdelibs instead of building our own these
days.

Can someone test in HEAD and commit and possibly backport?

Rob
-- 
Rob Kaper     | 4/3 Horrorpops ROTTERDAM, 4/4 Horrorpops UTRECHT
cap at capsi.com | 4/29 The Rasmus LONDON, 5/11 Ghost of the Robot AMSTERDAM
www.capsi.com | 5/14 Disney PARIS, 7/19 COPENHAGEN, 7/20 MALMÖ
              | 7/21 STOCKHOLM, 7/23 KÖPING, 8/1 OSLO
-------------- next part --------------
--- kactioncollection.cpp.orig	Thu Feb 26 13:14:59 2004
+++ kactioncollection.cpp	Wed Mar  3 18:09:09 2004
@@ -728,9 +728,10 @@
 	QDomElement it = doc.documentElement();
 	// KXMLGUIFactory::removeDOMComments( it ); <-- What was this for? --ellis
 	it = it.firstChild().toElement();
-	for( ; !it.isNull(); it = it.nextSibling().toElement() ) {
-		if( it.tagName() == tagActionProp ) {
-			elem = it;
+	for( ; !it.isNull(); it = it.nextSibling() ) {
+		QDomElement e = it.toElement();
+		if( !e.isNull() && e.tagName() == tagActionProp ) {
+			elem = e;
 			break;
 		}
 	}
@@ -751,9 +752,10 @@
 
 		// now see if this element already exists
 		QDomElement act_elem;
-		for( it = elem.firstChild().toElement(); !it.isNull(); it = it.nextSibling().toElement() ) {
-			if( it.attribute( attrName ) == sName ) {
-				act_elem = it;
+		for( it = elem.firstChild().toElement(); !it.isNull(); it = it.nextSibling() ) {
+			QDomElement e = it.toElement();
+			if( !e.isNull() && e.attribute( attrName ) == sName ) {
+				act_elem = e;
 				break;
 			}
 		}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040330/775d09bd/attachment.sig>


More information about the kde-core-devel mailing list