Skip to content

Commit f74b6b0

Browse files
author
timlinux
committed
API cleanups to qgis project and maprenderer classes
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9536 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 72d793b commit f74b6b0

14 files changed

+24
-24
lines changed

python/core/qgsmaprenderer.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class QgsMapRenderer : QObject
4444
void setMapUnits(QGis::UnitType u);
4545

4646
//! sets whether map image will be for overview
47-
void setOverview(bool isOverview = true);
47+
void enableOverviewMode(bool isOverview = true);
4848

4949
void setOutputSize(QSize size, int dpi);
5050

python/gui/qgsmapcanvas.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class QgsMapCanvas : QGraphicsView
5858

5959
void updateOverview();
6060

61-
void setOverview(QgsMapOverviewCanvas* overview);
61+
void enableOverviewMode(QgsMapOverviewCanvas* overview);
6262

6363
QgsMapCanvasMap* map();
6464

src/app/legend/qgslegend.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ void QgsLegend::updateOverview()
13991399
mMapCanvas->updateOverview();
14001400
}
14011401

1402-
void QgsLegend::setOverviewAllLayers( bool isInOverview )
1402+
void QgsLegend::enableOverviewModeAllLayers( bool isInOverview )
14031403
{
14041404
QTreeWidgetItem* theItem = firstItem();
14051405
while ( theItem )

src/app/legend/qgslegend.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class QgsLegend : public QTreeWidget
154154
void updateOverview();
155155

156156
/**Show/remove all layer in/from overview*/
157-
void setOverviewAllLayers( bool isInOverview );
157+
void enableOverviewModeAllLayers( bool isInOverview );
158158

159159
/**Adds an entry to mPixmapWidthValues*/
160160
void addPixmapWidthValue( int width );

src/app/qgisapp.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1506,8 +1506,8 @@ void QgisApp::setupConnections()
15061506
connect( mStopRenderButton, SIGNAL( clicked() ), this, SLOT( stopRendering() ) );
15071507

15081508
// Connect warning dialog from project reading
1509-
connect( QgsProject::instance(), SIGNAL( warnOlderProjectVersion( QString ) ),
1510-
this, SLOT( warnOlderProjectVersion( QString ) ) );
1509+
connect( QgsProject::instance(), SIGNAL( oldProjectVersionWarning( QString ) ),
1510+
this, SLOT( oldProjectVersionWarning( QString ) ) );
15111511

15121512
}
15131513
void QgisApp::createCanvas()
@@ -1580,7 +1580,7 @@ void QgisApp::createOverview()
15801580
// add to the Panel submenu
15811581
mPanelMenu->addAction( mOverviewDock->toggleViewAction() );
15821582

1583-
mMapCanvas->setOverview( overviewCanvas );
1583+
mMapCanvas->enableOverviewMode( overviewCanvas );
15841584

