31
31
32
32
#include < QFile>
33
33
#include < QTextStream>
34
+ #include < QObject>
34
35
35
36
#include " qgis.h"
36
37
#include " qgsdataprovider.h"
39
40
#include " qgsrect.h"
40
41
#include " qgsgpxprovider.h"
41
42
#include " gpsdata.h"
43
+ #include < qgslogger.h>
42
44
43
45
#ifdef WIN32
44
46
#define QGISEXTERN extern " C" __declspec( dllexport )
@@ -54,7 +56,7 @@ const char* QgsGPXProvider::attr[] = { "name", "elevation", "symbol", "number",
54
56
55
57
const QString GPX_KEY = " gpx" ;
56
58
57
- const QString GPX_DESCRIPTION = " GPS eXchange format provider" ;
59
+ const QString GPX_DESCRIPTION = QObject::tr( " GPS eXchange format provider" ) ;
58
60
59
61
60
62
QgsGPXProvider::QgsGPXProvider (QString const & uri) :
@@ -71,7 +73,7 @@ QgsGPXProvider::QgsGPXProvider(QString const & uri) :
71
73
// get the filename and the type parameter from the URI
72
74
int fileNameEnd = uri.find (' ?' );
73
75
if (fileNameEnd == -1 || uri.mid (fileNameEnd + 1 , 5 ) != " type=" ) {
74
- std::cerr<< " Bad URI - you need to specify the feature type" <<std::endl ;
76
+ QgsLogger::warning ( tr ( " Bad URI - you need to specify the feature type. " )) ;
75
77
return ;
76
78
}
77
79
QString typeStr = uri.mid (fileNameEnd + 6 );
@@ -130,7 +132,7 @@ QgsGPXProvider::~QgsGPXProvider() {
130
132
131
133
QString QgsGPXProvider::storageType ()
132
134
{
133
- return " GPS eXchange file" ;
135
+ return tr ( " GPS eXchange file" ) ;
134
136
}
135
137
136
138
@@ -411,8 +413,8 @@ std::vector<QgsFeature>& QgsGPXProvider::identify(QgsRect * rect) {
411
413
// reset the data source since we need to be able to read through
412
414
// all features
413
415
reset ();
414
- std::cerr << " Attempting to identify features falling within "
415
- << rect->stringRep (). toLocal8Bit (). data () << std::endl ;
416
+ QgsLogger::debug ( " Attempting to identify features falling within " +
417
+ rect->stringRep ()) ;
416
418
// select the features
417
419
select (rect);
418
420
// temporary fix to get this to compile under windows
@@ -492,8 +494,8 @@ void QgsGPXProvider::reset() {
492
494
493
495
QString QgsGPXProvider::minValue (int position) {
494
496
if (position >= fieldCount ()) {
495
- std::cerr<< " Warning: access requested to invalid position "
496
- << " in QgsGPXProvider::minValue(..)" <<std::endl ;
497
+ QgsLogger::warning ( tr ( " Warning: access requested to invalid position "
498
+ " in QgsGPXProvider::minValue(..)" )) ;
497
499
}
498
500
if (mMinMaxCacheDirty ) {
499
501
fillMinMaxCash ();
@@ -504,8 +506,8 @@ QString QgsGPXProvider::minValue(int position) {
504
506
505
507
QString QgsGPXProvider::maxValue (int position) {
506
508
if (position >= fieldCount ()) {
507
- std::cerr<< " Warning: access requested to invalid position "
508
- << " in QgsGPXProvider::maxValue(..)" <<std::endl ;
509
+ QgsLogger::warning ( tr ( " Warning: access requested to invalid position "
510
+ " in QgsGPXProvider::maxValue(..)" )) ;
509
511
}
510
512
if (mMinMaxCacheDirty ) {
511
513
fillMinMaxCash ();
@@ -826,7 +828,7 @@ size_t QgsGPXProvider::layerCount() const
826
828
827
829
QString QgsGPXProvider::getDefaultValue (const QString& attr, QgsFeature* f) {
828
830
if (attr == " source" )
829
- return " Digitized in QGIS" ;
831
+ return tr ( " Digitized in QGIS" ) ;
830
832
return " " ;
831
833
}
832
834
0 commit comments