Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Aug 25, 2015
1 parent b5362b0 commit 05b8a985a52d8c2e21d847b0c5e2b068982bb48d
@@ -86,18 +86,23 @@ def checkSupports(self):
isShapefile = self.inLayer and self.inLayer.providerType() == "ogr" and self.inLayer.storageType() == "ESRI Shapefile"

self.chkGeomColumn.setEnabled(allowSpatial and hasGeomType)
if not self.chkGeomColumn.isEnabled(): self.chkGeomColumn.setChecked(False)
if not self.chkGeomColumn.isEnabled():
self.chkGeomColumn.setChecked(False)

self.chkSourceSrid.setEnabled(allowSpatial and hasGeomType)
if not self.chkSourceSrid.isEnabled(): self.chkSourceSrid.setChecked(False)
if not self.chkSourceSrid.isEnabled():
self.chkSourceSrid.setChecked(False)
self.chkTargetSrid.setEnabled(allowSpatial and hasGeomType)
if not self.chkTargetSrid.isEnabled(): self.chkTargetSrid.setChecked(False)
if not self.chkTargetSrid.isEnabled():
self.chkTargetSrid.setChecked(False)

self.chkSinglePart.setEnabled(allowSpatial and hasGeomType and isShapefile)
if not self.chkSinglePart.isEnabled(): self.chkSinglePart.setChecked(False)
if not self.chkSinglePart.isEnabled():
self.chkSinglePart.setChecked(False)

self.chkSpatialIndex.setEnabled(allowSpatial and hasGeomType)
if not self.chkSpatialIndex.isEnabled(): self.chkSpatialIndex.setChecked(False)
if not self.chkSpatialIndex.isEnabled():
self.chkSpatialIndex.setChecked(False)

def populateLayers(self):
self.cboInputLayer.clear()
@@ -242,7 +247,7 @@ def accept(self):
# create the input layer (if not already done) and
# update available options
self.reloadInputLayer()

# sanity checks
if self.inLayer is None:
QMessageBox.information(self, self.tr("Import to database"), self.tr("Input layer missing or not valid"))
@@ -283,11 +288,13 @@ def accept(self):
srcUri = qgis.core.QgsDataSourceURI(self.inLayer.source())

pk = srcUri.keyColumn() if not self.chkPrimaryKey.isChecked() else self.editPrimaryKey.text()
if not pk: pk = self.default_pk
if not pk:
pk = self.default_pk

if self.inLayer.hasGeometryType() and self.chkGeomColumn.isEnabled():
geom = srcUri.geometryColumn() if not self.chkGeomColumn.isChecked() else self.editGeomColumn.text()
if not geom: geom = self.default_geom
if not geom:
geom = self.default_geom
else:
geom = None

@@ -1137,7 +1137,7 @@ void QgisApp::readSettings()
QStringList oldRecentProjects = settings.value( "/UI/recentProjectsList" ).toStringList();
settings.remove( "/UI/recentProjectsList" );

