Skip to content

Commit

Permalink
fix warnings and more cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 22, 2011
1 parent d7b106f commit 59be561
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 55 deletions.
4 changes: 2 additions & 2 deletions src/analysis/interpolation/DualEdgeTriangulation.cc
Expand Up @@ -2939,11 +2939,11 @@ bool DualEdgeTriangulation::saveToTAFF( QString filename ) const

//export the points to the file
outstream << "POIN" << std::endl << std::flush;
outstream << "NPTS " << this->getNumberOfPoints() << std::endl << std::flush;
outstream << "NPTS " << getNumberOfPoints() << std::endl << std::flush;
outstream << "PATT 3" << std::endl << std::flush;
outstream << "DATA ";

for ( int i = 0; i < this->getNumberOfPoints(); i++ )
for ( int i = 0; i < getNumberOfPoints(); i++ )
{
Point3D* p = mPointVector[i];
outstream << p->getX() << " " << p->getY() << " " << p->getZ() << " ";
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgslabel.cpp
Expand Up @@ -87,6 +87,8 @@ void QgsLabel::renderLabel( QgsRenderContext &renderContext,
QgsFeature &feature, bool selected,
QgsLabelAttributes *classAttributes )
{
Q_UNUSED( classAttributes );

if ( mLabelAttributes->selectedOnly() && !selected )
return;

Expand Down
1 change: 0 additions & 1 deletion src/gui/CMakeLists.txt
Expand Up @@ -129,7 +129,6 @@ qgsprojectbadlayerguihandler.h
qgslonglongvalidator.h
qgssearchquerybuilder.h
qgsexpressionbuilderwidget.h
qgsexpressionbuilderdialog.h
qgsquerybuilder.h
)

Expand Down
77 changes: 39 additions & 38 deletions src/gui/qgsexpressionbuilderwidget.cpp
Expand Up @@ -46,27 +46,27 @@ QgsExpressionBuilderWidget::QgsExpressionBuilderWidget( QWidget *parent )


// TODO Can we move this stuff to QgsExpression, like the functions?
this->registerItem( "Operators", "+", " + " );
this->registerItem( "Operators", "-", " -" );
this->registerItem( "Operators", "*", " * " );
this->registerItem( "Operators", "/", " / " );
this->registerItem( "Operators", "%", " % " );
this->registerItem( "Operators", "^", " ^ " );
this->registerItem( "Operators", "=", " = " );
this->registerItem( "Operators", ">", " > " );
this->registerItem( "Operators", "<", " < " );
this->registerItem( "Operators", "<>", " <> " );
this->registerItem( "Operators", "<=", " <= " );
this->registerItem( "Operators", ">=", " >= " );
this->registerItem( "Operators", "||", " || ", "<b>|| (String Concatenation)</b> "\
"<br> Joins two values together into a string " \
"<br> <i>Usage:</i><br>'Dia' || Diameter" );
this->registerItem( "Operators", "LIKE", " LIKE " );
this->registerItem( "Operators", "ILIKE", " ILIKE " );
this->registerItem( "Operators", "IS", " IS NOT " );
this->registerItem( "Operators", "OR", " OR " );
this->registerItem( "Operators", "AND", " AND " );
this->registerItem( "Operators", "NOT", " NOT " );
registerItem( "Operators", "+", " + " );
registerItem( "Operators", "-", " -" );
registerItem( "Operators", "*", " * " );
registerItem( "Operators", "/", " / " );
registerItem( "Operators", "%", " % " );
registerItem( "Operators", "^", " ^ " );
registerItem( "Operators", "=", " = " );
registerItem( "Operators", ">", " > " );
registerItem( "Operators", "<", " < " );
registerItem( "Operators", "<>", " <> " );
registerItem( "Operators", "<=", " <= " );
registerItem( "Operators", ">=", " >= " );
registerItem( "Operators", "||", " || ", "<b>|| (String Concatenation)</b> "\
"<br> Joins two values together into a string " \
"<br> <i>Usage:</i><br>'Dia' || Diameter" );
registerItem( "Operators", "LIKE", " LIKE " );
registerItem( "Operators", "ILIKE", " ILIKE " );
registerItem( "Operators", "IS", " IS NOT " );
registerItem( "Operators", "OR", " OR " );
registerItem( "Operators", "AND", " AND " );
registerItem( "Operators", "NOT", " NOT " );


// Load the fuctions from the QgsExpression class
Expand All @@ -77,7 +77,7 @@ QgsExpressionBuilderWidget::QgsExpressionBuilderWidget( QWidget *parent )
QString name = func.mName;
if ( func.mParams >= 1 )
name += "(";
this->registerItem( func.mGroup, func.mName, " " + name + " ", func.mHelpText );
registerItem( func.mGroup, func.mName, " " + name + " ", func.mHelpText );
};
}

