[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/kstars/kstars
From:       Jason Harris <kstars () 30doradus ! org>
Date:       2005-09-24 18:15:56
Message-ID: 1127585756.910924.5350.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 463663 by harris:

porting fix from 3.5 branch: objects are indexed by the first letter of 
their *untranslated* English name.


 M  +7 -7      objectnamelist.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/objectnamelist.cpp #463662:463663
@@ -73,7 +73,7 @@
 	// create SkyObjectName with translated name
 	SkyObjectName *soName = new SkyObjectName( iName, object );
 	// append in localized list
-	currentIndex = getIndex( iName );
+	currentIndex = getIndex( name );
 	list[local] [currentIndex].append(soName);
 
 	// type == -1 -> constellation
@@ -87,7 +87,7 @@
 	}
 
 	// append in latin list
-	currentIndex = getIndex(iName);
+	currentIndex = getIndex(name);
 	list[latin][currentIndex].append(soName);
 	// set list unsorted
 	unsorted[currentIndex] = true;
@@ -181,10 +181,10 @@
 void ObjectNameList::remove ( const QString &name ) {
 	setMode(oneList);
 	int index = getIndex(name);
-	SortedList <SkyObjectName> *l = &(list[language][index]);
+	QList<SkyObjectName*> l = list[language][index];
 
 	SkyObjectName *son = find( name );
-	if ( son ) l->remove( son );
+	if ( son ) l.remove( son );
 }
 
 SkyObjectName* ObjectNameList::find(const QString &name) {
@@ -196,9 +196,9 @@
 
 	// first item
 	int lower = 0;
-	SortedList <SkyObjectName> *l = &(list[language][index]);
+	QList<SkyObjectName*> l = list[language][index];
 	// last item
-	int upper = l->count() - 1;
+	int upper = l.size() - 1;
 	// break if list is empty
 	if (upper == -1) return 0;
 
@@ -210,7 +210,7 @@
 	SkyObjectName *o;
 	while (upper >= lower) {
 		next = (lower + upper) / 2;
-		o = l->at(next);
+		o = l[next];
 		if (translatedName == o->text()) { return o; }
 		if (translatedName < o->text())
 			upper = next - 1;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic