Skip to content

Commit

Permalink
qgsgrassedit.h:
Browse files Browse the repository at this point in the history
  - added include for <vector>

qgis.h:

  - added WKBUnknown to enumerated list to be used as error state

qgisapp.cpp:

  - fixed a for loop

qgisapp.h, qgisiface.h, qgslegend.h, qgslegenditem.h, qgsmapcanvs.h, qgsvectorlayer.h:

  - made copy ctor and assignment operator private since we won't be copying
    any of these

qgsattributetable.cpp, qgsrasterlayer.cpp, qgssymbologyutils.cpp:

  - functions that say they return something should actually return something

*renderer.h:

  - made dtors virtual

qgscoordinatetransform.h:

  - added initializer for xMax

qgsgeomtypedialog.cpp:

  - added return of WKBUnknown when given bad data

qgslabel.cpp, qgslabeldialog.cpp:

  - used static_cast to stomp compiler warning

qgsmapcanvas.cpp:

  - made CanvasProperties a class form struct, partly to find work-around for
    gcc bug and partly to ensure that ctor and assignment operator were
    disabled

  - ensured that members were in the same order in initializer list as they
    were declared

  - now use QgsScaleCalculator::units

qgsproject.cpp:

  - now read and write map units; still need to tie it in with more code

qgsprojectproperties.cpp:

  - now use canonical map units stored in QgsProject singleton object

qgsscalecalculator:

  - now prefer to use QgsScaleCalculator::units instead of int


And many minor formatting changes.


git-svn-id: http://svn.osgeo.org/qgis/trunk@2175 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mcoletti committed Oct 26, 2004
1 parent 2a55f17 commit 5a3869e
Show file tree
Hide file tree
Showing 37 changed files with 559 additions and 205 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Expand Up @@ -3,6 +3,10 @@ ChangeLog,v 1.200 2004/10/21 17:27:35 mcoletti Exp
------------------------------------------------------------------------------
Version 0.6 'Simon' .... development version

2004-10-26 [mcoletti] 0.5.0devel13
** regarding saving and restoring units in project files.
** made many minor bug fixes and tidying up

2004-10-22 [larsl] 0.5.0devel12
** Removed more unused code in the GPS plugin, changed the GPS plugin source
to follow the coding standards better
Expand Down
2 changes: 1 addition & 1 deletion configure.in
Expand Up @@ -26,7 +26,7 @@ dnl ---------------------------------------------------------------------------
MAJOR_VERSION=0
MINOR_VERSION=5
MICRO_VERSION=0
EXTRA_VERSION=12
EXTRA_VERSION=13
if test $EXTRA_VERSION -eq 0; then
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}
else
Expand Down
2 changes: 2 additions & 0 deletions plugins/grass/qgsgrassedit.h
Expand Up @@ -16,6 +16,8 @@
#ifndef QGSGRASSEDIT_H
#define QGSGRASSEDIT_H

#include <vector>

#include <qpointarray.h>
#include <qcursor.h>
#include <qpen.h>
Expand Down
3 changes: 2 additions & 1 deletion src/qgis.h
Expand Up @@ -65,7 +65,8 @@ namespace QGis
WKBPolygon,
WKBMultiPoint,
WKBMultiLineString,
WKBMultiPolygon
WKBMultiPolygon,
WKBUnknown
};
enum VectorType
{
Expand Down
2 changes: 1 addition & 1 deletion src/qgisapp.cpp
Expand Up @@ -1493,7 +1493,7 @@ void QgisApp::saveMapAsImage()
// get a list of supported output image types
int myCounterInt=0;
QString myFilters;
for (myCounterInt;myCounterInt < QImageIO::outputFormats().count(); myCounterInt++ )
for ( ; myCounterInt < QImageIO::outputFormats().count(); myCounterInt++ )
{
QString myFormat=QString(QImageIO::outputFormats().at( myCounterInt ));
QString myFilter = createFileFilter_(myFormat + " format", "*."+myFormat);
Expand Down
7 changes: 7 additions & 0 deletions src/qgisapp.h
Expand Up @@ -341,6 +341,13 @@ public slots:
void setLayerOverviewStatus(QString theLayerId, bool theVisibilityFlag);
void drawExtentRectangle(QPainter *);
private:

/// QgisApp aren't copyable
QgisApp( QgisApp const & );

/// QgisApp aren't copyable
QgisApp & operator=( QgisApp const & );

//! A central registry that keeps track of all loaded layers.
// prefer QgsMapLayerRegistry::instance() to emphasize Singleton
///QgsMapLayerRegistry * mMapLayerRegistry;
Expand Down
7 changes: 7 additions & 0 deletions src/qgisiface.h
Expand Up @@ -86,6 +86,13 @@ class QgisIface : public QgisInterface{
/** Return a pointer to the map layer registry */
QgsMapLayerRegistry * getLayerRegistry();
private:

/// QgisIface aren't copied
QgisIface( QgisIface const & );

/// QgisIface aren't copied
QgisIface & operator=( QgisIface const & );

//! Pointer to the QgisApp object
QgisApp *qgis;
};
Expand Down
7 changes: 7 additions & 0 deletions src/qgsattributetable.cpp
Expand Up @@ -159,6 +159,10 @@ void QgsAttributeTable::sortColumn(int col, bool ascending, bool wholeRows)
repaintContents();
}


/**
XXX Doesn't QString have something ilke this already?
*/
int QgsAttributeTable::compareItems(QString s1, QString s2, bool ascending, bool alphanumeric)
{
if (alphanumeric)
Expand Down Expand Up @@ -212,6 +216,9 @@ int QgsAttributeTable::compareItems(QString s1, QString s2, bool ascending, bool
return 0;
}
}

return 0; // XXX has to return something; is this reasonable?

}

