mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Apply wonders make patch for geos issues
Try to improve errror checking for when ~/.qgis.db doesnt exist git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4032 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
f6f6309e81
commit
9ff0615892
@ -39,4 +39,4 @@ libqgis_legend_la_LIBFLAGS = $(QT_LDADD)
|
||||
libqgis_legend_la_LDFLAGS = -version-info $(INTERFACE_VERSION)
|
||||
libqgis_legend_la_CXXFLAGS = $(PKGDATAPATH) -I.. \
|
||||
$(CXXFLAGS) $(EXTRA_CXXFLAGS) \
|
||||
$(GDAL_CFLAGS) $(QT_CXXFLAGS) $(DEBUG_QGIS)
|
||||
$(GDAL_CFLAGS) $(QT_CXXFLAGS) $(DEBUG_QGIS) $(GEOS_CFLAGS)
|
||||
|
@ -79,7 +79,7 @@ QgsCustomProjectionDialog::QgsCustomProjectionDialog( QWidget* parent , const ch
|
||||
QString myMasterDatabaseFileName = PKGDATAPATH;
|
||||
myMasterDatabaseFileName += "/resources/qgis.db";
|
||||
//now copy the master file into the users .qgis dir
|
||||
std::ifstream myInputStream(myMasterDatabaseFileName.latin1() );
|
||||
std::ifstream myInputStream(myMasterDatabaseFileName.local8Bit() );
|
||||
|
||||
if (! myInputStream)
|
||||
{
|
||||
@ -89,11 +89,11 @@ QgsCustomProjectionDialog::QgsCustomProjectionDialog( QWidget* parent , const ch
|
||||
return ;
|
||||
}
|
||||
|
||||
std::ofstream myOutputStream(QString(mQGisSettingsDir+"qgis.db").latin1());
|
||||
std::ofstream myOutputStream(QString(mQGisSettingsDir+"qgis.db").local8Bit());
|
||||
|
||||
if (! myOutputStream)
|
||||
{
|
||||
std::cerr << "cannot open " << QString(mQGisSettingsDir+"qgis.db").latin1() << " for output\n";
|
||||
std::cerr << "cannot open " << QString(mQGisSettingsDir+"qgis.db").local8Bit() << " for output\n";
|
||||
//XXX Do better error handling
|
||||
return ;
|
||||
}
|
||||
@ -136,7 +136,7 @@ void QgsCustomProjectionDialog::getProjList ()
|
||||
sqlite3_stmt *myPreparedStatement;
|
||||
int myResult;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
@ -172,7 +172,7 @@ void QgsCustomProjectionDialog::getEllipsoidList()
|
||||
sqlite3_stmt *myPreparedStatement;
|
||||
int myResult;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
@ -220,7 +220,7 @@ void QgsCustomProjectionDialog::pbnDelete_clicked()
|
||||
int myResult;
|
||||
QString myName;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
@ -281,7 +281,7 @@ long QgsCustomProjectionDialog::getRecordCount()
|
||||
int myResult;
|
||||
long myRecordCount=0;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
@ -315,7 +315,7 @@ QString QgsCustomProjectionDialog::getProjectionFamilyName(QString theProjection
|
||||
int myResult;
|
||||
QString myName;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
@ -347,7 +347,7 @@ QString QgsCustomProjectionDialog::getEllipsoidName(QString theEllipsoidAcronym)
|
||||
int myResult;
|
||||
QString myName;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
@ -379,7 +379,7 @@ QString QgsCustomProjectionDialog::getProjectionFamilyAcronym(QString theProject
|
||||
int myResult;
|
||||
QString myName;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
@ -411,7 +411,7 @@ QString QgsCustomProjectionDialog::getEllipsoidAcronym(QString theEllipsoidName)
|
||||
int myResult;
|
||||
QString myName;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
@ -446,7 +446,7 @@ void QgsCustomProjectionDialog::pbnFirst_clicked()
|
||||
sqlite3_stmt *myPreparedStatement;
|
||||
int myResult;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
@ -515,7 +515,7 @@ void QgsCustomProjectionDialog::pbnPrevious_clicked()
|
||||
sqlite3_stmt *myPreparedStatement;
|
||||
int myResult;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
@ -593,7 +593,7 @@ void QgsCustomProjectionDialog::pbnNext_clicked()
|
||||
sqlite3_stmt *myPreparedStatement;
|
||||
int myResult;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
@ -667,7 +667,7 @@ void QgsCustomProjectionDialog::pbnLast_clicked()
|
||||
sqlite3_stmt *myPreparedStatement;
|
||||
int myResult;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
@ -780,7 +780,7 @@ void QgsCustomProjectionDialog::pbnSave_clicked()
|
||||
// We must check the prj def is valid!
|
||||
//
|
||||
|
||||
projPJ myProj = pj_init_plus( leParameters->text().latin1() );
|
||||
projPJ myProj = pj_init_plus( leParameters->text().local8Bit() );
|
||||
|
||||
if ( myProj == NULL )
|
||||
{
|
||||
@ -846,10 +846,13 @@ void QgsCustomProjectionDialog::pbnSave_clicked()
|
||||
sqlite3_stmt *myPreparedStatement;
|
||||
int myResult;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
if(myResult)
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult!=SQLITE_OK)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) <<
|
||||
" /n please noticfy QGIS developers of this error \n " <<
|
||||
QString(mQGisSettingsDir+"qgis.db").local8Bit() << " (file name) "
|
||||
<< std::endl;
|
||||
// XXX This will likely never happen since on open, sqlite creates the
|
||||
// database if it does not exist.
|
||||
assert(myResult == 0);
|
||||
@ -895,8 +898,8 @@ void QgsCustomProjectionDialog::cboProjectionFamily_highlighted( const QString &
|
||||
sqlite3_stmt *myPreparedStatement;
|
||||
int myResult;
|
||||
//check the db is available
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").latin1(), &myDatabase);
|
||||
if(myResult)
|
||||
myResult = sqlite3_open(QString(mQGisSettingsDir+"qgis.db").local8Bit(), &myDatabase);
|
||||
if(myResult!=SQLITE_OK)
|
||||
{
|
||||
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
|
||||
// XXX This will likely never happen since on open, sqlite creates the
|
||||
@ -949,7 +952,7 @@ bool QgsCustomProjectionDialog::makeDir(QDir &theQDir)
|
||||
|
||||
qDebug("attempting to create directory %s in %s",
|
||||
(const char *)myTempFileInfo.fileName(),
|
||||
myBaseDir.path().latin1());
|
||||
myBaseDir.path());
|
||||
|
||||
return myBaseDir.mkdir(myTempFileInfo.fileName());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user