Skip to content

Commit 3a005cd

Browse files
committed
Indentation
1 parent 9fb1d4f commit 3a005cd

File tree

6 files changed

+73
-73
lines changed

6 files changed

+73
-73
lines changed

python/gui/attributetable/qgsorganizetablecolumnsdialog.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class QgsOrganizeTableColumnsDialog : QDialog
2323
* Get the updated configuration
2424
*/
2525
QgsAttributeTableConfig config() const;
26-
26+
2727
public slots:
2828
/**
2929
* showAll checks all the fields to show them all in the attribute table
@@ -33,5 +33,5 @@ class QgsOrganizeTableColumnsDialog : QDialog
3333
/**
3434
* hideAll unchecks all the fields to hide them all in the attribute table
3535
*/
36-
void hideAll();
36+
void hideAll();
3737
};

python/plugins/processing/algs/qgis/ImportIntoPostGIS.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def processAlgorithm(self, progress):
117117

118118
try:
119119
db = postgis.GeoDB(host=host, port=port, dbname=database,
120-
user=username, passwd=password)
120+
user=username, passwd=password)
121121
except postgis.DbError as e:
122122
raise GeoAlgorithmExecutionException(
123123
self.tr("Couldn't connect to database:\n%s") % unicode(e))

python/plugins/processing/algs/qgis/PostGISExecuteSQL.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def processAlgorithm(self, progress):
5959
self.tr('Wrong database connection name: %s' % connection))
6060
try:
6161
self.db = postgis.GeoDB(host=host, port=port,
62-
dbname=database, user=username, passwd=password)
62+
dbname=database, user=username, passwd=password)
6363
except postgis.DbError as e:
6464
raise GeoAlgorithmExecutionException(
6565
self.tr("Couldn't connect to database:\n%s") % unicode(e))

python/plugins/processing/tools/dataobjects.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import os
3030
import re
3131
from qgis.core import QGis, QgsProject, QgsVectorFileWriter, QgsMapLayer, QgsRasterLayer, \
32-
QgsVectorLayer, QgsMapLayerRegistry, QgsCoordinateReferenceSystem
32+
QgsVectorLayer, QgsMapLayerRegistry, QgsCoordinateReferenceSystem
3333
from qgis.gui import QgsSublayersDialog
3434
from qgis.PyQt.QtCore import QSettings
3535
from qgis.utils import iface

python/plugins/processing/tools/vector.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ def __init__(self, destination, encoding, fields, geometryType,
580580
print uri.uri()
581581
try:
582582
db = postgis.GeoDB(host=uri.host(), port=int(uri.port()),
583-
dbname=uri.database(), user=user, passwd=passwd)
583+
dbname=uri.database(), user=user, passwd=passwd)
584584
except postgis.DbError as e:
585585
raise GeoAlgorithmExecutionException(
586586
"Couldn't connect to database:\n%s" % e.message)

src/providers/mssql/qgsmssqlprovider.cpp

