Skip to content

Commit 4be22d5

Browse files
author
jef
committedDec 1, 2007
qgslegendlayerfile.cpp: fix a unused warning
qgisapp.cpp: fix indentation and use QgsDebugMsg qgsgrassmodule.h: fix 2 comment typos git-svn-id: http://svn.osgeo.org/qgis/trunk@7704 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 7039d32 commit 4be22d5

File tree

3 files changed

+324
-463
lines changed

3 files changed

+324
-463
lines changed
 

‎src/app/legend/qgslegendlayerfile.cpp

Lines changed: 64 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,15 @@ void QgsLegendLayerFile::table()
225225
if (!vlayer)
226226
{
227227
QMessageBox::information(0, tr("Not a vector layer"),
228-
tr("To open an attribute table, you must select a vector layer in the legend"));
228+
tr("To open an attribute table, you must select a vector layer in the legend"));
229229
return;
230230
}
231-
231+
232232
QgsAttributeAction& actions = *vlayer->actions();
233-
233+
234234
if (mTableDisplay)
235235
{
236-
236+
237237
mTableDisplay->raise();
238238

239239
// Give the table the most recent copy of the actions for this layer.
@@ -256,37 +256,38 @@ void QgsLegendLayerFile::table()
256256
if( list[i]->windowTitle().startsWith("Quantum GIS") )
257257
{
258258
app=reinterpret_cast<QgisApp*>(list[i]);
259-
break;
259+
break;
260260
}
261261

262-
mTableDisplay = new QgsAttributeTableDisplay(vlayer, app);
263-
try
262+
mTableDisplay = new QgsAttributeTableDisplay(vlayer, app);
263+
try
264264
{
265-
mTableDisplay->table()->fillTable(vlayer);
265+
mTableDisplay->table()->fillTable(vlayer);
266266
}
267-
catch(std::bad_alloc& ba)
267+
catch(std::bad_alloc& ba)
268268
{
269-
QMessageBox::critical(0, tr("bad_alloc exception"), tr("Filling the attribute table has been stopped because there was no more virtual memory left"));
269+
UNUSED(ba);
270+
QMessageBox::critical(0, tr("bad_alloc exception"), tr("Filling the attribute table has been stopped because there was no more virtual memory left"));
270271
}
271-
mTableDisplay->table()->setSorting(true);
272+
mTableDisplay->table()->setSorting(true);
272273

273-
connect(mTableDisplay, SIGNAL(deleted()), this, SLOT(invalidateTableDisplay()));
274+
connect(mTableDisplay, SIGNAL(deleted()), this, SLOT(invalidateTableDisplay()));
274275

275-
mTableDisplay->setTitle(tr("Attribute table - ") + name());
276-
mTableDisplay->show();
276+
mTableDisplay->setTitle(tr("Attribute table - ") + name());
277+
mTableDisplay->show();
277278

278-
// Give the table the most recent copy of the actions for this layer.
279-
mTableDisplay->table()->setAttributeActions(actions);
280-
281-
// select rows which should be selected
282-
selectionChanged();
283-
284-
// etablish the necessary connections between the table and the vector layer
285-
connect(mTableDisplay->table(), SIGNAL(selected(int, bool)), mLyr.layer(), SLOT(select(int, bool)));
286-
connect(mTableDisplay->table(), SIGNAL(selectionRemoved(bool)), mLyr.layer(), SLOT(removeSelection(bool)));
287-
connect(mTableDisplay->table(), SIGNAL(repaintRequested()), mLyr.layer(), SLOT(triggerRepaint()));
288-
289-
QApplication::restoreOverrideCursor();
279+
// Give the table the most recent copy of the actions for this layer.
280+
mTableDisplay->table()->setAttributeActions(actions);
281+
282+
// select rows which should be selected
283+
selectionChanged();
284+
285+
// etablish the necessary connections between the table and the vector layer
286+
connect(mTableDisplay->table(), SIGNAL(selected(int, bool)), mLyr.layer(), SLOT(select(int, bool)));
287+
connect(mTableDisplay->table(), SIGNAL(selectionRemoved(bool)), mLyr.layer(), SLOT(removeSelection(bool)));
288+
connect(mTableDisplay->table(), SIGNAL(repaintRequested()), mLyr.layer(), SLOT(triggerRepaint()));
289+
290+
QApplication::restoreOverrideCursor();
290291
}
291292

