Skip to content

Commit

Permalink
spit: use qt templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 12, 2013
1 parent 17fc3e9 commit e73718e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/plugins/spit/qgsshapefile.cpp
Expand Up @@ -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] ) )
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/spit/qgsshapefile.h
Expand Up @@ -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();

Expand Down
12 changes: 6 additions & 6 deletions src/plugins/spit/qgsspit.cpp
Expand Up @@ -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() )
{
Expand Down Expand Up @@ -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();
Expand All @@ -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 ] )
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/spit/qgsspit.h
Expand Up @@ -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;
Expand Down

0 comments on commit e73718e

Please sign in to comment.