diff --git a/src/plugins/gps_importer/qgsbabelformat.cpp b/src/plugins/gps_importer/qgsbabelformat.cpp index cf2336e8f25..99fdcaf7eb6 100644 --- a/src/plugins/gps_importer/qgsbabelformat.cpp +++ b/src/plugins/gps_importer/qgsbabelformat.cpp @@ -19,8 +19,8 @@ #include "qgsbabelformat.h" -#include -#include +#include +#include QgsBabelFormat::QgsBabelFormat(const QString& name) : diff --git a/src/plugins/gps_importer/qgsbabelformat.h b/src/plugins/gps_importer/qgsbabelformat.h index fcc5547dd68..f651590dbb6 100644 --- a/src/plugins/gps_importer/qgsbabelformat.h +++ b/src/plugins/gps_importer/qgsbabelformat.h @@ -20,9 +20,9 @@ #include -#include -#include +#include +class QString; class QgsBabelFormat { public: diff --git a/src/plugins/gps_importer/qgsgpsdevice.cpp b/src/plugins/gps_importer/qgsgpsdevice.cpp index 6c420a378f0..94cb236d37d 100644 --- a/src/plugins/gps_importer/qgsgpsdevice.cpp +++ b/src/plugins/gps_importer/qgsgpsdevice.cpp @@ -1,4 +1,4 @@ -#include +#include #include "qgsgpsdevice.h" diff --git a/src/plugins/gps_importer/qgsgpsdevice.h b/src/plugins/gps_importer/qgsgpsdevice.h index 038a2d76c36..9723efa4171 100644 --- a/src/plugins/gps_importer/qgsgpsdevice.h +++ b/src/plugins/gps_importer/qgsgpsdevice.h @@ -21,8 +21,8 @@ #ifndef QGSGPSDEVICE_H #define QGSGPSDEVICE_H -#include -#include +#include +#include #include diff --git a/src/plugins/gps_importer/qgsgpsdevicedialog.h b/src/plugins/gps_importer/qgsgpsdevicedialog.h index 8142cc98254..273d14a4a0c 100644 --- a/src/plugins/gps_importer/qgsgpsdevicedialog.h +++ b/src/plugins/gps_importer/qgsgpsdevicedialog.h @@ -15,7 +15,7 @@ #include "ui_qgsgpsdevicedialogbase.h" #include "qgsgpsdevice.h" -#include +#include class QgsGPSDeviceDialog : public QDialog, private Ui::QgsGPSDeviceDialogBase diff --git a/src/plugins/gps_importer/qgsgpsplugin.cpp b/src/plugins/gps_importer/qgsgpsplugin.cpp index 9c001552ada..9812c669fbf 100644 --- a/src/plugins/gps_importer/qgsgpsplugin.cpp +++ b/src/plugins/gps_importer/qgsgpsplugin.cpp @@ -29,21 +29,13 @@ #include "qgsgpsplugin.h" -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include //non qt includes #include diff --git a/src/plugins/gps_importer/qgsgpsplugin.h b/src/plugins/gps_importer/qgsgpsplugin.h index 26eec1ed2b2..ceb41cfe306 100644 --- a/src/plugins/gps_importer/qgsgpsplugin.h +++ b/src/plugins/gps_importer/qgsgpsplugin.h @@ -22,7 +22,7 @@ #include "qgsbabelformat.h" #include "qgsgpsdevice.h" #include "../qgisplugin.h" -#include + #include class QgsVectorLayer; diff --git a/src/plugins/gps_importer/qgsgpsplugingui.cpp b/src/plugins/gps_importer/qgsgpsplugingui.cpp index 9528eb989cc..2480840f153 100644 --- a/src/plugins/gps_importer/qgsgpsplugingui.cpp +++ b/src/plugins/gps_importer/qgsgpsplugingui.cpp @@ -13,6 +13,7 @@ #include "qgsgpsdevicedialog.h" #include "qgsmaplayer.h" #include "qgsdataprovider.h" +#include //qt includes #include @@ -201,9 +202,9 @@ void QgsGPSPluginGui::on_pbnCancel_clicked() void QgsGPSPluginGui::on_pbnGPXSelectFile_clicked() { - std::cout << " Gps File Importer::pbnGPXSelectFile_clicked() " << std::endl; + QgsLogger::debug(" Gps File Importer::pbnGPXSelectFile_clicked() "); QString myFileTypeQString; - QString myFilterString="GPS eXchange format (*.gpx)"; + QString myFilterString=tr("GPS eXchange format (*.gpx)"); QSettings settings("QuantumGIS", "qgis"); QString dir = settings.readEntry("/Plugin-GPS/gpxdirectory"); if (dir.isEmpty()) @@ -214,7 +215,7 @@ void QgsGPSPluginGui::on_pbnGPXSelectFile_clicked() dir, //initial dir myFilterString, //filters to select &myFileTypeQString); //the pointer to store selected filter - std::cout << "Selected filetype filter is : " << myFileTypeQString.toLocal8Bit().data() << std::endl; + QgsLogger::debug("Selected filetype filter is : " + myFileTypeQString); leGPXFile->setText(myFileNameQString); } @@ -231,11 +232,11 @@ void QgsGPSPluginGui::on_pbnIMPInput_clicked() { std::map::const_iterator iter; iter = mImporters.find(mImpFormat); if (iter == mImporters.end()) { - std::cerr << "Unknown file format selected: " - << myFileType.left(myFileType.length() - 6).toLocal8Bit().data() << std::endl; + QgsLogger::warning("Unknown file format selected: " + + myFileType.left(myFileType.length() - 6)); } else { - std::cerr << iter->first.toLocal8Bit().data() << " selected" << std::endl; + QgsLogger::debug(iter->first + " selected"); leIMPInput->setText(myFileName); cmbIMPFeature->clear(); if (iter->second->supportsWaypoints()) diff --git a/src/providers/gpx/gpsdata.cpp b/src/providers/gpx/gpsdata.cpp index ec01368e386..ee700a1ebf8 100644 --- a/src/providers/gpx/gpsdata.cpp +++ b/src/providers/gpx/gpsdata.cpp @@ -20,9 +20,10 @@ #include #include +#include #include "gpsdata.h" - +#include QString GPSObject::xmlify(const QString& str) { QString tmp = str; @@ -311,11 +312,11 @@ GPSData* GPSData::getData(const QString& filename) { if (dataObjects.find(filename) == dataObjects.end()) { QFile file(filename); if (!file.open(QIODevice::ReadOnly)) { - qWarning("Couldn't open the data source: " + filename); + QgsLogger::warning(QObject::tr("Couldn't open the data source: ") + filename); return 0; } GPSData* data = new GPSData; - std::cerr << "Loading file " << filename.toLocal8Bit().data() << std::endl; + QgsLogger::debug("Loading file " + filename); GPXHandler handler(*data); bool failed = false; @@ -332,9 +333,10 @@ GPSData* GPSData::getData(const QString& filename) { if (file.atEnd()) atEnd = 1; if (!XML_Parse(p, buffer, readBytes, atEnd)) { - std::cerr<<"Parse error at line " - <(data, 0); } else - std::cerr << filename.toLocal8Bit().data() << " is already loaded"<second.second) == 0) { - std::cerr << "No one's using " << filename.toLocal8Bit().data() << ", I'll erase it" << std::endl; + QgsLogger::debug("No one's using " + filename + ", I'll erase it"); delete iter->second.first; dataObjects.erase(iter); } @@ -379,7 +381,7 @@ GPSData::DataMap GPSData::dataObjects; bool GPXHandler::startElement(const XML_Char* qName, const XML_Char** attr) { - //std::cerr<<"<"<"< #include +#include #include "qgis.h" #include "qgsdataprovider.h" @@ -39,6 +40,7 @@ #include "qgsrect.h" #include "qgsgpxprovider.h" #include "gpsdata.h" +#include #ifdef WIN32 #define QGISEXTERN extern "C" __declspec( dllexport ) @@ -54,7 +56,7 @@ const char* QgsGPXProvider::attr[] = { "name", "elevation", "symbol", "number", const QString GPX_KEY = "gpx"; -const QString GPX_DESCRIPTION = "GPS eXchange format provider"; +const QString GPX_DESCRIPTION = QObject::tr("GPS eXchange format provider"); QgsGPXProvider::QgsGPXProvider(QString const & uri) : @@ -71,7 +73,7 @@ QgsGPXProvider::QgsGPXProvider(QString const & uri) : // get the filename and the type parameter from the URI int fileNameEnd = uri.find('?'); if (fileNameEnd == -1 || uri.mid(fileNameEnd + 1, 5) != "type=") { - std::cerr<<"Bad URI - you need to specify the feature type"<& QgsGPXProvider::identify(QgsRect * rect) { // reset the data source since we need to be able to read through // all features reset(); - std::cerr << "Attempting to identify features falling within " - << rect->stringRep().toLocal8Bit().data() << std::endl; + QgsLogger::debug("Attempting to identify features falling within " + + rect->stringRep()); // select the features select(rect); // temporary fix to get this to compile under windows @@ -492,8 +494,8 @@ void QgsGPXProvider::reset() { QString QgsGPXProvider::minValue(int position) { if (position >= fieldCount()) { - std::cerr<<"Warning: access requested to invalid position " - <<"in QgsGPXProvider::minValue(..)"<= fieldCount()) { - std::cerr<<"Warning: access requested to invalid position " - <<"in QgsGPXProvider::maxValue(..)"<