[Kstars-devel] branches/KDE/3.5/kdeedu/kstars/kstars/tools
Jason Harris
kstars at 30doradus.org
Wed Sep 7 06:23:18 CEST 2005
SVN commit 457938 by harris:
Do not allow the user to add an object to the observing list more
than once.
CCMAIL: kstars-devel at kde.org
M +9 -0 observinglist.cpp
--- branches/KDE/3.5/kdeedu/kstars/kstars/tools/observinglist.cpp #457937:457938
@@ -134,6 +134,15 @@
void ObservingList::slotAddObject( SkyObject *obj ) {
if ( ! obj ) obj = ks->map()->clickedObject();
+ //First, make sure object is not already in the list
+ for ( SkyObject *o = obsList.first(); o; o = obsList.next() ) {
+ if ( obj == o ) {
+ //FIXME STRINGS FREEZE
+ //ks->statusBar()->changeItem( i18n( "%1 is already in the observing list." ).arg( obj->name() ), 0 );
+ return;
+ }
+ }
+
//Insert object in obsList
obsList.append( obj );
if ( ! isModified ) isModified = true;
More information about the Kstars-devel
mailing list