mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
Changing std::string to QString in GPSData::getData() and GPSData::releaseData() to support Qt libraries built without STL support
git-svn-id: http://svn.osgeo.org/qgis/trunk@1392 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
9db85b5856
commit
67454fd8a9
@ -394,7 +394,7 @@ bool GPSData::parseLOC(QDomNode& node) {
|
||||
}
|
||||
|
||||
|
||||
GPSData* GPSData::getData(std::string filename) {
|
||||
GPSData* GPSData::getData(const QString& filename) {
|
||||
|
||||
// if the data isn't there already, try to load it
|
||||
if (dataObjects.find(filename) == dataObjects.end()) {
|
||||
@ -418,7 +418,7 @@ GPSData* GPSData::getData(std::string filename) {
|
||||
}
|
||||
|
||||
|
||||
void GPSData::releaseData(std::string filename) {
|
||||
void GPSData::releaseData(const QString& filename) {
|
||||
|
||||
/* decrease the reference count for the filename (if it is used), and erase
|
||||
it if the reference count becomes 0 */
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include <qdom.h>
|
||||
#include <qstring.h>
|
||||
|
||||
#include "../../src/qgsrect.h"
|
||||
|
||||
@ -180,13 +181,13 @@ class GPSData {
|
||||
function you should also call releaseData() with the same @c filename
|
||||
when you're done with the GPSData pointer, otherwise the data will stay
|
||||
in memory forever and you will get an ugly memory leak. */
|
||||
static GPSData* getData(std::string filename);
|
||||
static GPSData* getData(const QString& filename);
|
||||
|
||||
/** Call this function when you're done with a GPSData pointer that you
|
||||
got earlier using getData(). Do NOT call this function if you haven't
|
||||
called getData() earlier with the same @c filename, that can cause data
|
||||
that is still in use to be deleted. */
|
||||
static void releaseData(std::string filename);
|
||||
static void releaseData(const QString& filename);
|
||||
|
||||
|
||||
/** operator<< is our friend. */
|
||||
@ -219,7 +220,7 @@ class GPSData {
|
||||
double xMin, xMax, yMin, yMax;
|
||||
|
||||
/** This is used internally to store GPS data objects (one per file). */
|
||||
typedef std::map<std::string, std::pair<GPSData, unsigned> > DataMap;
|
||||
typedef std::map<QString, std::pair<GPSData, unsigned> > DataMap;
|
||||
|
||||
/** This is the static container that maps filenames to GPSData objects and
|
||||
does reference counting, so several providers can use the same GPSData
|
||||
|
Loading…
x
Reference in New Issue
Block a user