+67-67
Original file line numberDiff line numberDiff line change
@@ -1985,22 +1985,22 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
19851985
}
19861986
if ( query.isActive() && query.next() && query.value( 0 ).toInt() == 0 )
19871987
{
1988-
QgsDebugMsg( "Need to create styles table" );
1989-
bool execOk = query.exec( QString( "CREATE TABLE [dbo].[layer_styles]("
1990-
"[id] int IDENTITY(1,1) PRIMARY KEY,"
1991-
"[f_table_catalog] [varchar](1024) NULL,"
1992-
"[f_table_schema] [varchar](1024) NULL,"
1993-
"[f_table_name] [varchar](1024) NULL,"
1994-
"[f_geometry_column] [varchar](1024) NULL,"
1995-
"[styleName] [varchar](1024) NULL,"
1996-
"[styleQML] [text] NULL,"
1997-
"[styleSLD] [text] NULL,"
1998-
"[useAsDefault] [int] NULL,"
1999-
"[description] [text] NULL,"
2000-
"[owner] [varchar](1024) NULL,"
2001-
"[ui] [text] NULL,"
2002-
"[update_time] [datetime] NULL"
2003-
") ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]" ));
1988+
QgsDebugMsg( "Need to create styles table" );
1989+
bool execOk = query.exec( QString( "CREATE TABLE [dbo].[layer_styles]("
1990+
"[id] int IDENTITY(1,1) PRIMARY KEY,"
1991+
"[f_table_catalog] [varchar](1024) NULL,"
1992+
"[f_table_schema] [varchar](1024) NULL,"
1993+
"[f_table_name] [varchar](1024) NULL,"
1994+
"[f_geometry_column] [varchar](1024) NULL,"
1995+
"[styleName] [varchar](1024) NULL,"
1996+
"[styleQML] [text] NULL,"
1997+
"[styleSLD] [text] NULL,"
1998+
"[useAsDefault] [int] NULL,"
1999+
"[description] [text] NULL,"
2000+
"[owner] [varchar](1024) NULL,"
2001+
"[ui] [text] NULL,"
2002+
"[update_time] [datetime] NULL"
2003+
") ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]" ) );
20042004
if ( !execOk )
20052005
{
20062006
errCause = QObject::tr( "Unable to save layer style. It's not possible to create the destination table on the database. Maybe this is due to table permissions. Please contact your database admin" );
@@ -2036,8 +2036,8 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
20362036
.arg( QgsMssqlProvider::quotedValue( qmlStyle ) )
20372037
.arg( QgsMssqlProvider::quotedValue( sldStyle ) )
20382038
.arg( useAsDefault ? "1" : "0" )
2039-
.arg( QgsMssqlProvider::quotedValue( styleDescription.isEmpty() ? QDateTime::currentDateTime().toString() : styleDescription ) )
2040-
.arg( QgsMssqlProvider::quotedValue( dsUri.username() ) )
2039+
.arg( QgsMssqlProvider::quotedValue( styleDescription.isEmpty() ? QDateTime::currentDateTime().toString() : styleDescription ) )
2040+
.arg( QgsMssqlProvider::quotedValue( dsUri.username() ) )
20412041
.arg( uiFileColumn )
20422042
.arg( uiFileValue );
20432043

@@ -2048,31 +2048,31 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
20482048
" AND f_table_name=%3"
20492049
" AND f_geometry_column=%4"
20502050
" AND styleName=%5" )
2051-
.arg( QgsMssqlProvider::quotedValue(dsUri.database() ) )
2052-
.arg( QgsMssqlProvider::quotedValue(dsUri.schema() ) )
2053-
.arg( QgsMssqlProvider::quotedValue(dsUri.table() ) )
2054-
.arg( QgsMssqlProvider::quotedValue(dsUri.geometryColumn() ) )
2055-
.arg( QgsMssqlProvider::quotedValue(styleName.isEmpty() ? dsUri.table() : styleName ) );
2051+
.arg( QgsMssqlProvider::quotedValue( dsUri.database() ) )
2052+
.arg( QgsMssqlProvider::quotedValue( dsUri.schema() ) )
2053+
.arg( QgsMssqlProvider::quotedValue( dsUri.table() ) )
2054+
.arg( QgsMssqlProvider::quotedValue( dsUri.geometryColumn() ) )
2055+
.arg( QgsMssqlProvider::quotedValue( styleName.isEmpty() ? dsUri.table() : styleName ) );
20562056

20572057
if ( !query.exec( checkQuery ) )
20582058
{
20592059
QgsDebugMsg( query.lastError().text() );
2060-
QgsDebugMsg("Check Query failed");
2060+
QgsDebugMsg( "Check Query failed" );
20612061
return false;
20622062
}
20632063
if ( query.isActive() && query.next() && query.value( 0 ).toString() == styleName )
2064-
{
2065-
if ( QMessageBox::question( nullptr, QObject::tr( "Save style in database" ),
2064+
{
2065+
if ( QMessageBox::question( nullptr, QObject::tr( "Save style in database" ),
20662066
QObject::tr( "A style named \"%1\" already exists in the database for this layer. Do you want to overwrite it?" )
20672067
.arg( styleName.isEmpty() ? dsUri.table() : styleName ),
20682068
QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
2069-
{
2070-
errCause = QObject::tr( "Operation aborted. No changes were made in the database" );
2071-
QgsDebugMsg("User selected not to overwrite styles");
2072-
return false;
2073-
}
2069+
{
2070+
errCause = QObject::tr( "Operation aborted. No changes were made in the database" );
2071+
QgsDebugMsg( "User selected not to overwrite styles" );
2072+
return false;
2073+
}
20742074

2075-
QgsDebugMsg("Updating styles");
2075+
QgsDebugMsg( "Updating styles" );
20762076
sql = QString( "UPDATE layer_styles "
20772077
" SET useAsDefault=%1"
20782078
",styleQML=%2"
@@ -2110,8 +2110,8 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
21102110
sql = QString( "%1; %2;" ).arg( removeDefaultSql, sql );
21112111
}
21122112

2113-
QgsDebugMsg("Inserting styles");
2114-
QgsDebugMsg(sql);
2113+
QgsDebugMsg( "Inserting styles" );
2114+
QgsDebugMsg( sql );
21152115
bool execOk = query.exec( sql );
21162116

21172117
if ( !execOk )
@@ -2151,20 +2151,20 @@ QGISEXTERN QString loadStyle( const QString& uri, QString& errCause )
21512151
.arg( QgsMssqlProvider::quotedValue( dsUri.table() ) )
21522152
.arg( QgsMssqlProvider::quotedValue( dsUri.geometryColumn() ) );
21532153

2154-
if ( !query.exec( selectQmlQuery ) )
2155-
{
2156-
QgsDebugMsg("Load of style failed");
2157-
QString msg = query.lastError().text();
2158-
errCause = msg;
2159-
QgsDebugMsg( msg );
2160-
return QString();
2161-
}
2162-
if ( query.isActive() && query.next())
2163-
{
2164-
QString style = query.value( 0 ).toString();
2165-
return style;
2166-
}
2167-
return QString();
2154+
if ( !query.exec( selectQmlQuery ) )
2155+
{
2156+
QgsDebugMsg( "Load of style failed" );
2157+
QString msg = query.lastError().text();
2158+
errCause = msg;
2159+
QgsDebugMsg( msg );
2160+
return QString();
2161+
}
2162+
if ( query.isActive() && query.next() )
2163+
{
2164+
QString style = query.value( 0 ).toString();
2165+
return style;
2166+
}
2167+
return QString();
21682168
}
21692169

21702170
QGISEXTERN int listStyles( const QString &uri, QStringList &ids, QStringList &names,
@@ -2208,19 +2208,19 @@ QGISEXTERN int listStyles( const QString &uri, QStringList &ids, QStringList &na
22082208
.arg( QgsMssqlProvider::quotedValue( dsUri.schema() ) )
22092209
.arg( QgsMssqlProvider::quotedValue( dsUri.table() ) )
22102210
.arg( QgsMssqlProvider::quotedValue( dsUri.geometryColumn() ) );
2211-
bool queryOk = query.exec(selectRelatedQuery);
2212-
if(!queryOk)
2211+
bool queryOk = query.exec( selectRelatedQuery );
2212+
if ( !queryOk )
22132213
{
22142214
QgsDebugMsg( query.lastError().text() );
22152215
return -1;
22162216
}
22172217
int numberOfRelatedStyles = 0;
2218-
while( query.isActive() && query.next())
2218+
while ( query.isActive() && query.next() )
22192219
{
2220-
QgsDebugMsg(query.value(1).toString());
2221-
ids.append( query.value(0).toString() );
2222-
names.append( query.value(1).toString() );
2223-
descriptions.append( query.value(2).toString() );
2220+
QgsDebugMsg( query.value( 1 ).toString() );
2221+
ids.append( query.value( 0 ).toString() );
2222+
names.append( query.value( 1 ).toString() );
2223+
descriptions.append( query.value( 2 ).toString() );
22242224
numberOfRelatedStyles = numberOfRelatedStyles + 1;
22252225
}
22262226
QString selectOthersQuery = QString( "SELECT id,styleName,description"
@@ -2231,20 +2231,20 @@ QGISEXTERN int listStyles( const QString &uri, QStringList &ids, QStringList &na
22312231
.arg( QgsMssqlProvider::quotedValue( dsUri.schema() ) )
22322232
.arg( QgsMssqlProvider::quotedValue( dsUri.table() ) )
22332233
.arg( QgsMssqlProvider::quotedValue( dsUri.geometryColumn() ) );
2234-
QgsDebugMsg(selectOthersQuery);
2235-
queryOk = query.exec(selectOthersQuery);
2236-
if(!queryOk)
2234+
QgsDebugMsg( selectOthersQuery );
2235+
queryOk = query.exec( selectOthersQuery );
2236+
if ( !queryOk )
22372237
{
22382238
QString msg = query.lastError().text();
22392239
QgsDebugMsg( msg );
22402240
return -1;
22412241
}
2242-
QgsDebugMsg(query.isActive() && query.size());
2243-
while(query.next())
2242+
QgsDebugMsg( query.isActive() && query.size() );
2243+
while ( query.next() )
22442244
{
2245-
ids.append( query.value(0).toString() );
2246-
names.append( query.value(1).toString() );
2247-
descriptions.append( query.value(2).toString() );
2245+
ids.append( query.value( 0 ).toString() );
2246+
names.append( query.value( 1 ).toString() );
2247+
descriptions.append( query.value( 2 ).toString() );
22482248
}
22492249
return numberOfRelatedStyles;
22502250
}
@@ -2266,17 +2266,17 @@ QGISEXTERN QString getStyleById( const QString& uri, QString styleId, QString& e
22662266

22672267
QString style = "";
22682268
QString selectQmlQuery = QString( "SELECT styleQml FROM layer_styles WHERE id=%1" ).arg( QgsMssqlProvider::quotedValue( styleId ) );
2269-
bool queryOk = query.exec(selectQmlQuery);
2270-
if(!queryOk)
2269+
bool queryOk = query.exec( selectQmlQuery );
2270+
if ( !queryOk )
22712271
{
22722272
QString msg = query.lastError().text();
22732273
QgsDebugMsg( msg );
22742274
errCause = query.lastError().text();
22752275
return QString( );
22762276
}
2277-
while(query.next())
2277+
while ( query.next() )
22782278
{
2279-
style = query.value(0).toString();
2279+
style = query.value( 0 ).toString();
22802280
}
22812281
return style;
22822282
}

0 commit comments

Comments
 (0)