Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Completed conversion from Qt3 to Qt4 widgets
Fixed an 'EOF on connection' error (postgres connection wasn't being freed).
Fixed a crash in the standalone spit when clicking close
Made the standaone spit program behave like a main window rather than
  a dialog box (ie it has a taskbar entry now).
Fixed bug with spit not putting data into non-default schema.
Fixed bug with UI display after deleting selected shapefiles.
Misc. code tidy ups.



git-svn-id: http://svn.osgeo.org/qgis/trunk@4754 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jan 27, 2006
1 parent 05d529a commit 816004a
Show file tree
Hide file tree
Showing 7 changed files with 224 additions and 117 deletions.
3 changes: 1 addition & 2 deletions src/plugins/spit/main.cpp
Expand Up @@ -4,10 +4,9 @@
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
QgsSpit w;
QgsSpit w(0, Qt::Window);
w.show();

// Moved get schema to constructor so plugins will work w.getSchema();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );

return a.exec();
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/spit/qgsshapefile.cpp
Expand Up @@ -16,7 +16,7 @@
***************************************************************************/
/* $Id$ */

#include <qapplication.h>
#include <QApplication>
#include <ogrsf_frmts.h>
#include <ogr_geometry.h>
#include <string>
Expand Down Expand Up @@ -249,8 +249,8 @@ void QgsShapeFile::setColumnNames(QStringList columns)
}
}

bool QgsShapeFile::insertLayer(QString dbname, QString schema, QString geom_col, QString srid, PGconn * conn, Q3ProgressDialog * pro, bool &fin){
connect(pro, SIGNAL(cancelled()), this, SLOT(cancelImport()));
bool QgsShapeFile::insertLayer(QString dbname, QString schema, QString geom_col, QString srid, PGconn * conn, QProgressDialog& pro, bool &fin){
connect(&pro, SIGNAL(cancelled()), this, SLOT(cancelImport()));
import_cancelled = false;
bool result = true;
// Mangle the table name to make it PG compliant by replacing spaces with
Expand Down Expand Up @@ -291,7 +291,7 @@ bool QgsShapeFile::insertLayer(QString dbname, QString schema, QString geom_col,
PQclear(res);
}

query = "SELECT AddGeometryColumn(\'" + dbname + "\', \'" + table_name + "\', \'"+geom_col+"\', " + srid +
query = "SELECT AddGeometryColumn(\'" + schema + "\', \'" + table_name + "\', \'"+geom_col+"\', " + srid +
", \'" + geom_type + "\', 2)";
if(result) res = PQexec(conn, (const char *)query);
if(PQresultStatus(res)!=PGRES_TUPLES_OK){
Expand Down Expand Up @@ -365,7 +365,7 @@ bool QgsShapeFile::insertLayer(QString dbname, QString schema, QString geom_col,
PQclear(res);
}

pro->setProgress(pro->progress()+1);
pro.setValue(pro.value()+1);
qApp->processEvents();
delete[] geo_temp;
}
Expand Down
11 changes: 6 additions & 5 deletions src/plugins/spit/qgsshapefile.h
Expand Up @@ -20,11 +20,12 @@
#define QGSSHAPEFILE_H

#include <vector>
#include <qstring.h>
#include <qstringlist.h>
#include <qobject.h>
#include <QString>
#include <QStringList>
#include <QObject>
#include <ogrsf_frmts.h>
#include <q3progressdialog.h>

class QProgressDialog;

class OGRLayer;
class OGRDataSource;
Expand All @@ -43,7 +44,7 @@ class QgsShapeFile : public QObject
~QgsShapeFile();
int getFeatureCount();
QString getFeatureClass();
bool insertLayer(QString dbname, QString schema, QString geom_col, QString srid, PGconn * conn, Q3ProgressDialog * pro, bool &fin);
bool insertLayer(QString dbname, QString schema, QString geom_col, QString srid, PGconn * conn, QProgressDialog& pro, bool &fin);

bool is_valid();
QString getName();
Expand Down

0 comments on commit 816004a

Please sign in to comment.