Expand Down Expand Up @@ -147,7 +147,7 @@ void QgsExpressionBuilderWidget::loadFieldNames()
for ( ; fieldIt != fieldMap.constEnd(); ++fieldIt )
{
QString fieldName = fieldIt.value().name();
this->registerItem( "Fields", fieldName, " " + fieldName + " ", "", QgsExpressionItem::Field );
registerItem( "Fields", fieldName, " " + fieldName + " ", "", QgsExpressionItem::Field );
}
}

Expand Down Expand Up @@ -199,26 +199,26 @@ void QgsExpressionBuilderWidget::registerItem( QString group,

QString QgsExpressionBuilderWidget::getExpressionString()
{
return this->txtExpressionString->toPlainText();
return txtExpressionString->toPlainText();
}

void QgsExpressionBuilderWidget::setExpressionString( const QString expressionString )
{
this->txtExpressionString->setPlainText( expressionString );
txtExpressionString->setPlainText( expressionString );
}

void QgsExpressionBuilderWidget::on_txtExpressionString_textChanged()
{
QString text = this->txtExpressionString->toPlainText();
QString text = txtExpressionString->toPlainText();

// If the string is empty the expression will still "fail" although
// we don't show the user an error as it will be confusing.
if ( text.isEmpty() )
{
this->lblPreview->setText( "" );
this->lblPreview->setStyleSheet( "" );
this->txtExpressionString->setToolTip( "" );
this->lblPreview->setToolTip( "" );
lblPreview->setText( "" );
lblPreview->setStyleSheet( "" );
txtExpressionString->setToolTip( "" );
lblPreview->setToolTip( "" );
// Return false for isVaild because a null expression is still invaild.
emit expressionParsed( false );
return;
Expand All @@ -245,18 +245,18 @@ void QgsExpressionBuilderWidget::on_txtExpressionString_textChanged()
if ( exp.hasEvalError() )
tooltip += "<br><br> <b>Eval Error:</b> <br>" + exp.evalErrorString();

this->lblPreview->setText( "Expression is invaild <a href=""more"">(more info)</a>" );
this->lblPreview->setStyleSheet( "color: rgba(255, 6, 10, 255);" );
this->txtExpressionString->setToolTip( tooltip );
this->lblPreview->setToolTip( tooltip );
lblPreview->setText( "Expression is invaild <a href=""more"">(more info)</a>" );
lblPreview->setStyleSheet( "color: rgba(255, 6, 10, 255);" );
txtExpressionString->setToolTip( tooltip );
lblPreview->setToolTip( tooltip );
emit expressionParsed( false );
return;
}
else
{
this->lblPreview->setStyleSheet( "" );
this->txtExpressionString->setToolTip( "" );
this->lblPreview->setToolTip( "" );
lblPreview->setStyleSheet( "" );
txtExpressionString->setToolTip( "" );
lblPreview->setToolTip( "" );
emit expressionParsed( true );
}
}
Expand All @@ -272,9 +272,10 @@ void QgsExpressionBuilderWidget::on_txtSearchEdit_textChanged()

void QgsExpressionBuilderWidget::on_lblPreview_linkActivated( QString link )
{
Q_UNUSED( link );
QgsMessageViewer * mv = new QgsMessageViewer( this );
mv->setWindowTitle( "More info on expression error" );
mv->setMessageAsHtml( this->txtExpressionString->toolTip() );
mv->setMessageAsHtml( txtExpressionString->toolTip() );
mv->exec();
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/evis/eventbrowser/evisimagedisplaywidget.cpp
Expand Up @@ -129,7 +129,7 @@ void eVisImageDisplayWidget::resizeEvent( QResizeEvent *event )
void eVisImageDisplayWidget::displayImage( QString path )
{
mImageLoaded = mImage->load( path, 0, Qt::AutoColor );
this->setToolTip( path );
setToolTip( path );

mCurrentZoomStep = 0;
pbtnZoomOut->setEnabled( false );
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/globe/globe_plugin.cpp
Expand Up @@ -83,8 +83,8 @@ GlobePlugin::GlobePlugin( QgisInterface* theQgisInterface )
//needed to be "seen" by other plugins by doing
//iface.mainWindow().findChild( QObject, "globePlugin" )
//needed until https://trac.osgeo.org/qgis/changeset/15224
this->setObjectName( "globePlugin" );
this->setParent( theQgisInterface->mainWindow() );
setObjectName( "globePlugin" );
setParent( theQgisInterface->mainWindow() );

mSettingsDialog = new QgsGlobePluginDialog( &viewer, theQgisInterface->mainWindow(), QgisGui::ModalDialogFlags );
mQDockWidget = new QDockWidgetGlobe( tr( "Globe" ), theQgisInterface->mainWindow() );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassbrowser.cpp
Expand Up @@ -111,7 +111,7 @@ QgsGrassBrowser::QgsGrassBrowser( QgisInterface *iface,
mSplitter->addWidget( mTree );
mSplitter->addWidget( mTextBrowser );

this->setCentralWidget( mSplitter );
setCentralWidget( mSplitter );

connect( mTree, SIGNAL( customContextMenuRequested( const QPoint& ) ),
this, SLOT( showContextMenu( const QPoint& ) ) );
Expand Down
11 changes: 6 additions & 5 deletions src/plugins/grass/qgsgrassshell.cpp
Expand Up @@ -47,16 +47,16 @@ QgsGrassShell::QgsGrassShell( QgsGrassTools *tools, QTabWidget *parent, const ch
connect( pasteShortcut, SIGNAL( activated() ), mTerminal, SLOT( pasteClipboard() ) );
connect( copyShortcut, SIGNAL( activated() ), mTerminal, SLOT( copyClipboard() ) );

#if 0
// TODO: find a better way to manage the lockfile.
// Locking should not be done here, a mapset is either locked by GRASS if QGIS is started from GRASS or it is created by QgsGrass::openMapset
/*
mLockFilename = QgsGrass::lockFilePath();
QFile::remove( mLockFilename + ".qgis" );
if ( !QFile::rename( mLockFilename, mLockFilename + ".qgis" ) )
{
QMessageBox::warning( this, tr( "Warning" ), tr( "Cannot rename the lock file %1" ).arg( mLockFilename ) );
}
*/
#endif

mTerminal->setSize( 80, 25 );
mTerminal->setColorScheme( COLOR_SCHEME_BLACK_ON_LIGHT_YELLOW );
Expand All @@ -73,15 +73,16 @@ void QgsGrassShell::closeShell()
int index = mTabWidget->indexOf( this );
mTabWidget->removeTab( index );

#if 0
// TODO: find a better way to manage the lockfile.
// No locking should be done here, see above
/*

if ( !QFile::rename( mLockFilename + ".qgis", mLockFilename ) )
{
QMessageBox::warning( this, tr( "Warning" ), tr( "Cannot rename the lock file %1" ).arg( mLockFilename ) );
}
*/
this->deleteLater();
#endif
deleteLater();
}

void QgsGrassShell::initTerminal( QTermWidget *terminal )
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/roadgraph/shortestpathwidget.cpp
Expand Up @@ -128,7 +128,7 @@ RgShortestPathWidget::RgShortestPathWidget( QWidget* theParent, RoadGraphPlugin

h = new QHBoxLayout( myWidget );
QPushButton *helpButton = new QPushButton( tr( "Help" ), this );
helpButton->setIcon( this->style()->standardIcon( QStyle::SP_DialogHelpButton ) );
helpButton->setIcon( style()->standardIcon( QStyle::SP_DialogHelpButton ) );
h->addWidget( helpButton );
v->addLayout( h );

Expand Down
1 change: 1 addition & 0 deletions src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -1077,6 +1077,7 @@ bool QgsOgrProvider::deleteAttributes( const QgsAttributeIds &attributes )
loadFields();
return res;
#else
Q_UNUSED( attributes );
QgsDebugMsg( "Deleting fields is supported only from GDAL >= 1.9.0" );
return false;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsoptionsbase.ui
Expand Up @@ -436,7 +436,7 @@
<property name="title">
<string>GDAL Drivers</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<layout class="QGridLayout" name="gridLayout_24">
<item row="1" column="0">
<widget class="QListWidget" name="lstGdalDrivers">
<property name="minimumSize">
Expand Down
3 changes: 0 additions & 3 deletions src/ui/qgsvectorlayerpropertiesbase.ui
Expand Up @@ -914,10 +914,7 @@
</layout>
</item>
</layout>
<zorder></zorder>
<zorder></zorder>
<zorder>mDiagramFontButton</zorder>
<zorder></zorder>
</widget>
</item>
<item row="2" column="0" colspan="6">
Expand Down

0 comments on commit 59be561

Please sign in to comment.