Skip to content

Commit 129bd98

Browse files
committed
indentation update
1 parent 1b02969 commit 129bd98

12 files changed

+96
-91
lines changed

python/plugins/processing/gui/ParametersPanel.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def getExtendedLayerName(self, layer):
185185
return layer.name()
186186

187187
def getWidgetFromParameter(self, param):
188-
# TODO Create Parameter widget class that holds the logic
188+
# TODO Create Parameter widget class that holds the logic
189189
# for creating a widget that belongs to the parameter.
190190
if isinstance(param, ParameterRaster):
191191
layers = dataobjects.getRasterLayers()

src/app/nodetool/qgsmaptoolnodetool.cpp

+8-7
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,8 @@ void QgsMapToolNodeTool::keyPressEvent( QKeyEvent* e )
723723
if ( mSelectedFeature && ( e->key() == Qt::Key_Backspace || e->key() == Qt::Key_Delete ) )
724724
{
725725
int firstSelectedIndex = firstSelectedVertex();
726-
if ( firstSelectedIndex == -1 ) return;
726+
if ( firstSelectedIndex == -1 )
727+
return;
727728

728729
mSelectedFeature->deleteSelectedVertexes();
729730
safeSelectVertex( firstSelectedIndex );
@@ -732,21 +733,21 @@ void QgsMapToolNodeTool::keyPressEvent( QKeyEvent* e )
732733
// Override default shortcut management in MapCanvas
733734
e->ignore();
734735
}
735-
else
736-
if ( mSelectedFeature && ( e->key() == Qt::Key_Less || e->key() == Qt::Key_Comma ) )
736+
else if ( mSelectedFeature && ( e->key() == Qt::Key_Less || e->key() == Qt::Key_Comma ) )
737737
{
738738
int firstSelectedIndex = firstSelectedVertex();
739-
if ( firstSelectedIndex == -1) return;
739+
if ( firstSelectedIndex == -1 )
740+
return;
740741

741742
mSelectedFeature->deselectAllVertexes();
742743
safeSelectVertex( firstSelectedIndex - 1 );
743744
mCanvas->refresh();
744745
}
745-
else
746-
if ( mSelectedFeature && ( e->key() == Qt::Key_Greater || e->key() == Qt::Key_Period ) )
746+
else if ( mSelectedFeature && ( e->key() == Qt::Key_Greater || e->key() == Qt::Key_Period ) )
747747
{
748748
int firstSelectedIndex = firstSelectedVertex();
749-
if ( firstSelectedIndex == -1) return;
749+
if ( firstSelectedIndex == -1 )
750+
return;
750751

751752
mSelectedFeature->deselectAllVertexes();
752753
safeSelectVertex( firstSelectedIndex + 1 );

src/app/qgisappstylesheet.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -161,19 +161,19 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant>& opts )
161161

162162
if ( sidebar )
163163
{
164-
QString style = "QListWidget#mOptionsListWidget {"
165-
"background-color: rgb(69, 69, 69, 220);"
166-
"}"
167-
"QListWidget#mOptionsListWidget::item {"
168-
" color: white;"
169-
" padding: 3px;"
170-
"}"
171-
"QListWidget#mOptionsListWidget::item::selected {"
172-
" color: black;"
173-
" background-color:palette(Window);"
174-
" padding-right: 0px; "
175-
"}";
176-
ss += style;
164+
QString style = "QListWidget#mOptionsListWidget {"
165+
"background-color: rgb(69, 69, 69, 220);"
166+
"}"
167+
"QListWidget#mOptionsListWidget::item {"
168+
" color: white;"
169+
" padding: 3px;"
170+
"}"
171+
"QListWidget#mOptionsListWidget::item::selected {"
172+
" color: black;"
173+
" background-color:palette(Window);"
174+
" padding-right: 0px; "
175+
"}";
176+
ss += style;
177177
}
178178

179179
//fix background issue for gnome desktop