292293
}
@@ -412,58 +413,58 @@ void QgsLegendLayerFile::toggleEditing()
412413
QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>(mLyr.layer());
413414
if (!vlayer)
414415
return;
415-
416+
416417
if (!vlayer->isEditable())
417418
{
418419
vlayer->startEditing();
419420
if(!(vlayer->getDataProvider()->capabilities() & QgsVectorDataProvider::AddFeatures))
420-
{
421-
QMessageBox::information(0,tr("Start editing failed"),
422-
tr("Provider cannot be opened for editing"));
423-
}
421+
{
422+
QMessageBox::information(0,tr("Start editing failed"),
423+
tr("Provider cannot be opened for editing"));
424+
}
424425
else
425-
{
426-
vlayer->triggerRepaint();
427-
}
426+
{
427+
vlayer->triggerRepaint();
428+
}
428429
}
429430
else
430431
{
431432
if(vlayer->isModified())
432-
{
433+
{
433434

434-
// commit or roll back?
435-
QMessageBox::StandardButton commit = QMessageBox::information(0,tr("Stop editing"),
436-
tr("Do you want to save the changes?"),
437-
QMessageBox::Save | QMessageBox::Discard);
438-
439-
if(commit==QMessageBox::Save)
440-
{
441-
if(!vlayer->commitChanges())
442-
{
443-
QMessageBox::information(0,tr("Error"),tr("Could not commit changes"));
444-
445-
// Leave the in-memory editing state alone,
446-
// to give the user a chance to enter different values
447-
// and try the commit again later
448-
}
449-
}
450-
else if(commit==QMessageBox::Discard)
451-
{
452-
if(!vlayer->rollBack())
453-
{
454-
QMessageBox::information(0,tr("Error"),
455-
tr("Problems during roll back"));
456-
}
457-
}
435+
// commit or roll back?
436+
QMessageBox::StandardButton commit = QMessageBox::information(0,tr("Stop editing"),
437+
tr("Do you want to save the changes?"),
438+
QMessageBox::Save | QMessageBox::Discard);
439+
440+
if(commit==QMessageBox::Save)
441+
{
442+
if(!vlayer->commitChanges())
443+
{
444+
QMessageBox::information(0,tr("Error"),tr("Could not commit changes"));
445+
446+
// Leave the in-memory editing state alone,
447+
// to give the user a chance to enter different values
448+
// and try the commit again later
449+
}
458450
}
459-
else //layer not modified
451+
else if(commit==QMessageBox::Discard)
460452
{
461-
vlayer->rollBack();
453+
if(!vlayer->rollBack())
454+
{
455+
QMessageBox::information(0,tr("Error"),
456+
tr("Problems during roll back"));
457+
}
462458
}
459+
}
460+
else //layer not modified
461+
{
462+
vlayer->rollBack();
463+
}
463464
vlayer->triggerRepaint();
464-
465+
465466
}
466-
467+
467468
updateLegendItem();
468469

469470
}

‎src/app/qgisapp.cpp

Lines changed: 257 additions & 397 deletions
Large diffs are not rendered by default.

‎src/plugins/grass/qgsgrassmodule.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class QgsGrassModuleOptions
196196
//! Thaw output vector maps used in QGIS on Windows
197197
virtual void thawOutput() { return; }
198198

199-
//! Check if otpion is ready
199+
//! Check if option is ready
200200
// Returns empty string or error message
201201
virtual QStringList ready() { return QStringList() ; }
202202

@@ -206,7 +206,7 @@ class QgsGrassModuleOptions
206206
//! Has raster input or output
207207
virtual bool usesRegion() { return false; }
208208

209-
//! One or more input maps were swithched on to be used as region
209+
//! One or more input maps were switched on to be used as region
210210
virtual bool requestsRegion() { return false; }
211211

212212
//! Check region
@@ -291,7 +291,7 @@ class QgsGrassModuleStandardOptions: public QgsGrassModuleOptions, QWidget
291291
QStringList mFlagNames;
292292

293293
//! Use of region defined in qgm
294-
bool mUsesRegion;
294+
bool mUsesRegion;
295295
};
296296

297297
/*! \class QgsGrassModuleItem

0 commit comments

Comments
 (0)
Please sign in to comment.