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

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

SVN commit 457939 by harris:

Forward-port: Do not allow the user to add an object to the observing 
list more than once



 M  +8 -0      observinglist.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/tools/observinglist.cpp #457938:457939
@@ -134,6 +134,14 @@
 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 ) {
+			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; 
[prev in list] [next in list] [prev in thread] [next in thread] 

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