Skip to content

Commit 6b36282

Browse files
author
wonder
committed
Fixed crash when selecting custom projection in projection selector.
(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
1 parent efdec5e commit 6b36282

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/widgets/projectionselector/qgsprojectionselector.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
//qgis includes
1919
#include "qgis.h" //magick numbers here
2020
#include "qgsapplication.h"
21+
#include "qgslogger.h"
2122

2223
//qt includes
2324
#include <QDir>
@@ -276,8 +277,8 @@ QString QgsProjectionSelector::getCurrentProj4String()
276277
QString myDatabaseFileName;
277278
QString mySrsId = myItem->text(1);
278279

279-
std::cout << " QgsProjectionSelector::getCurrentProj4String : mySrsId = " << mySrsId.toLocal8Bit().data() << std::endl;
280-
std::cout << " QgsProjectionSelector::getCurrentProj4String : USER_PROJECTION_START_ID = " << USER_PROJECTION_START_ID << std::endl;
280+
QgsDebugMsg("mySrsId = " + mySrsId);
281+
QgsDebugMsg("USER_PROJECTION_START_ID = " + QString::number(USER_PROJECTION_START_ID));
281282
//
282283
// Determine if this is a user projection or a system on
283284
// user projection defs all have srs_id >= 100000
@@ -289,20 +290,19 @@ QString QgsProjectionSelector::getCurrentProj4String()
289290
myFileInfo.setFile(myDatabaseFileName);
290291
if ( !myFileInfo.exists( ) ) //its unlikely that this condition will ever be reached
291292
{
292-
std::cout << " QgsProjectionSelector::getCurrentProj4String : users qgis.db not found" << std::endl;
293+
QgsDebugMsg("users qgis.db not found");
293294
return NULL;
294295
}
295296
else
296297
{
297-
QgsDebug(myDatabaseFileName);
298-
QgsDebug("File not found");
298+
QgsDebugMsg("users qgis.db found");
299299
}
300300
}
301301
else //must be a system projection then
302302
{
303303
myDatabaseFileName = mSrsDatabaseFileName;
304304
}
305-
std::cout << "QgsProjectionSelector::getCurrentProj4String db = " << myDatabaseFileName.toLocal8Bit().data() << std::endl;
305+
QgsDebugMsg("db = " + myDatabaseFileName);
306306

307307

308308
sqlite3 *db;

0 commit comments

Comments
 (0)