[Kstars-devel] KDE/kdeedu/kstars/kstars/tools

Jason Harris kstars at 30doradus.org
Sun May 4 16:38:25 CEST 2008


SVN commit 803937 by harris:

Conjunction tool improvements:
Use QListWidget::clear() to clear the OutputView.
Friendlier date/Time formatting

CCMAIL: kstars-devel at kde.org


 M  +8 -7      conjunctions.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/tools/conjunctions.cpp #803936:803937
@@ -126,16 +126,17 @@
   KStarsDateTime dt;
   QMap<long double, dms>::Iterator it;
 
-  // TODO: Find a better way to clear the OutputView QListWidget
-  QList<QListWidgetItem *>::Iterator qlit;
-  QList<QListWidgetItem *> rowlist = OutputView -> findItems("", Qt::MatchContains); // Dirty way to get the whole list of items
-  for(qlit = rowlist.begin(); qlit != rowlist.end(); ++qlit) {
-    OutputView -> removeItemWidget(*qlit);
-  }
+  OutputView->clear();
+//   // TODO: Find a better way to clear the OutputView QListWidget
+//   QList<QListWidgetItem *>::Iterator qlit;
+//   QList<QListWidgetItem *> rowlist = OutputView -> findItems("", Qt::MatchContains); // Dirty way to get the whole list of items
+//   for(qlit = rowlist.begin(); qlit != rowlist.end(); ++qlit) {
+//     OutputView -> removeItemWidget(*qlit);
+//   }
 
   for(it = conjunctionlist.begin(); it != conjunctionlist.end(); ++it) {
     dt.setDJD( it.key() );
-    OutputView -> addItem(i18n("Conjunction on ") + dt.toString() + i18n(" : Separation is ") + it.data().toDMSString());
+    OutputView -> addItem( i18n("Conjunction on %1 UT: Separation is %2", dt.toString("%a, %d %b %Y %H:%M"), it.data().toDMSString()) );
   }
 }
 


More information about the Kstars-devel mailing list