Skip to content

Commit

Permalink
Fixed crash when selecting custom projection in projection selector.
Browse files Browse the repository at this point in the history
(caused by QgsDebug(myDatabaseFileName) ... it expects C string, not QString)
Changed some debug messages from std::cout to QgsDebugMsg.


git-svn-id: http://svn.osgeo.org/qgis/trunk@6101 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Nov 16, 2006
1 parent efdec5e commit 6b36282
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/widgets/projectionselector/qgsprojectionselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
//qgis includes
#include "qgis.h" //magick numbers here
#include "qgsapplication.h"
#include "qgslogger.h"

//qt includes
#include <QDir>
Expand Down Expand Up @@ -276,8 +277,8 @@ QString QgsProjectionSelector::getCurrentProj4String()
QString myDatabaseFileName;
QString mySrsId = myItem->text(1);

std::cout << " QgsProjectionSelector::getCurrentProj4String : mySrsId = " << mySrsId.toLocal8Bit().data() << std::endl;
std::cout << " QgsProjectionSelector::getCurrentProj4String : USER_PROJECTION_START_ID = " << USER_PROJECTION_START_ID << std::endl;
QgsDebugMsg("mySrsId = " + mySrsId);
QgsDebugMsg("USER_PROJECTION_START_ID = " + QString::number(USER_PROJECTION_START_ID));
//
// Determine if this is a user projection or a system on
// user projection defs all have srs_id >= 100000
Expand All @@ -289,20 +290,19 @@ QString QgsProjectionSelector::getCurrentProj4String()
myFileInfo.setFile(myDatabaseFileName);
if ( !myFileInfo.exists( ) ) //its unlikely that this condition will ever be reached
{
std::cout << " QgsProjectionSelector::getCurrentProj4String : users qgis.db not found" << std::endl;
QgsDebugMsg("users qgis.db not found");
return NULL;
}
else
{
QgsDebug(myDatabaseFileName);
QgsDebug("File not found");
QgsDebugMsg("users qgis.db found");
}
}
else //must be a system projection then
{
myDatabaseFileName = mSrsDatabaseFileName;
}
std::cout << "QgsProjectionSelector::getCurrentProj4String db = " << myDatabaseFileName.toLocal8Bit().data() << std::endl;
QgsDebugMsg("db = " + myDatabaseFileName);


sqlite3 *db;
Expand Down

0 comments on commit 6b36282

Please sign in to comment.