Skip to content

Commit eb10682

Browse files
author
jef
committed
automatic indentation update (r10429-r10457)
git-svn-id: http://svn.osgeo.org/qgis/trunk@10458 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6100301 commit eb10682

16 files changed

+1209
-1209
lines changed

src/app/attributetable/BeataModel.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ QVariant BeataModel::data( const QModelIndex &index, int role ) const
408408
mLastRow = ( QgsAttributeMap * ) & mFeat.attributeMap();
409409
}
410410

411-
if( !mLastRow )
411+
if ( !mLastRow )
412412
return QVariant( "ERROR" );
413413

414414
QVariant& val = ( *mLastRow )[ mAttributes[index.column()] ];
@@ -542,7 +542,7 @@ QVariant BeataMemModel::data( const QModelIndex &index, int role ) const
542542
mLastRow = ( QgsAttributeMap * ) & mFeat.attributeMap();
543543
}
544544

545-
if( !mLastRow )
545+
if ( !mLastRow )
546546
return QVariant( "ERROR" );
547547

548548
QVariant &val = ( *mLastRow )[ mAttributes[index.column()] ];
@@ -582,7 +582,7 @@ bool BeataMemModel::setData( const QModelIndex &index, const QVariant &value, in
582582
{
583583
mLastRowId = rowToId( index.row() );
584584
mFeat = mFeatureMap[rowToId( index.row() )];
585-
mLastRow = ( QgsAttributeMap * ) &mFeat.attributeMap();
585+
mLastRow = ( QgsAttributeMap * ) & mFeat.attributeMap();
586586

587587

588588
// QgsDebugMsg(mFeatureMap[rowToId(index.row())].id());

src/app/ogr/qgsogrhelperfunctions.cpp

+105-105
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,105 @@
1-
/***************************************************************************
2-
qgsogrhelperfunctions.cpp
3-
helper functions to create ogr uris for database and protocol drivers
4-
-------------------
5-
begin : Mon Jan 2 2009
6-
copyright : (C) 2009 by Godofredo Contreras Nava
7-
email : frdcn at hotmail.com
8-
***************************************************************************/
9-
10-
/***************************************************************************
11-
* *
12-
* This program is free software; you can redistribute it and/or modify *
13-
* it under the terms of the GNU General Public License as published by *
14-
* the Free Software Foundation; either version 2 of the License, or *
15-
* (at your option) any later version. *
16-
* *
17-
***************************************************************************/
18-
/* $Id:$ */
19-
20-
#include "qgsogrhelperfunctions.h"
21-
#include "qgslogger.h"
22-
#include <QRegExp>
23-
24-
QString createDatabaseURI( QString connectionType, QString host, QString database, QString port, QString user, QString password )
25-
{
26-
QString uri = "";
27-
//todo:add default ports for all kind of databases
28-
if (connectionType=="ESRI Personal GeoDatabase")
29-
{
30-
uri="PGeo:"+database;
31-
}
32-
else if (connectionType=="ESRI ArcSDE")
33-
{
34-
if (port.isNull()||port.isEmpty())
35-
port="5151";
36-
uri="SDE:"+host+",PORT:"+port+","+database+","+user+","+password;
37-
}
38-
else if (connectionType=="Informix DataBlade")
39-
{
40-
//not tested
41-
uri="IDB:dbname="+database+" server="+host
42-
+" user="+user
43-
+" pass="+password+" ";
44-
45-
}
46-
else if (connectionType=="INGRES")
47-
{
48-
//not tested
49-
uri="@driver=ingres,dbname="+database+",userid="+user+", password="+password+" ";
50-
}
51-
else if (connectionType=="MySQL")
52-
{
53-
uri="MySQL:"+database+",host="+host
54-
+",port="+port+",user="+user
55-
+", password="+password+" ";
56-
}
57-
else if (connectionType=="Oracle Spatial")
58-
{
59-
uri="OCI:"+user+"/"+password
60-
+"@"+host+"/"+database;
61-
}
62-
else if (connectionType=="ODBC")
63-
{
64-
if(!user.isEmpty())
65-
{
66-
if(password.isEmpty())
67-
{
68-
uri="ODBC:"+user+"@"+database;
69-
}
70-
else
71-
{
72-
uri="ODBC:"+user+"/"+password+"@"+database;
73-
}
74-
75-
}
76-
else
77-
{
78-
uri="ODBC:"+database;
79-
}
80-
}
81-
else if (connectionType=="OGDI Vectors")
82-
{
83-
}
84-
else if (connectionType=="PostgreSQL")
85-
{
86-
uri="PG:dbname='"+database+"' host='"+host
87-
+"' port='"+port+"' user='"+user
88-
+"' password='"+password+"' ";
89-
90-
}
91-
QgsDebugMsg("Connection type is="+connectionType+" and uri="+uri);
92-
return uri;
93-
}
94-
95-
96-
QString createProtocolURI( QString type, QString url )
97-
{
98-
QString uri = "";
99-
if ( type == "GeoJSON" )
100-
{
101-
uri = url;
102-
}
103-
QgsDebugMsg( "Connection type is=" + type + " and uri=" + uri );
104-
return uri;
105-
}
1+
/***************************************************************************
2+
qgsogrhelperfunctions.cpp
3+
helper functions to create ogr uris for database and protocol drivers
4+
-------------------
5+
begin : Mon Jan 2 2009
6+
copyright : (C) 2009 by Godofredo Contreras Nava
7+
email : frdcn at hotmail.com
8+
***************************************************************************/
9+
10+
/***************************************************************************
11+
* *
12+
* This program is free software; you can redistribute it and/or modify *
13+
* it under the terms of the GNU General Public License as published by *
14+
* the Free Software Foundation; either version 2 of the License, or *
15+
* (at your option) any later version. *
16+
* *
17+
***************************************************************************/
18+
/* $Id:$ */
19+
20+
#include "qgsogrhelperfunctions.h"
21+
#include "qgslogger.h"
22+
#include <QRegExp>
23+
24+
QString createDatabaseURI( QString connectionType, QString host, QString database, QString port, QString user, QString password )
25+
{
26+
QString uri = "";
27+
//todo:add default ports for all kind of databases
28+
if ( connectionType == "ESRI Personal GeoDatabase" )
29+
{
30+
uri = "PGeo:" + database;
31+
}
32+
else if ( connectionType == "ESRI ArcSDE" )
33+
{
34+
if ( port.isNull() || port.isEmpty() )
35+
port = "5151";
36+
uri = "SDE:" + host + ",PORT:" + port + "," + database + "," + user + "," + password;
37+
}
38+
else if ( connectionType == "Informix DataBlade" )
39+
{
40+
//not tested
41+
uri = "IDB:dbname=" + database + " server=" + host
42+
+ " user=" + user
43+
+ " pass=" + password + " ";
44+
45+
}
46+
else if ( connectionType == "INGRES" )
47+
{
48+
//not tested
49+
uri = "@driver=ingres,dbname=" + database + ",userid=" + user + ", password=" + password + " ";
50+
}
51+
else if ( connectionType == "MySQL" )
52+
{
53+
uri = "MySQL:" + database + ",host=" + host
54+
+ ",port=" + port + ",user=" + user
55+
+ ", password=" + password + " ";
56+
}
57+
else if ( connectionType == "Oracle Spatial" )
58+
{
59+
uri = "OCI:" + user + "/" + password
60+
+ "@" + host + "/" + database;
61+
}
62+
else if ( connectionType == "ODBC" )
63+
{
64+
if ( !user.isEmpty() )
65+
{
66+
if ( password.isEmpty() )
67+
{
68+
uri = "ODBC:" + user + "@" + database;
69+
}
70+
else
71+
{
72+
uri = "ODBC:" + user + "/" + password + "@" + database;
73+
}
74+
75+
}
76+
else
77+
{
78+
uri = "ODBC:" + database;
79+
}
80+
}
81+
else if ( connectionType == "OGDI Vectors" )
82+
{
83+
}
84+
else if ( connectionType == "PostgreSQL" )
85+
{
86+
uri = "PG:dbname='" + database + "' host='" + host
87+
+ "' port='" + port + "' user='" + user
88+
+ "' password='" + password + "' ";
89+
90+
}
91+
QgsDebugMsg( "Connection type is=" + connectionType + " and uri=" + uri );
92+
return uri;
93+
}
94+
95+
96+
QString createProtocolURI( QString type, QString url )
97+
{
98+
QString uri = "";
99+
if ( type == "GeoJSON" )
100+
{
101+
uri = url;
102+
}
103+
QgsDebugMsg( "Connection type is=" + type + " and uri=" + uri );
104+
return uri;
105+
}

src/app/ogr/qgsogrhelperfunctions.h

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
/***************************************************************************
2-
qgsogrhelperfunctions.h
3-
helper functions to create ogr uris for database and protocol drivers
4-
-------------------
5-
begin : Mon Jan 2 2009
6-
copyright : (C) 2009 by Godofredo Contreras Nava
7-
email : frdcn at hotmail.com
8-
***************************************************************************/
9-
10-
/***************************************************************************
11-
* *
12-
* This program is free software; you can redistribute it and/or modify *
13-
* it under the terms of the GNU General Public License as published by *
14-
* the Free Software Foundation; either version 2 of the License, or *
15-
* (at your option) any later version. *
16-
* *
17-
***************************************************************************/
18-
/* $Id:$ */
19-
20-
#include <QString>
21-
22-
/* Create database uri from connection parameters */
23-
QString createDatabaseURI(QString connectionType, QString host, QString database, QString port, QString user, QString password);
24-
25-
/* Create protocol uri from connection parameters */
26-
QString createProtocolURI(QString type, QString url);
1+
/***************************************************************************
2+
qgsogrhelperfunctions.h
3+
helper functions to create ogr uris for database and protocol drivers
4+
-------------------
5+
begin : Mon Jan 2 2009
6+
copyright : (C) 2009 by Godofredo Contreras Nava
7+
email : frdcn at hotmail.com
8+
***************************************************************************/
9+
10+
/***************************************************************************
11+
* *
12+
* This program is free software; you can redistribute it and/or modify *
13+
* it under the terms of the GNU General Public License as published by *
14+
* the Free Software Foundation; either version 2 of the License, or *
15+
* (at your option) any later version. *
16+
* *
17+
***************************************************************************/
18+
/* $Id:$ */
19+
20+
#include <QString>
21+
22+
/* Create database uri from connection parameters */
23+
QString createDatabaseURI( QString connectionType, QString host, QString database, QString port, QString user, QString password );
24+
25+
/* Create protocol uri from connection parameters */
26+
QString createProtocolURI( QString type, QString url );

0 commit comments

Comments
 (0)