15851585
// moved here to set anti aliasing to both map canvas and overview
15861586
QSettings mySettings;
@@ -3469,7 +3469,7 @@ void QgisApp::addAllToOverview()
34693469
{
34703470
if ( mMapLegend )
34713471
{
3472-
mMapLegend->setOverviewAllLayers( true );
3472+
mMapLegend->enableOverviewModeAllLayers( true );
34733473
}
34743474

34753475
// notify the project we've made a change
@@ -3481,7 +3481,7 @@ void QgisApp::removeAllFromOverview()
34813481
{
34823482
if ( mMapLegend )
34833483
{
3484-
mMapLegend->setOverviewAllLayers( false );
3484+
mMapLegend->enableOverviewModeAllLayers( false );
34853485
}
34863486

34873487
// notify the project we've made a change
@@ -5627,7 +5627,7 @@ void QgisApp::newBookmark()
56275627
// Slot that gets called when the project file was saved with an older
56285628
// version of QGIS
56295629

5630-
void QgisApp::warnOlderProjectVersion( QString oldVersion )
5630+
void QgisApp::oldProjectVersionWarning( QString oldVersion )
56315631
{
56325632
QSettings settings;
56335633

src/app/qgisapp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ class QgisApp : public QMainWindow
548548
void showPythonDialog();
549549

550550
//! Shows a warning when an old project file is read.
551-
void warnOlderProjectVersion( QString );
551+
void oldProjectVersionWarning( QString );
552552

553553
//! Toggle map tips on/off
554554
void toggleMapTips();

src/app/qgsmeasuredialog.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ void QgsMeasureDialog::mouseMove( QgsPoint &point )
8888
{
8989
QList<QgsPoint> tmpPoints = mTool->points();
9090
tmpPoints.append( point );
91-
double area = mTool->canvas()->mapRenderer()->distArea()->measurePolygon( tmpPoints );
91+
double area = mTool->canvas()->mapRenderer()->distanceArea()->measurePolygon( tmpPoints );
9292
editTotal->setText( formatArea( area ) );
9393
}
9494
else if ( !mMeasureArea && mTool->points().size() > 0 )
9595
{
9696
QgsPoint p1( mTool->points().last() ), p2( point );
9797

98-
double d = mTool->canvas()->mapRenderer()->distArea()->measureLine( p1, p2 );
98+
double d = mTool->canvas()->mapRenderer()->distanceArea()->measureLine( p1, p2 );
9999
QTreeWidgetItem *item = mTable->topLevelItem( mTable->topLevelItemCount() - 1 );
100100
item->setText( 0, QLocale::system().toString( d, 'f', 2 ) );
101101
editTotal->setText( formatDistance( mTotal + d ) );
@@ -107,7 +107,7 @@ void QgsMeasureDialog::addPoint( QgsPoint &point )
107107
int numPoints = mTool->points().size();
108108
if ( mMeasureArea && numPoints > 2 )
109109
{
110-
double area = mTool->canvas()->mapRenderer()->distArea()->measurePolygon( mTool->points() );
110+
double area = mTool->canvas()->mapRenderer()->distanceArea()->measurePolygon( mTool->points() );
111111
editTotal->setText( formatArea( area ) );
112112
}
113113
else if ( !mMeasureArea && numPoints > 1 )
@@ -116,7 +116,7 @@ void QgsMeasureDialog::addPoint( QgsPoint &point )
116116

117117
QgsPoint p1 = mTool->points()[last], p2 = mTool->points()[last+1];
118118

119-
double d = mTool->canvas()->mapRenderer()->distArea()->measureLine( p1, p2 );
119+
double d = mTool->canvas()->mapRenderer()->distanceArea()->measureLine( p1, p2 );
120120

121121
mTotal += d;
122122
editTotal->setText( formatDistance( mTotal ) );

src/app/qgsmeasuretool.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void QgsMeasureTool::activate()
6767

6868
// If we suspect that they have data that is projected, yet the
6969
// map CRS is set to a geographic one, warn them.
70-
if ( mCanvas->mapRenderer()->distArea()->geographic() &&
70+
if ( mCanvas->mapRenderer()->distanceArea()->geographic() &&
7171
( mCanvas->extent().height() > 360 ||
7272
mCanvas->extent().width() > 720 ) )
7373
{

src/core/qgsmaprenderer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ class CORE_EXPORT QgsMapRenderer : public QObject
8282
void updateScale();
8383

8484
//! Return the measuring object
85-
QgsDistanceArea* distArea() { return mDistArea; }
85+
QgsDistanceArea* distanceArea() { return mDistArea; }
8686
QGis::UnitType mapUnits() const;
8787
void setMapUnits( QGis::UnitType u );
8888

8989
//! sets whether map image will be for overview
90-
void setOverview( bool isOverview = true ) { mOverview = isOverview; }
90+
void enableOverviewMode( bool isOverview = true ) { mOverview = isOverview; }
9191

9292
void setOutputSize( QSize size, int dpi );
9393

src/core/qgsproject.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,8 @@ bool QgsProject::read()
797797
QgsProjectFileTransform projectFile( *doc, fileVersion );
798798

799799
//! Shows a warning when an old project file is read.
800-
emit warnOlderProjectVersion( fileVersion.text() );
801-
QgsDebugMsg( "Emitting warnOlderProjectVersion(oldVersion)." );
800+
emit oldProjectVersionWarning( fileVersion.text() );
801+
QgsDebugMsg( "Emitting oldProjectVersionWarning(oldVersion)." );
802802

803803
projectFile.dump();
804804

src/core/qgsproject.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class CORE_EXPORT QgsProject : public QObject
264264
void writeProject( QDomDocument & );
265265

266266
//! emitted when an old project file is read.
267-
void warnOlderProjectVersion( QString );
267+
void oldProjectVersionWarning( QString );
268268

269269
private:
270270

src/gui/qgsmapcanvas.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ void QgsMapCanvas::setLayerSet( QList<QgsMapCanvasLayer>& layers )
306306

307307
} // addLayer
308308

309-
void QgsMapCanvas::setOverview( QgsMapOverviewCanvas* overview )
309+
void QgsMapCanvas::enableOverviewMode( QgsMapOverviewCanvas* overview )
310310
{
311311
if ( mMapOverview )
312312
{

src/gui/qgsmapcanvas.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
110110

111111
void updateOverview();
112112

113-
void setOverview( QgsMapOverviewCanvas* overview );
113+
void enableOverviewMode( QgsMapOverviewCanvas* overview );
114114

115115
QgsMapCanvasMap* map();
116116

src/gui/qgsmapoverviewcanvas.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ QgsMapOverviewCanvas::QgsMapOverviewCanvas( QWidget * parent, QgsMapCanvas* mapC
7272
mPanningWidget = new QgsPanningWidget( this );
7373

7474
mMapRenderer = new QgsMapRenderer;
75-
mMapRenderer->setOverview();
75+
mMapRenderer->enableOverviewMode();
7676

7777
setBackgroundColor( palette().window().color() );
7878
}

0 commit comments

Comments
 (0)