rpms/kdenetwork/devel kdenetwork-3.5.4-kde#133995.patch, NONE, 1.1 kdenetwork.spec, 1.90, 1.91

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Sep 19 09:14:33 UTC 2006


Author: than

Update of /cvs/dist/rpms/kdenetwork/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv21116

Modified Files:
	kdenetwork.spec 
Added Files:
	kdenetwork-3.5.4-kde#133995.patch 
Log Message:
fix #133995, emoticon parsing if there are sub-emoticons



kdenetwork-3.5.4-kde#133995.patch:
 kopeteemoticons.cpp |   18 ++++++++++++++++++
 kopeteemoticons.h   |    6 ++++++
 2 files changed, 24 insertions(+)

--- NEW FILE kdenetwork-3.5.4-kde#133995.patch ---
Index: kopete/libkopete/private/kopeteemoticons.cpp
===================================================================
--- kopete/libkopete/private/kopeteemoticons.cpp	(Revision 584917)
+++ kopete/libkopete/private/kopeteemoticons.cpp	(Revision 584918)
@@ -48,6 +48,8 @@
 struct Emoticons::Emoticon
 {
 	Emoticon(){}
+	/* sort by longest to shortest matchText */
+	bool operator< (const Emoticon &e){ return matchText.length() > e.matchText.length(); }
 	QString matchText;
 	QString matchTextEscaped;
 	QString	picPath;
@@ -424,6 +426,7 @@
 		node = node.nextSibling();
 	}
 	mapFile.close();
+	sortEmoticons();
 }
 
 
@@ -492,12 +495,27 @@
 		node = node.nextSibling();
 	}
 	mapFile.close();
+	sortEmoticons();
 }
 
 
+void Emoticons::sortEmoticons()
+{
+	/* sort strings in order of longest to shortest to provide convenient input for
+		greedy matching in the tokenizer */
+	QValueList<QChar> keys = d->emoticonMap.keys();
+	for ( QValueList<QChar>::const_iterator it = keys.begin(); it != keys.end(); ++it )
+	{
+		QChar key = (*it);
+		QValueList<Emoticon> keyValues = d->emoticonMap[key];
+ 		qHeapSort(keyValues.begin(), keyValues.end());
+ 		d->emoticonMap[key] = keyValues;
+	}
+}
 
 
 
+
 QMap<QString, QString> Emoticons::emoticonAndPicList()
 {
 	return d->emoticonAndPicList;
Index: kopete/libkopete/private/kopeteemoticons.h
===================================================================
--- kopete/libkopete/private/kopeteemoticons.h	(Revision 584917)
+++ kopete/libkopete/private/kopeteemoticons.h	(Revision 584918)
@@ -156,6 +156,12 @@
 	 * @see initEmoticons
 	 */
 	void initEmoticon_JEP0038( const QString & filename);
+	
+	/**
+	 * sorts emoticons for convenient parsing, which yields greedy matching on
+	 * matchText
+	 */
+	void sortEmoticons();
 
 
 	struct Emoticon;


Index: kdenetwork.spec
===================================================================
RCS file: /cvs/dist/rpms/kdenetwork/devel/kdenetwork.spec,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- kdenetwork.spec	6 Sep 2006 16:56:33 -0000	1.90
+++ kdenetwork.spec	19 Sep 2006 09:14:31 -0000	1.91
@@ -13,7 +13,7 @@
 
 Name: kdenetwork
 Version: 3.5.4
-Release: 4%{?dist}
+Release: 5%{?dist}
 Summary: K Desktop Environment - Network Applications
 Epoch: 7
 Group: Applications/Internet
@@ -38,6 +38,7 @@
 Patch100: kdenetwork-3.5.4-kde#130630.patch
 Patch101: kdenetwork-3.5.4-kde#73519.patch
 Patch102: kdenetwork-3.5.4-kde#63494.patch
+Patch103: kdenetwork-3.5.4-kde#133995.patch
 
 Requires: kdelibs >= %{kdelibs_epoch}:%{version}
 Requires: kdebase >= %{kdebase_epoch}:%{version}
@@ -86,6 +87,7 @@
 %patch100 -p0 -b .kde#130630
 %patch101 -p0 -b .kde#73519
 %patch102 -p0 -b .kde#63494
+%patch103 -p0 -b .kde#133995
 
 echo "DO_NOT_COMPILE=\"\$DO_NOT_COMPILE nowlistening\"" > kopete/plugins/nowlistening/configure.in.in
 
@@ -235,6 +237,10 @@
 %endif
 
 %changelog
+* Tue Sep 19 2006 Than Ngo <than at redhat.com> 7:3.5.4-5
+- apply upstream patches
+    fix #133995, emoticon parsing if there are sub-emoticons
+
 * Wed Sep 06 2006 Than Ngo <than at redhat.com> 7:3.5.4-4
 - fix dependency problem
 




More information about the fedora-cvs-commits mailing list