Skip to content

Commit

Permalink
Removed duplicate code that set the database encoding (no need to do …
Browse files Browse the repository at this point in the history
…it twice)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4616 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gsherman committed Jan 8, 2006
1 parent 33cdc0e commit 6aa8da9
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -172,9 +172,6 @@ QgsPostgresProvider::QgsPostgresProvider(QString const & uri)
// store the connection for future use
connection = pd;

#ifdef QGISDEBUG
std::cerr << "Checking for select permission on the relation\n";
#endif
//set client encoding to unicode because QString uses UTF-8 anyway
#ifdef QGISDEBUG
qWarning("setting client encoding to UNICODE");
Expand All @@ -195,27 +192,9 @@ QgsPostgresProvider::QgsPostgresProvider(QString const & uri)
}
#endif


//set client encoding to unicode because QString uses UTF-8 anyway
#ifdef QGISDEBUG
qWarning("setting client encoding to UNICODE");
#endif
errcode=PQsetClientEncoding(connection, "UNICODE");
#ifdef QGISDEBUG
if(errcode==0)
{
qWarning("encoding successfully set");
}
else if(errcode==-1)
{
qWarning("error in setting encoding");
}
else
{
qWarning("undefined return value from encoding setting");
}
std::cerr << "Checking for select permission on the relation\n";
#endif

// Check that we can read from the table (i.e., we have
// select permission).
QString sql = "select * from " + mSchemaTableName + " limit 1";
Expand Down

0 comments on commit 6aa8da9

Please sign in to comment.