void QgsAttributeTable::qsort(int lower, int upper, int col, bool ascending, bool alphanumeric)
Expand Down
2 changes: 1 addition & 1 deletion src/qgscontinuouscolrenderer.h
Expand Up @@ -33,7 +33,7 @@ class QgsContinuousColRenderer: public QgsRenderer
{
public:
QgsContinuousColRenderer();
~QgsContinuousColRenderer();
virtual ~QgsContinuousColRenderer();
/**Sets the initial symbology configuration for a layer. Besides of applying default symbology settings, an instance of the corresponding renderer dialog is created and associated with the layer (or with the property dialog, if pr is not 0). Finally, a pixmap for the legend is drawn (or, if pr is not 0, it is stored in the property dialog, until the settings are applied).
@param layer the vector layer associated with the renderer
@param pr the property dialog. This is only needed if the renderer is created from the property dialog and not yet associated with the vector layer, otherwise 0*/
Expand Down
11 changes: 9 additions & 2 deletions src/qgscoordinatetransform.h
Expand Up @@ -92,8 +92,15 @@ class QgsCoordinateTransform{

};

inline QgsCoordinateTransform::QgsCoordinateTransform(double mupp, double ymax,
double ymin, double xmin):mapUnitsPerPixel(mupp), yMax(ymax), yMin(ymin), xMin(xmin)
inline QgsCoordinateTransform::QgsCoordinateTransform(double mupp,
double ymax,
double ymin,
double xmin)
: mapUnitsPerPixel(mupp),
yMax(ymax),
yMin(ymin),
xMin(xmin),
xMax(0) // XXX wasn't originally specified? Why?
{
}

Expand Down
2 changes: 2 additions & 0 deletions src/qgsgeomtypedialog.cpp
Expand Up @@ -44,4 +44,6 @@ QGis::WKBTYPE QgsGeomTypeDialog::selectedType()
{
return QGis::WKBPolygon;
}

return QGis::WKBUnknown;
}
2 changes: 1 addition & 1 deletion src/qgsgraduatedmarenderer.h
Expand Up @@ -27,7 +27,7 @@ class QgsGraduatedMaRenderer: public QgsRenderer
{
public:
QgsGraduatedMaRenderer();
~QgsGraduatedMaRenderer();
virtual ~QgsGraduatedMaRenderer();
/**Adds a new item
\param ri a pointer to the QgsRangeRenderItem to be inserted. It has to be created using the new operator and is automatically destroyed when 'removeItems' is called or when the instance is destroyed*/
void addItem(QgsRangeRenderItem* ri);
Expand Down
2 changes: 1 addition & 1 deletion src/qgsgraduatedsymrenderer.h
Expand Up @@ -35,7 +35,7 @@ class QgsGraduatedSymRenderer: public QgsRenderer
{
public:
QgsGraduatedSymRenderer();
~QgsGraduatedSymRenderer();
virtual ~QgsGraduatedSymRenderer();
/**Adds a new item
\param ri a pointer to the QgsRangeRenderItem to be inserted. It has to be created using the new operator and is automatically destroyed when 'removeItems' is called or when the instance is destroyed*/
void addItem(QgsRangeRenderItem* ri);
Expand Down
2 changes: 1 addition & 1 deletion src/qgslabel.cpp
Expand Up @@ -253,7 +253,7 @@ void QgsLabel::renderLabel( QPainter * painter, QgsRect *viewExtent,
//
if (mLabelAttributes->bufferSizeIsSet())
{
int myBufferSize = mLabelAttributes->bufferSize() ;
int myBufferSize = static_cast<int>(mLabelAttributes->bufferSize());
if (mLabelAttributes->bufferColorIsSet())
{
painter->setPen( mLabelAttributes->bufferColor());
Expand Down
14 changes: 7 additions & 7 deletions src/qgslabeldialog.cpp
Expand Up @@ -152,7 +152,7 @@ void QgsLabelDialog::init ( void )
mFont.setFamily(myLabelAttributes->family());
if (myLabelAttributes->sizeIsSet())
{
mFont.setPointSize(myLabelAttributes->size());
mFont.setPointSize(static_cast<int>(myLabelAttributes->size()));

int myTypeInt = myLabelAttributes->sizeType();
if (myTypeInt == QgsLabelAttributes::PointUnits)
Expand All @@ -166,7 +166,7 @@ void QgsLabelDialog::init ( void )
}
else //defaults for when no size has been set
{
mFont.setPointSize(myLabelAttributes->size());
mFont.setPointSize(static_cast<int>(myLabelAttributes->size()));
radioFontSizeUnitsPoints->setChecked(true);
}

Expand Down Expand Up @@ -200,15 +200,15 @@ void QgsLabelDialog::init ( void )
{
radioOffsetUnitsMap->setChecked(true);
}
spinXOffset->setValue(myLabelAttributes->xOffset());
spinYOffset->setValue(myLabelAttributes->yOffset());
spinXOffset->setValue(static_cast<int>(myLabelAttributes->xOffset()));
spinYOffset->setValue(static_cast<int>(myLabelAttributes->yOffset()));
}
else //defaults for when no offset is defined
{
spinXOffset->setValue(0);
spinYOffset->setValue(0);
}
spinAngle->setValue(myLabelAttributes->angle());
spinAngle->setValue(static_cast<int>(myLabelAttributes->angle()));

//the values here may seem a bit counterintuitive - basically everything
//is the reverse of the way you think it should be...
Expand Down Expand Up @@ -237,14 +237,14 @@ void QgsLabelDialog::init ( void )
{
radioBufferUnitsMap->setChecked(true);
}
spinBufferSize->setValue(myLabelAttributes->bufferSize());
spinBufferSize->setValue(static_cast<int>(myLabelAttributes->bufferSize()));
}
else //defaults for when no offset is defined
{
spinBufferSize->setValue(0);
}

spinBufferSize->setValue(myLabelAttributes->bufferSize());
spinBufferSize->setValue(static_cast<int>(myLabelAttributes->bufferSize()));
//TODO - transparency attributes for buffers

}
Expand Down
6 changes: 6 additions & 0 deletions src/qgslegend.h
Expand Up @@ -92,6 +92,12 @@ public slots:

private:

/// QgsLegends aren't copied
QgsLegend( QgsLegend const & );

/// QgsLegends aren't copied
QgsLegend & operator=( QgsLegend const & );

/** handle to main QgisApp
Necessary for binding properly binding context menu to new layers
*/
Expand Down
10 changes: 9 additions & 1 deletion src/qgslegenditem.h
Expand Up @@ -46,7 +46,9 @@ class QgsLegendItem : public QCheckListItem
* @param parent The parent listview
* @param actionInOverview QgisApp's actionInOverview
*/
QgsLegendItem(QgsMapLayer * lyr = 0, QListView * parent = 0, QAction * actionInOverview = 0);
QgsLegendItem(QgsMapLayer * lyr = 0,
QListView * parent = 0,
QAction * actionInOverview = 0);

//! Destructor
virtual ~QgsLegendItem();
Expand Down Expand Up @@ -76,6 +78,12 @@ class QgsLegendItem : public QCheckListItem

private: // Private attributes

/// QgsLegendItem aren't copied
QgsLegendItem( QgsLegendItem const & );

/// QgsLegendItem aren't copied
QgsLegendItem & operator=( QgsLegendItem const & );

/** */
QgsMapLayer * m_layer;

Expand Down

0 comments on commit 5a3869e

Please sign in to comment.