Skip to content

Commit 1035b08

Browse files
author
g_j_m
committed
Fix compiler warnings in app and ui directories
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6500 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a6f6c95 commit 1035b08

9 files changed

+44
-33
lines changed

src/app/composer/qgscomposition.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,10 @@ void QgsComposition::contentsMouseReleaseEvent(QMouseEvent* e)
533533
ci->writeSettings();
534534
}
535535
break;
536+
537+
default:
538+
// ignore any others...
539+
break;
536540
}
537541
}
538542

src/app/legend/qgslegend.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ void QgsLegend::mouseReleaseEvent(QMouseEvent * e)
306306
if(originType == QgsLegendItem::LEGEND_LAYER_FILE && destType == QgsLegendItem::LEGEND_LAYER_FILE_GROUP)
307307
{
308308
QgsDebugMsg("Legend layer file moved to layer file group");
309-
QgsMapLayer* origLayer = ((QgsLegendLayerFile*)(origin))->layer();
309+
// Not used... delete?
310+
//QgsMapLayer* origLayer = ((QgsLegendLayerFile*)(origin))->layer();
310311
if(dest->childCount() > 1)
311312
{
312313
//find the first layer in the legend layer group != origLayer and copy its settings
@@ -327,8 +328,9 @@ void QgsLegend::mouseReleaseEvent(QMouseEvent * e)
327328
else if(originType == QgsLegendItem::LEGEND_LAYER_FILE && destType == QgsLegendItem::LEGEND_LAYER_FILE)
328329
{
329330
QgsDebugMsg("Legend layer file moved to legend layer file");
330-
QgsMapLayer* origLayer = ((QgsLegendLayerFile*)(origin))->layer();
331-
QgsMapLayer* destLayer = ((QgsLegendLayerFile*)(dest))->layer();
331+
// Not used. Delete?
332+
// QgsMapLayer* origLayer = ((QgsLegendLayerFile*)(origin))->layer();
333+
// QgsMapLayer* destLayer = ((QgsLegendLayerFile*)(dest))->layer();
332334

333335
if(dest == origin)//origin item has been moved in mouseMoveEvent such that it is under the mouse cursor now
334336
{

src/app/legend/qgslegendlayer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ void QgsLegendLayer::changeSymbologySettings(const QgsMapLayer* theMapLayer,
274274
return;
275275
}
276276

277-
QgsLegend* myLegend = legend();
278277
QgsLegendSymbologyItem* theSymbologyItem = 0;
279278

280279
//remove the symbology items under the legend layer

src/app/legend/qgslegendlayerfile.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,8 @@ void QgsLegendLayerFile::addToPopupMenu(QMenu& theMenu)
458458
}
459459
else if (lyr->type() == QgsMapLayer::RASTER)
460460
{
461-
QgsRasterLayer* rlayer = dynamic_cast<QgsRasterLayer*>(lyr);
462-
463461
// TODO: what was this for?
462+
//QgsRasterLayer* rlayer = dynamic_cast<QgsRasterLayer*>(lyr);
464463
//theMenu.addAction(tr("&Convert to..."), rlayer, SLOT(convertTo()));
465464
}
466465

src/app/qgsgeomtypedialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void QgsGeomTypeDialog::on_mAddAttributeButton_clicked()
7070
QgsAddAttrDialog d(types, this);
7171
if(d.exec()==QDialog::Accepted)
7272
{
73-
Q3ListViewItem* attritem=new Q3ListViewItem(mAttributeView, d.name(), d.type());
73+
new Q3ListViewItem(mAttributeView, d.name(), d.type());
7474
}
7575
if(mAttributeView->childCount()>0)
7676
{

src/app/qgsmarkerdialog.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,22 @@ void QgsMarkerDialog::changeDirectory()
7979

8080
void QgsMarkerDialog::visualizeMarkers(QString directory)
8181
{
82-
mIconView->clear();
82+
mIconView->clear();
8383

84-
QDir dir(directory);
85-
QStringList files=dir.entryList("*.svg;*.SVG");
84+
QDir dir(directory);
85+
QStringList files=dir.entryList("*.svg;*.SVG");
8686

87-
for(QStringList::Iterator it = files.begin(); it != files.end(); ++it )
88-
{
89-
qWarning((*it).toLocal8Bit().data());
87+
for(QStringList::Iterator it = files.begin(); it != files.end(); ++it )
88+
{
89+
qWarning((*it).toLocal8Bit().data());
9090

91-
//render the SVG file to a pixmap and put it into mIconView
92-
QPixmap pix (10,10);
93-
QPainter myPainter(&pix);
94-
QgsMarkerCatalogue::svgMarker(&myPainter,mCurrentDir + "/" + (*it), 1);
95-
Q3IconViewItem* ivi=new Q3IconViewItem(mIconView,*it,pix);
91+
//render the SVG file to a pixmap and put it into mIconView
92+
QPixmap pix (10,10);
93+
QPainter myPainter(&pix);
94+
QgsMarkerCatalogue::svgMarker(&myPainter,mCurrentDir + "/" + (*it), 1);
95+
new Q3IconViewItem(mIconView,*it,pix);
9696

97-
}
97+
}
9898
}
9999

100100
QString QgsMarkerDialog::defaultDir()

src/app/qgsoptions.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ QString QgsOptions::getEllipsoidAcronym(QString theEllipsoidName)
380380
// XXX Need to free memory from the error msg if one is set
381381
if(myResult == SQLITE_OK)
382382
{
383-
sqlite3_step(myPreparedStatement) == SQLITE_ROW;
384-
myName = QString((char *)sqlite3_column_text(myPreparedStatement,0));
383+
if (sqlite3_step(myPreparedStatement) == SQLITE_ROW)
384+
myName = QString((char *)sqlite3_column_text(myPreparedStatement,0));
385385
}
386386
// close the sqlite3 statement
387387
sqlite3_finalize(myPreparedStatement);
@@ -412,8 +412,8 @@ QString QgsOptions::getEllipsoidName(QString theEllipsoidAcronym)
412412
// XXX Need to free memory from the error msg if one is set
413413
if(myResult == SQLITE_OK)
414414
{
415-
sqlite3_step(myPreparedStatement) == SQLITE_ROW;
416-
myName = QString((char *)sqlite3_column_text(myPreparedStatement,0));
415+
if (sqlite3_step(myPreparedStatement) == SQLITE_ROW)
416+
myName = QString((char *)sqlite3_column_text(myPreparedStatement,0));
417417
}
418418
// close the sqlite3 statement
419419
sqlite3_finalize(myPreparedStatement);

src/app/qgsrasterlayerproperties.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,9 @@ void QgsRasterLayerProperties::on_pbnHistRefresh_clicked()
753753
bool myIgnoreOutOfRangeFlag = chkHistIgnoreOutOfRange->isChecked();
754754
bool myThoroughBandScanFlag = chkHistAllowApproximation->isChecked();
755755

756+
#ifdef QGISDEBUG
756757
long myCellCount = rasterLayer->getRasterXDim() * rasterLayer->getRasterYDim();
758+
#endif
757759

758760

759761
#ifdef QGISDEBUG

src/ui/qgscustomprojectiondialogbase.ui

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
<ui version="4.0" >
2-
<author></author>
3-
<comment></comment>
4-
<exportmacro></exportmacro>
52
<class>QgsCustomProjectionDialogBase</class>
63
<widget class="QDialog" name="QgsCustomProjectionDialogBase" >
74
<property name="geometry" >
85
<rect>
96
<x>0</x>
107
<y>0</y>
11-
<width>532</width>
12-
<height>297</height>
8+
<width>718</width>
9+
<height>323</height>
1310
</rect>
1411
</property>
1512
<property name="windowTitle" >
@@ -27,7 +24,10 @@
2724
</property>
2825
<item row="0" column="0" >
2926
<widget class="QTabWidget" name="tabWidget2" >
30-
<widget class="QWidget" name="tab" >
27+
<property name="currentIndex" >
28+
<number>0</number>
29+
</property>
30+
<widget class="QWidget" name="tab1" >
3131
<attribute name="title" >
3232
<string>Define</string>
3333
</attribute>
@@ -41,7 +41,10 @@
4141
<item row="1" column="0" colspan="2" >
4242
<widget class="QTextBrowser" name="textBrowser" >
4343
<property name="html" >
44-
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Arial; font-size:10pt;">You can define your own custom projection here. The definition must conform to the proj4 format for specifying a Spatial Reference System.&lt;/p>&lt;/body>&lt;/html></string>
44+
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
45+
p, li { white-space: pre-wrap; }
46+
&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
47+
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Arial'; font-size:10pt;">You can define your own custom projection here. The definition must conform to the proj4 format for specifying a Spatial Reference System.&lt;/p>&lt;/body>&lt;/html></string>
4548
</property>
4649
</widget>
4750
</item>
@@ -161,7 +164,7 @@
161164
</item>
162165
</layout>
163166
</widget>
164-
<widget class="QWidget" name="tab" >
167+
<widget class="QWidget" name="tab2" >
165168
<attribute name="title" >
166169
<string>Test</string>
167170
</attribute>
@@ -182,7 +185,10 @@
182185
<item row="1" column="0" colspan="3" >
183186
<widget class="QTextBrowser" name="textBrowser_2" >
184187
<property name="html" >
185-
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:Arial; font-size:10pt;">Use the text boxes below to test the projection definition you are creating. Enter a coordinate where both the lat/long and the projected result are known (for example by reading off a map). Then press the calculate button to see if the projection definition you are creating is accurate.&lt;/p>&lt;/body>&lt;/html></string>
188+
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
189+
p, li { white-space: pre-wrap; }
190+
&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
191+
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Arial'; font-size:10pt;">Use the text boxes below to test the projection definition you are creating. Enter a coordinate where both the lat/long and the projected result are known (for example by reading off a map). Then press the calculate button to see if the projection definition you are creating is accurate.&lt;/p>&lt;/body>&lt;/html></string>
186192
</property>
187193
</widget>
188194
</item>
@@ -302,7 +308,6 @@
302308
</layout>
303309
</widget>
304310
<layoutdefault spacing="6" margin="11" />
305-
<pixmapfunction></pixmapfunction>
306311
<tabstops>
307312
<tabstop>tabWidget2</tabstop>
308313
<tabstop>textBrowser</tabstop>

0 commit comments

Comments
 (0)