Skip to content
Permalink
Browse files

fix warnings and more cosmetics

  • Loading branch information
jef-n committed Oct 22, 2011
1 parent d7b106f commit 59be561a4d9100fb2084006c2acc7df5798c52fc
@@ -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() << " ";
@@ -87,6 +87,8 @@ void QgsLabel::renderLabel( QgsRenderContext &renderContext,
QgsFeature &feature, bool selected,
QgsLabelAttributes *classAttributes )
{
Q_UNUSED( classAttributes );

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

@@ -129,7 +129,6 @@ qgsprojectbadlayerguihandler.h
qgslonglongvalidator.h
qgssearchquerybuilder.h
qgsexpressionbuilderwidget.h
qgsexpressionbuilderdialog.h
qgsquerybuilder.h
)

@@ -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
@@ -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 );
};
}

@@ -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 );
}
}

@@ -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;
@@ -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 );
}
}
@@ -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();
}

@@ -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 );
@@ -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() );
@@ -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& ) ) );
@@ -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 );
@@ -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 )
@@ -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 );

@@ -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
@@ -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">
@@ -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">

0 comments on commit 59be561

Please sign in to comment.
You can’t perform that action at this time.