Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
indentation update
  • Loading branch information
jef-n committed Aug 25, 2015
1 parent b5362b0 commit 05b8a98
Show file tree
Hide file tree
Showing 10 changed files with 698 additions and 690 deletions.
23 changes: 15 additions & 8 deletions python/plugins/db_manager/dlg_import_vector.py
Expand Up @@ -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()
Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/app/qgisapp.cpp
Expand Up @@ -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;
Expand All @@ -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 );
Expand Down Expand Up @@ -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 ) ) );
Expand Down Expand Up @@ -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 ) );
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/grass/qgsgrassmoduleparam.cpp
Expand Up @@ -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 )
Expand Down Expand Up @@ -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() )
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/grass/qgsgrassmoduleparam.h
Expand Up @@ -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();
Expand All @@ -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 );
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/providers/grass/qgsgrass.cpp
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/mssql/qgsmssqlprovider.cpp
Expand Up @@ -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 )
{
Expand Down
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -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 )
Expand Down

0 comments on commit 05b8a98

Please sign in to comment.