src/app/qgsprojectproperties.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -1058,10 +1058,11 @@ void QgsProjectProperties::on_pbnWMSAddSRS_clicked()
10581058
{
10591059
QgsGenericProjectionSelector *mySelector = new QgsGenericProjectionSelector( this );
10601060
mySelector->setMessage();
1061-
if ( mWMSList->count() > 0 ) {
1062-
mySelector->setSelectedAuthId( mWMSList->item( mWMSList->count()-1 )->text() );
1061+
if ( mWMSList->count() > 0 )
1062+
{
1063+
mySelector->setSelectedAuthId( mWMSList->item( mWMSList->count() - 1 )->text() );
10631064
}
1064-
if ( mySelector->exec() && mySelector->selectedCrsId()!=0 )
1065+
if ( mySelector->exec() && mySelector->selectedCrsId() != 0 )
10651066
{
10661067
QString authid = mySelector->selectedAuthId();
10671068

src/core/qgsvectorlayer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2517,7 +2517,7 @@ bool QgsVectorLayer::changeGeometry( QgsFeatureId fid, QgsGeometry* geom )
25172517
bool QgsVectorLayer::changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal )
25182518
{
25192519
Q_UNUSED( emitSignal );
2520-
return changeAttributeValue ( fid, field, value );
2520+
return changeAttributeValue( fid, field, value );
25212521
}
25222522

25232523
bool QgsVectorLayer::changeAttributeValue( QgsFeatureId fid, int field, QVariant value )

src/gui/qgsoptionsdialogbase.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ void QgsOptionsDialogBase::initOptionsBase( bool restoreUi )
5555

5656
// start with copy of qgsoptionsdialog_template.ui to ensure existence of these objects
5757
mOptListWidget = findChild<QListWidget*>( "mOptionsListWidget" );
58-
QFrame* optionsFrame = findChild<QFrame*>("mOptionsFrame");
58+
QFrame* optionsFrame = findChild<QFrame*>( "mOptionsFrame" );
5959
mOptStackedWidget = findChild<QStackedWidget*>( "mOptionsStackedWidget" );
6060
mOptSplitter = findChild<QSplitter*>( "mOptionsSplitter" );
6161
mOptButtonBox = findChild<QDialogButtonBox*>( "buttonBox" );
62-
QFrame* buttonBoxFrame = findChild<QFrame*>("mButtonBoxFrame");
62+
QFrame* buttonBoxFrame = findChild<QFrame*>( "mButtonBoxFrame" );
6363

6464
if ( !mOptListWidget || !mOptStackedWidget || !mOptSplitter || !optionsFrame )
6565
{
@@ -68,20 +68,20 @@ void QgsOptionsDialogBase::initOptionsBase( bool restoreUi )
6868

6969
QSettings settings;
7070
int size = settings.value( "/IconSize", 24 ).toInt();
71-
mOptListWidget->setIconSize( QSize(size, size) );
71+
mOptListWidget->setIconSize( QSize( size, size ) );
7272
mOptListWidget->setFrameStyle( QFrame::NoFrame );
7373

74-
optionsFrame->layout()->setContentsMargins(0,3,3,3);
75-
QVBoxLayout* layout = static_cast<QVBoxLayout*>(optionsFrame->layout());
74+
optionsFrame->layout()->setContentsMargins( 0, 3, 3, 3 );
75+
QVBoxLayout* layout = static_cast<QVBoxLayout*>( optionsFrame->layout() );
7676

7777
if ( buttonBoxFrame )
7878
{
79-
buttonBoxFrame->layout()->setContentsMargins(0,0,0,0);
80-
layout->insertWidget(layout->count() + 1, buttonBoxFrame );
79+
buttonBoxFrame->layout()->setContentsMargins( 0, 0, 0, 0 );
80+
layout->insertWidget( layout->count() + 1, buttonBoxFrame );
8181
}
8282
else
8383
{
84-
layout->insertWidget( layout->count() + 1, mOptButtonBox );
84+
layout->insertWidget( layout->count() + 1, mOptButtonBox );
8585
}
8686

8787
if ( mOptButtonBox )

src/mapserver/qgis_map_serv.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -708,12 +708,15 @@ int main( int argc, char * argv[] )
708708
delete theServer;
709709
continue;
710710
}
711-
else if ( request.compare( "GetStyles", Qt::CaseInsensitive ) == 0 )
711+
else if ( request.compare( "GetStyles", Qt::CaseInsensitive ) == 0 )
712712
{
713713
// GetStyles is only defined for WMS1.1.1/SLD1.0
714-
if ( version != "1.1.1") {
714+
if ( version != "1.1.1" )
715+
{
715716
theRequestHandler->sendServiceException( QgsMapServiceException( "OperationNotSupported", "GetStyles method is only available in WMS version 1.1.1" ) );
716-
} else {
717+
}
718+
else
719+
{
717720
try
718721
{
719722
QDomDocument doc = theServer->getStyles();

src/mapserver/qgsprojectparser.cpp

+40-40
Original file line numberDiff line numberDiff line change
@@ -1939,52 +1939,52 @@ QDomDocument QgsProjectParser::getStyle( const QString& styleName, const QString
19391939

19401940
QDomDocument QgsProjectParser::getStyles( QStringList& layerList ) const
19411941
{
1942-
QDomDocument myDocument = QDomDocument();
1943-
1944-
QDomNode header = myDocument.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" );
1945-
myDocument.appendChild( header );
1946-
1947-
// Create the root element
1948-
QDomElement root = myDocument.createElementNS( "http://www.opengis.net/sld", "StyledLayerDescriptor" );
1949-
root.setAttribute( "version", "1.1.0" );
1950-
root.setAttribute( "xsi:schemaLocation", "http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" );
1951-
root.setAttribute( "xmlns:ogc", "http://www.opengis.net/ogc" );
1952-
root.setAttribute( "xmlns:se", "http://www.opengis.net/se" );
1953-
root.setAttribute( "xmlns:xlink", "http://www.w3.org/1999/xlink" );
1954-
root.setAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
1955-
myDocument.appendChild( root );
1956-
1957-
for ( int i = 0; i < layerList.size(); i++)
1942+
QDomDocument myDocument = QDomDocument();
1943+
1944+
QDomNode header = myDocument.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" );
1945+
myDocument.appendChild( header );
1946+
1947+
// Create the root element
1948+
QDomElement root = myDocument.createElementNS( "http://www.opengis.net/sld", "StyledLayerDescriptor" );
1949+
root.setAttribute( "version", "1.1.0" );
1950+
root.setAttribute( "xsi:schemaLocation", "http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" );
1951+
root.setAttribute( "xmlns:ogc", "http://www.opengis.net/ogc" );
1952+
root.setAttribute( "xmlns:se", "http://www.opengis.net/se" );
1953+
root.setAttribute( "xmlns:xlink", "http://www.w3.org/1999/xlink" );
1954+
root.setAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
1955+
myDocument.appendChild( root );
1956+
1957+
for ( int i = 0; i < layerList.size(); i++ )
1958+
{
1959+
QString layerName;
1960+
QString typeName;
1961+
layerName = layerList.at( i );
1962+
typeName = layerName.replace( " ", "_" );
1963+
QList<QgsMapLayer*> currentLayerList = mapLayerFromTypeName( typeName );
1964+
if ( currentLayerList.size() < 1 )
1965+
{
1966+
throw QgsMapServiceException( "Error", QString( "The layer for the TypeName '%1' is not found" ).arg( layerName ) );
1967+
}
1968+
for ( int j = 0; j < currentLayerList.size(); j++ )
19581969
{
1959-
QString layerName;
1960-
QString typeName;
1961-
layerName = layerList.at( i );
1962-
typeName = layerName.replace(" ", "_");
1963-
QList<QgsMapLayer*> currentLayerList = mapLayerFromTypeName( typeName );
1964-
if ( currentLayerList.size() < 1 )
1970+
QgsMapLayer* currentLayer = currentLayerList.at( j );
1971+
QgsVectorLayer* layer = dynamic_cast<QgsVectorLayer*>( currentLayer );
1972+
if ( !layer )
19651973
{
1966-
throw QgsMapServiceException( "Error", QString( "The layer for the TypeName '%1' is not found" ).arg( layerName ) );
1974+
throw QgsMapServiceException( "Error", QString( "Could not get style because:\n%1" ).arg( "Non-vector layers not supported yet" ) );
19671975
}
1968-
for ( int j = 0; j < currentLayerList.size(); j++)
1969-
{
1970-
QgsMapLayer* currentLayer = currentLayerList.at( j );
1971-
QgsVectorLayer* layer = dynamic_cast<QgsVectorLayer*>( currentLayer );
1972-
if ( !layer )
1973-
{
1974-
throw QgsMapServiceException( "Error", QString( "Could not get style because:\n%1" ).arg( "Non-vector layers not supported yet" ) );
1975-
}
1976-
// Create the NamedLayer element
1977-
QDomElement namedLayerNode = myDocument.createElement( "NamedLayer" );
1978-
root.appendChild( namedLayerNode );
1976+
// Create the NamedLayer element
1977+
QDomElement namedLayerNode = myDocument.createElement( "NamedLayer" );
1978+
root.appendChild( namedLayerNode );
19791979

1980-
QString errorMsg;
1981-
if ( !layer->writeSld( namedLayerNode, myDocument, errorMsg ) )
1982-
{
1983-
throw QgsMapServiceException( "Error", QString( "Could not get style because:\n%1" ).arg( errorMsg ) );
1984-
}
1980+
QString errorMsg;
1981+
if ( !layer->writeSld( namedLayerNode, myDocument, errorMsg ) )
1982+
{
1983+
throw QgsMapServiceException( "Error", QString( "Could not get style because:\n%1" ).arg( errorMsg ) );
19851984
}
19861985
}
1987-
return myDocument;
1986+
}
1987+
return myDocument;
19881988
}
19891989

19901990

src/mapserver/qgssldparser.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ QDomDocument QgsSLDParser::getStyle( const QString& styleName, const QString& la
14151415
QDomDocument QgsSLDParser::getStyles( QStringList& layerList ) const
14161416
{
14171417
QDomDocument styleDoc;
1418-
for ( int i = 0; i < layerList.size(); i++)
1418+
for ( int i = 0; i < layerList.size(); i++ )
14191419
{
14201420
QString layerName;
14211421
QString typeName;
@@ -1426,7 +1426,7 @@ QDomDocument QgsSLDParser::getStyles( QStringList& layerList ) const
14261426
throw QgsMapServiceException( "LayerNotDefined", "Operation request is for a Layer not offered by the server." );
14271427
}
14281428
QDomNodeList userStyleList = userLayerElement.elementsByTagName( "UserStyle" );
1429-
for ( int j = 0; j < userStyleList.size(); j++)
1429+
for ( int j = 0; j < userStyleList.size(); j++ )
14301430
{
14311431
QDomElement userStyleElement = userStyleList.item( i ).toElement();
14321432
styleDoc.appendChild( styleDoc.importNode( userStyleElement, true ) );

src/mapserver/qgswmsserver.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ QDomDocument QgsWMSServer::getStyle()
603603

604604
// GetStyles is only defined for WMS1.1.1/SLD1.0
605605
QDomDocument QgsWMSServer::getStyles()
606-
{
606+
{
607607
QDomDocument doc;
608608
if ( !mParameterMap.contains( "LAYERS" ) )
609609
{
@@ -613,7 +613,7 @@ QDomDocument QgsWMSServer::getStyles()
613613
QStringList layersList = mParameterMap[ "LAYERS" ].split( ",", QString::SkipEmptyParts );
614614
if ( layersList.size() < 1 )
615615
{
616-
throw QgsMapServiceException( "LayerNotSpecified", "Layers is mandatory for GetStyles operation" );
616+
throw QgsMapServiceException( "LayerNotSpecified", "Layers is mandatory for GetStyles operation" );
617617
}
618618

619619
return mConfigParser->getStyles( layersList );

src/providers/wcs/qgswcscapabilities.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ QgsWcsCapabilities::QgsWcsCapabilities( QgsDataSourceURI const &theUri ):
7474
retrieveServerCapabilities();
7575
}
7676

77-
QgsWcsCapabilities::QgsWcsCapabilities()
77+
QgsWcsCapabilities::QgsWcsCapabilities()
7878
: mCoverageCount( 0 )
7979
{
8080
}

tests/src/core/testqgscomposerpaper.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class TestQgsComposerPaper: public QObject
4949
QgsMarkerLineSymbolLayerV2* mMarkerLine;
5050
QgsFillSymbolV2* mFillSymbol;
5151
QgsFillSymbolV2* mMarkerLineSymbol;
52-
QgsSingleSymbolRendererV2* mSymbolRenderer;
53-
52+
QgsSingleSymbolRendererV2* mSymbolRenderer;
53+
5454
};
5555

5656
void TestQgsComposerPaper::initTestCase()
@@ -61,17 +61,17 @@ void TestQgsComposerPaper::initTestCase()
6161
//create empty composition
6262
mComposition = new QgsComposition( 0 );
6363
mComposition->setPaperSize( 297, 210 ); //A4 landscape
64-
64+
6565
//setup simple fill
6666
mSimpleFill = new QgsSimpleFillSymbolLayerV2();
6767
mFillSymbol = new QgsFillSymbolV2();
6868
mFillSymbol->changeSymbolLayer( 0, mSimpleFill );
69-
69+
7070
//setup marker line fill
7171
mMarkerLine = new QgsMarkerLineSymbolLayerV2();
7272
mMarkerLineSymbol = new QgsFillSymbolV2();
73-
mMarkerLineSymbol->changeSymbolLayer( 0, mMarkerLine );
74-
73+
mMarkerLineSymbol->changeSymbolLayer( 0, mMarkerLine );
74+
7575
mReport = "<h1>Composer Paper Tests</h1>\n";
7676
}
7777

@@ -109,7 +109,7 @@ void TestQgsComposerPaper::transparentPaper()
109109
{
110110
mSimpleFill->setColor( Qt::transparent );
111111
mSimpleFill->setBorderColor( Qt::transparent );
112-
mComposition->setPageStyleSymbol( mFillSymbol );
112+
mComposition->setPageStyleSymbol( mFillSymbol );
113113
QgsCompositionChecker checker( "composerpaper_transparent", mComposition );
114114
QVERIFY( checker.testComposition( mReport ) );
115115
}
@@ -118,14 +118,14 @@ void TestQgsComposerPaper::borderedPaper()
118118
{
119119
mSimpleFill->setColor( Qt::white );
120120
mSimpleFill->setBorderColor( Qt::black );
121-
mSimpleFill->setBorderWidth( 6 );
121+
mSimpleFill->setBorderWidth( 6 );
122122
QgsCompositionChecker checker( "composerpaper_bordered", mComposition );
123123
QVERIFY( checker.testComposition( mReport ) );
124124
}
125125

126126
void TestQgsComposerPaper::markerLinePaper()
127-
{
128-
mComposition->setPageStyleSymbol( mMarkerLineSymbol );
127+
{
128+
mComposition->setPageStyleSymbol( mMarkerLineSymbol );
129129
QgsCompositionChecker checker( "composerpaper_markerborder", mComposition );
130130
QVERIFY( checker.testComposition( mReport ) );
131131
}

0 commit comments

Comments
 (0)