Q_FOREACH( const QString& project, oldRecentProjects )
Q_FOREACH ( const QString& project, oldRecentProjects )
{
QgsWelcomePageItemsModel::RecentProjectData data;
data.path = project;
@@ -1151,7 +1151,7 @@ void QgisApp::readSettings()



Q_FOREACH( const QString& key, projectKeys )
Q_FOREACH ( const QString& key, projectKeys )
{
QgsWelcomePageItemsModel::RecentProjectData data;
settings.beginGroup( key );
@@ -2720,7 +2720,7 @@ void QgisApp::updateRecentProjectPaths()
{
mRecentProjectsMenu->clear();

Q_FOREACH( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects )
Q_FOREACH ( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects )
{
QAction* action = mRecentProjectsMenu->addAction( QString( "%1 (%2)" ).arg( recentProject.title ).arg( recentProject.path ) );
action->setEnabled( QFile::exists(( recentProject.path ) ) );
@@ -2789,7 +2789,7 @@ void QgisApp::saveRecentProjectPath( QString projectPath, bool savePreviewImage
int idx = 0;

// Persist the list
Q_FOREACH( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects )
Q_FOREACH ( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects )
{
++idx;
settings.beginGroup( QString( "/UI/recentProjects/%1" ).arg( idx ) );
@@ -44,7 +44,7 @@ extern "C"

/********************** QgsGrassModuleParam *************************/
QgsGrassModuleParam::QgsGrassModuleParam( QgsGrassModule *module, QString key,
QDomElement &qdesc, QDomElement &gdesc, QDomNode &gnode, bool direct )
QDomElement &qdesc, QDomElement &gdesc, QDomNode &gnode, bool direct )
: mModule( module )
, mKey( key )
, mHidden( false )
@@ -124,11 +124,11 @@ QStringList QgsGrassModuleParam::options()
return QStringList();
}

QString QgsGrassModuleParam::getDescPrompt ( QDomElement descDomElement )
QString QgsGrassModuleParam::getDescPrompt( QDomElement descDomElement )
{
QDomNode gispromptNode = descDomElement.namedItem( "gisprompt" );

if ( !gispromptNode.isNull())
if ( !gispromptNode.isNull() )
{
QDomElement gispromptElement = gispromptNode.toElement();
if ( !gispromptElement.isNull() )
@@ -187,7 +187,7 @@ QList<QDomNode> QgsGrassModuleParam::nodesByType( QDomElement descDomElement, ST

while ( !n.isNull() )
{
QString prompt = getDescPrompt ( n.toElement() );
QString prompt = getDescPrompt( n.toElement() );
if ( typeMap.value( prompt ) == optionType )
{
nodes << n;
@@ -87,7 +87,7 @@ class QgsGrassModuleParam
* \param gnode option node in GRASS module XML description file
*/
QgsGrassModuleParam( QgsGrassModule *module, QString key,
QDomElement &qdesc, QDomElement &gdesc, QDomNode &gnode, bool direct );
QDomElement &qdesc, QDomElement &gdesc, QDomNode &gnode, bool direct );

//! Destructor
virtual ~QgsGrassModuleParam();
@@ -111,7 +111,7 @@ class QgsGrassModuleParam
QStringList errors() { return mErrors; }

/** Get gisprompt tag prompt attribute */
static QString getDescPrompt ( QDomElement descDomElement );
static QString getDescPrompt( QDomElement descDomElement );

//! Find element in GRASS module description by key, if not found, returned element is null
static QDomNode nodeByKey( QDomElement descDocElement, QString key );
@@ -518,7 +518,7 @@ class QgsGrassModuleField : public QgsGrassModuleGroupBoxItem
//! Retruns list of options which will be passed to module
virtual QStringList options() override;

void setLayerInput( QgsGrassModuleInput * layerInput) { mLayerInput = layerInput; }
void setLayerInput( QgsGrassModuleInput * layerInput ) { mLayerInput = layerInput; }
QgsGrassModuleInput * layerInput() const { return mLayerInput; }

public slots:
@@ -606,11 +606,11 @@ void QgsGrass::setMapset( QString gisdbase, QString location, QString mapset )
{
G_add_mapset_to_search_path( ms[i] ); // only adds mapset if it is not yet in path
#if GRASS_VERSION_MAJOR >= 7
free ( ms[i] );
free( ms[i] );
#endif
}
#if GRASS_VERSION_MAJOR >= 7
free (ms);
free( ms );
#endif
#endif
}
@@ -961,7 +961,7 @@ bool QgsMssqlProvider::addAttributes( const QList<QgsField> &attributes )
QString statement;

if ( attributes.count() == 0 )
return true;
return true;

for ( QList<QgsField>::const_iterator it = attributes.begin(); it != attributes.end(); ++it )
{
@@ -1939,7 +1939,7 @@ bool QgsPostgresProvider::addAttributes( const QList<QgsField> &attributes )
return false;

if ( attributes.count() == 0 )
return true;
return true;

QgsPostgresConn* conn = connectionRW();
if ( !conn )
@@ -3798,7 +3798,7 @@ bool QgsSpatiaLiteProvider::addAttributes( const QList<QgsField> &attributes )
QString sql;

if ( attributes.count() == 0 )
return true;
return true;

int ret = sqlite3_exec( sqliteHandle, "BEGIN", NULL, NULL, &errMsg );
if ( ret != SQLITE_OK )

0 comments on commit 05b8a98

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