[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/marble
From: Inge Wallin <inge () lysator ! liu ! se>
Date: 2007-04-22 22:02:26
Message-ID: 1177279346.623110.9533.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 656992 by ingwa:
Cleaned class PlaceContainer
M +3 -1 ChangeLog
M +14 -5 src/CLEANING
M +9 -4 src/placecontainer.cpp
M +50 -27 src/placecontainer.h
--- trunk/playground/base/marble/ChangeLog #656991:656992
@@ -1,5 +1,7 @@
22.04.07 - ingwa
- Cleaned vectorcomposer.{h,
+ Cleaned placecontainer.{h,cpp}
+ Cleaned vectorcomposer.{h,cpp}
+
22.04.07 - ingwa
First draft of the DESIGN file with headings, but lots of missing
contents.
--- trunk/playground/base/marble/src/CLEANING #656991:656992
@@ -6,6 +6,7 @@
DONE
+====
main.cpp
FastMath.h FastMath.cpp
@@ -14,29 +15,38 @@
GeoPoint.h GeoPoint.cpp
GeoPolygon.h GeoPolygon.cpp
-GridMap.h GridMap.cpp
-vectormap.h vectormap.cpp
-clippainter.h clippainter.cpp
TileLoader.h TileLoader.cpp
TextureTile.h TextureTile.cpp
TextureMapper.h TextureMapper.cpp
+vectormap.h vectormap.cpp
+vectorcomposer.h vectorcomposer.cpp
+GridMap.h GridMap.cpp
+clippainter.h clippainter.cpp
+
+placecontainer.h placecontainer.cpp
+
Model/View:
+-----------
katlasglobe.h katlasglobe.cpp
katlasview.h katlasview.cpp
Widgets:
+--------
katlascontrol.h katlascontrol.cpp
Dialogs:
+--------
katlastilecreatordialog.h katlastilecreatordialog.cpp
DOING
-vectorcomposer.h vectorcomposer.cpp
+=====
TODO
+====
+
httpfetchfile.h httpfetchfile.cpp
katlasaboutdialog.h katlasaboutdialog.cpp
katlasdirs.h
@@ -47,7 +57,6 @@
katlasviewpopupmenu.h katlasviewpopupmenu.cpp
maptheme.h maptheme.cpp
measuretool.h measuretool.cpp
-placecontainer.h placecontainer.cpp
placemark.h placemark.cpp
placemarkmanager.h placemarkmanager.cpp
placemarkmodel.h placemarkmodel.cpp
--- trunk/playground/base/marble/src/placecontainer.cpp #656991:656992
@@ -1,9 +1,14 @@
#include "placecontainer.h"
-PlaceContainer::PlaceContainer(){
- clear();
+
+PlaceContainer::PlaceContainer()
+{
+ clear();
}
-PlaceContainer::PlaceContainer( QString name ) : m_name(name) {
- clear();
+
+PlaceContainer::PlaceContainer( QString name )
+ : m_name(name)
+{
+ clear();
}
--- trunk/playground/base/marble/src/placecontainer.h #656991:656992
@@ -1,44 +1,67 @@
#ifndef PLACECONTAINER_H
#define PLACECONTAINER_H
-#include "placemark.h"
+
#include <QtCore/QVector>
-
#include <QtCore/QDebug>
-inline bool popLessThan( PlaceMark* mark1, PlaceMark* mark2 ){
+#include "placemark.h"
- return mark1->selected() == mark2->selected() ? mark1->population() > mark2->population() :
- mark1->selected() == 1 ? true : false;
- /*
- * If compared items don't differ in terms of being selected
- * compare them based on population numbers.
- * If compared items do differ in terms of being selected
- * then let that be the final criteria.
- */
+inline bool populationLessThan( PlaceMark* mark1, PlaceMark* mark2 )
+{
+
+ return ( mark1->selected() == mark2->selected()
+ ? mark1->population() > mark2->population()
+ : mark1->selected() == 1 ? true : false );
+
+ /*
+ * If compared items don't differ in terms of being selected
+ * compare them based on population numbers.
+ * If compared items do differ in terms of being selected
+ * then let that be the final criteria.
+ */
}
-class PlaceContainer : public QVector<PlaceMark*> {
-public:
- PlaceContainer();
- PlaceContainer( QString name );
- void setName( QString name ){ m_name = name; }
- QString name() const {return m_name; }
- inline void clearTextPixmaps() { foreach ( PlaceMark* mark, *this ) mark->clearTextPixmap(); }
+class PlaceContainer : public QVector<PlaceMark*>
+{
+ public:
+ PlaceContainer();
+ PlaceContainer( QString name );
- inline void deleteAll() { foreach ( PlaceMark* mark, *this ){ if ( mark != 0 ) delete mark; } }
+ void setName( QString name ) { m_name = name; }
+ QString name() const { return m_name; }
- inline void clearSelected() {
- foreach ( PlaceMark* mark, *this ){
- if ( mark != 0 ) mark->setSelected( 0 );
- }
- }
+ inline void clearTextPixmaps()
+ {
+ foreach ( PlaceMark* mark, *this )
+ mark->clearTextPixmap();
+ }
- inline void sort() { qStableSort( begin(), end(), popLessThan ); }
-protected:
- QString m_name;
+ inline void deleteAll()
+ {
+ foreach ( PlaceMark* mark, *this ) {
+ if ( mark != 0 )
+ delete mark;
+ }
+ }
+
+ inline void clearSelected()
+ {
+ foreach ( PlaceMark* mark, *this ) {
+ if ( mark != 0 )
+ mark->setSelected( 0 );
+ }
+ }
+
+ inline void sort()
+ {
+ qStableSort( begin(), end(), populationLessThan );
+ }
+
+ private:
+ QString m_name;
};
#endif // PLACECONTAINER_H
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic