Skip to content
Permalink
Browse files

spit: use qt templates

  • Loading branch information
jef-n committed Oct 12, 2013
1 parent 17fc3e9 commit e73718edd2db9ef41a402e18833fa00ef297ecc9
@@ -272,7 +272,7 @@ bool QgsShapeFile::insertLayer( QString dbname, QString schema, QString primary_
.arg( QgsPgUtil::quotedIdentifier( table_name ) )
.arg( QgsPgUtil::quotedIdentifier( primary_key ) );

for ( uint n = 0; n < column_names.size() && result; n++ )
for ( int n = 0; n < column_names.size() && result; n++ )
{
query += QString( ",%1 %2" )
.arg( QgsPgUtil::quotedIdentifier( column_names[n] ) )
@@ -387,7 +387,7 @@ bool QgsShapeFile::insertLayer( QString dbname, QString schema, QString primary_
QString geometry( geo_temp );
CPLFree( geo_temp );

for ( uint n = 0; n < column_types.size(); n++ )
for ( int n = 0; n < column_types.size(); n++ )
{
QString val;

@@ -53,8 +53,8 @@ class QgsShapeFile : public QObject
QString getTable();
void setTable( QString new_table );
void setDefaultTable();
std::vector <QString> column_names;
std::vector <QString> column_types;
QStringList column_names;
QStringList column_types;
void setColumnNames( QStringList );
bool scanGeometries();

@@ -278,11 +278,11 @@ void QgsSpit::addFile()

void QgsSpit::removeFile()
{
std::vector <int> temp;
QVector<int> temp;
for ( int n = 0; n < tblShapefiles->rowCount(); n++ )
if ( tblShapefiles->isItemSelected( tblShapefiles->item( n, 0 ) ) )
{
for ( std::vector<QgsShapeFile *>::iterator vit = fileList.begin(); vit != fileList.end(); vit++ )
for ( QVector<QgsShapeFile *>::iterator vit = fileList.begin(); vit != fileList.end(); vit++ )
{
if (( *vit ) ->getName() == tblShapefiles->item( n, 0 )->text() )
{
@@ -531,7 +531,7 @@ void QgsSpit::import()

int count = fileList.size(), successes = 0;

for ( std::vector<QgsShapeFile*>::size_type i = 0; i < fileList.size() ; i++ )
for ( QVector<QgsShapeFile*>::size_type i = 0; i < fileList.size() ; i++ )
{
QString error = tr( "Problem inserting features from file:" ) + "\n" +
tblShapefiles->item( i, ColFILENAME )->text();
@@ -557,14 +557,14 @@ void QgsSpit::import()
}

// duplicate field check
std::vector<QString> names_copy = fileList[ i ] ->column_names;
QStringList names_copy = fileList[ i ] ->column_names;
names_copy.push_back( txtPrimaryKeyName->text() );
names_copy.push_back( txtGeomName->text() );

QString dupl = "";
std::sort( names_copy.begin(), names_copy.end() );
qSort( names_copy.begin(), names_copy.end() );

for ( std::vector<QString>::size_type k = 1; k < names_copy.size(); k++ )
for ( int k = 1; k < names_copy.size(); k++ )
{
QgsDebugMsg( QString( "Checking to see if %1 == %2" ).arg( names_copy[ k ] ).arg( names_copy[ k - 1 ] ) );
if ( names_copy[ k ] == names_copy[ k - 1 ] )
@@ -110,7 +110,7 @@ class QgsSpit : public QDialog, private Ui::QgsSpitBase
QStringList schema_list;
QStringList geometry_list;
int total_features;
std::vector <QgsShapeFile *> fileList;
QVector<QgsShapeFile *> fileList;
int defSrid;
QString defGeom;
int defaultSridValue;

0 comments on commit e73718e

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