mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Follow Qt naming style: fileName instead of filename, layerName instead of layerName
git-svn-id: http://svn.osgeo.org/qgis/trunk@9136 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
0636f412b2
commit
ab85a37ff6
@ -3,7 +3,7 @@
|
||||
|
||||
QGIS_DEBUG is an int describing what debug messages are written to the console. If the debug level of a message is <= QGIS_DEBUG, the message is written to the console. It the variable QGIS_DEBUG is not defined, it defaults to 1 for debug mode and to 0 for release mode
|
||||
|
||||
QGIS_DEBUG_FILE may contain a filename. Only the messages from this file are printed (provided they have the right debuglevel). If QGIS_DEBUG_FILE is not set, messages from all files are printed
|
||||
QGIS_DEBUG_FILE may contain a fileName. Only the messages from this file are printed (provided they have the right debuglevel). If QGIS_DEBUG_FILE is not set, messages from all files are printed
|
||||
*/
|
||||
|
||||
class QgsLogger
|
||||
@ -17,7 +17,7 @@ class QgsLogger
|
||||
/**Goes to qDebug.
|
||||
@param msg the message to be printed
|
||||
@param debuglevel
|
||||
@param file filename where the message comes from
|
||||
@param file fileName where the message comes from
|
||||
@param function function where the message comes from
|
||||
@param line place in file where the message comes from*/
|
||||
static void debug(const QString& msg, int debuglevel = 1, const char* file = NULL, const char* function = NULL, int line = -1);
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
*/
|
||||
QPicture pictureMarker (QString fullName, int size, QPen pen, QBrush brush, bool qtBug = true );
|
||||
|
||||
/** Returns a pixmap given a filename of a svg marker
|
||||
/** Returns a pixmap given a fileName of a svg marker
|
||||
* NOTE: this method needs to be public static for QgsMarkerDialog::visualizeMarkers */
|
||||
static void svgMarker (QPainter * thepPainter, QString name, int size );
|
||||
};
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
Every project has an associated file that contains its XML
|
||||
*/
|
||||
//@{
|
||||
void setFilename( const QString & name );
|
||||
void setFileName( const QString & name );
|
||||
|
||||
/** returns file name */
|
||||
QString fileName() const;
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
static void buildSupportedRasterFileFilter(QString & fileFilters);
|
||||
static void registerGdalDrivers();
|
||||
|
||||
/** This helper checks to see whether the filename appears to be a valid
|
||||
/** This helper checks to see whether the fileName appears to be a valid
|
||||
raster file name */
|
||||
static bool isValidRasterFileName(const QString & theFileNameQString);
|
||||
|
||||
|
@ -781,7 +781,7 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
|
||||
std::auto_ptr < QFileDialog > myQFileDialog(
|
||||
new QFileDialog(
|
||||
this,
|
||||
tr("Choose a filename to save the map image as"),
|
||||
tr("Choose a fileName to save the map image as"),
|
||||
file.path(),
|
||||
myFilters
|
||||
)
|
||||
@ -797,7 +797,7 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
|
||||
// set the 'Open' button to something that makes more sense
|
||||
myQFileDialog->setAcceptMode(QFileDialog::AcceptSave);
|
||||
|
||||
//prompt the user for a filename
|
||||
//prompt the user for a fileName
|
||||
QString myOutputFileNameQString; // = myQFileDialog->getSaveFileName(); //delete this
|
||||
|
||||
int result = myQFileDialog->exec();
|
||||
@ -876,7 +876,7 @@ void QgsComposer::on_mActionExportAsSVG_activated(void)
|
||||
}
|
||||
QString myLastUsedFile = myQSettings.value("/UI/lastSaveAsSvgFile","qgis.svg").toString();
|
||||
QFileInfo file(myLastUsedFile);
|
||||
QFileDialog *myQFileDialog = new QFileDialog( this, tr("Choose a filename to save the map as"),
|
||||
QFileDialog *myQFileDialog = new QFileDialog( this, tr("Choose a fileName to save the map as"),
|
||||
file.path(), tr("SVG Format") + " (*.svg *SVG)" );
|
||||
myQFileDialog->selectFile( file.fileName() );
|
||||
myQFileDialog->setFileMode(QFileDialog::AnyFile);
|
||||
|
@ -84,7 +84,7 @@ void usage( std::string const & appName )
|
||||
<< "raster and vector data.\n"
|
||||
<< "Usage: " << appName << " [options] [FILES]\n"
|
||||
<< " options:\n"
|
||||
<< "\t[--snapshot filename]\temit snapshot of loaded datasets to given file\n"
|
||||
<< "\t[--snapshot fileName]\temit snapshot of loaded datasets to given file\n"
|
||||
<< "\t[--lang language]\tuse language for interface text\n"
|
||||
<< "\t[--project projectfile]\tload the given QGIS project\n"
|
||||
<< "\t[--extent xmin,ymin,xmax,ymax]\tset initial map extent\n"
|
||||
@ -584,7 +584,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// autoload any filenames that were passed in on the command line
|
||||
// autoload any fileNames that were passed in on the command line
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
#ifdef QGISDEBUG
|
||||
std::cout << "Number of files in myFileList: " << myFileList.count() << std::endl;
|
||||
|
@ -1975,7 +1975,7 @@ static void openFilesRememberingFilter_(QString const &filterName,
|
||||
|
||||
|
||||
/**
|
||||
This method prompts the user for a list of vector filenames with a dialog.
|
||||
This method prompts the user for a list of vector fileNames with a dialog.
|
||||
*/
|
||||
void QgisApp::addVectorLayer()
|
||||
{
|
||||
@ -2074,7 +2074,7 @@ bool QgisApp::addVectorLayers(QStringList const & theLayerQStringList, const QSt
|
||||
|
||||
|
||||
|
||||
/** This helper checks to see whether the filename appears to be a valid vector file name */
|
||||
/** This helper checks to see whether the fileName appears to be a valid vector file name */
|
||||
bool QgisApp::isValidVectorFileName(QString theFileNameQString)
|
||||
{
|
||||
return (theFileNameQString.toLower().endsWith(".shp"));
|
||||
@ -2527,7 +2527,7 @@ void QgisApp::fileNew(bool thePromptToSaveFlag)
|
||||
|
||||
QgsProject* prj = QgsProject::instance();
|
||||
prj->title( QString::null );
|
||||
prj->setFilename( QString::null );
|
||||
prj->setFileName( QString::null );
|
||||
prj->clearProperties(); // why carry over properties from previous projects?
|
||||
|
||||
QSettings settings;
|
||||
@ -2599,7 +2599,7 @@ void QgisApp::newVectorLayer()
|
||||
bool haveLastUsedFilter = false; // by default, there is no last
|
||||
// used filter
|
||||
QString enc;
|
||||
QString filename;
|
||||
QString fileName;
|
||||
|
||||
QSettings settings; // where we keep last used filter in
|
||||
// persistant state
|
||||
@ -2634,14 +2634,14 @@ void QgisApp::newVectorLayer()
|
||||
return;
|
||||
}
|
||||
|
||||
filename = openFileDialog->selectedFiles().first();
|
||||
fileName = openFileDialog->selectedFiles().first();
|
||||
enc = openFileDialog->encoding();
|
||||
|
||||
// If the file exists, delete it otherwise we'll end up loading that
|
||||
// file, which can cause problems (e.g., if the file contains
|
||||
// linestrings, but we're wanting to create points, we'll end up
|
||||
// with a linestring file).
|
||||
QFile::remove(filename);
|
||||
QFile::remove(fileName);
|
||||
|
||||
settings.setValue("/UI/lastVectorFileFilter", openFileDialog->selectedFilter());
|
||||
|
||||
@ -2668,20 +2668,20 @@ void QgisApp::newVectorLayer()
|
||||
#if 0
|
||||
if(geometrytype == QGis::WKBPoint)
|
||||
{
|
||||
createEmptyDataSource(filename,fileformat, enc, QGis::WKBPoint, attributes);
|
||||
createEmptyDataSource(fileName,fileformat, enc, QGis::WKBPoint, attributes);
|
||||
}
|
||||
else if (geometrytype == QGis::WKBLineString)
|
||||
{
|
||||
createEmptyDataSource(filename,fileformat, enc, QGis::WKBLineString, attributes);
|
||||
createEmptyDataSource(fileName,fileformat, enc, QGis::WKBLineString, attributes);
|
||||
}
|
||||
else if(geometrytype == QGis::WKBPolygon)
|
||||
{
|
||||
createEmptyDataSource(filename,fileformat, enc, QGis::WKBPolygon, attributes);
|
||||
createEmptyDataSource(fileName,fileformat, enc, QGis::WKBPolygon, attributes);
|
||||
}
|
||||
#endif
|
||||
if(geometrytype != QGis::WKBUnknown)
|
||||
{
|
||||
createEmptyDataSource(filename,fileformat, enc, geometrytype, attributes);
|
||||
createEmptyDataSource(fileName,fileformat, enc, geometrytype, attributes);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2696,9 +2696,9 @@ void QgisApp::newVectorLayer()
|
||||
}
|
||||
|
||||
//then add the layer to the view
|
||||
QStringList filenames;
|
||||
filenames.append(filename);
|
||||
addVectorLayers(filenames, enc);
|
||||
QStringList fileNames;
|
||||
fileNames.append(fileName);
|
||||
addVectorLayers(fileNames, enc);
|
||||
}
|
||||
|
||||
void QgisApp::fileOpen()
|
||||
@ -2749,7 +2749,7 @@ void QgisApp::fileOpen()
|
||||
delete mComposer;
|
||||
mComposer = new QgsComposer(this);
|
||||
|
||||
QgsProject::instance()->setFilename( fullPath );
|
||||
QgsProject::instance()->setFileName( fullPath );
|
||||
|
||||
try
|
||||
{
|
||||
@ -2873,7 +2873,7 @@ bool QgisApp::fileSave()
|
||||
return false;
|
||||
}
|
||||
|
||||
// if we don't have a filename, then obviously we need to get one; note
|
||||
// if we don't have a fileName, then obviously we need to get one; note
|
||||
// that the project file name is reset to null in fileNew()
|
||||
QFileInfo fullPath;
|
||||
|
||||
@ -2917,7 +2917,7 @@ bool QgisApp::fileSave()
|
||||
}
|
||||
|
||||
|
||||
QgsProject::instance()->setFilename( fullPath.filePath() );
|
||||
QgsProject::instance()->setFileName( fullPath.filePath() );
|
||||
}
|
||||
|
||||
try
|
||||
@ -2964,7 +2964,7 @@ void QgisApp::fileSaveAs()
|
||||
QString lastUsedDir = settings.value("/UI/lastProjectDir", ".").toString();
|
||||
|
||||
auto_ptr<QFileDialog> saveFileDialog( new QFileDialog(this,
|
||||
tr("Choose a filename to save the QGIS project file as"),
|
||||
tr("Choose a fileName to save the QGIS project file as"),
|
||||
lastUsedDir, QObject::tr("QGis files (*.qgs)")) );
|
||||
|
||||
saveFileDialog->setFileMode(QFileDialog::AnyFile);
|
||||
@ -2973,7 +2973,7 @@ void QgisApp::fileSaveAs()
|
||||
|
||||
saveFileDialog->setConfirmOverwrite( true );
|
||||
|
||||
// if we don't have a filename, then obviously we need to get one; note
|
||||
// if we don't have a fileName, then obviously we need to get one; note
|
||||
// that the project file name is reset to null in fileNew()
|
||||
QFileInfo fullPath;
|
||||
|
||||
@ -3003,7 +3003,7 @@ void QgisApp::fileSaveAs()
|
||||
|
||||
try
|
||||
{
|
||||
QgsProject::instance()->setFilename( fullPath.filePath() );
|
||||
QgsProject::instance()->setFileName( fullPath.filePath() );
|
||||
|
||||
if ( QgsProject::instance()->write() )
|
||||
{
|
||||
@ -3205,7 +3205,7 @@ void QgisApp::saveMapAsImage()
|
||||
|
||||
//create a file dialog using the the filter list generated above
|
||||
std::auto_ptr < QFileDialog > myQFileDialog( new QFileDialog(this,
|
||||
tr("Choose a filename to save the map image as"),
|
||||
tr("Choose a fileName to save the map image as"),
|
||||
myLastUsedDir, myFilters) );
|
||||
|
||||
// allow for selection of more than one file
|
||||
@ -3222,7 +3222,7 @@ void QgisApp::saveMapAsImage()
|
||||
}
|
||||
|
||||
|
||||
//prompt the user for a filename
|
||||
//prompt the user for a fileName
|
||||
QString myOutputFileNameQString; // = myQFileDialog->getSaveFileName(); //delete this
|
||||
if (myQFileDialog->exec() == QDialog::Accepted)
|
||||
{
|
||||
@ -3233,7 +3233,7 @@ void QgisApp::saveMapAsImage()
|
||||
QgsDebugMsg("Selected filter: " + myFilterString);
|
||||
QgsDebugMsg("Image type to be passed to mapcanvas: " + myFilterMap[myFilterString]);
|
||||
|
||||
// Add the file type suffix to the filename if required
|
||||
// Add the file type suffix to the fileName if required
|
||||
if (!myOutputFileNameQString.endsWith(myFilterMap[myFilterString]))
|
||||
{
|
||||
myOutputFileNameQString += "." + myFilterMap[myFilterString];
|
||||
@ -3259,7 +3259,7 @@ void QgisApp::saveMapAsImage(QString theImageFileNameQString, QPixmap * theQPixm
|
||||
{
|
||||
if ( theImageFileNameQString=="")
|
||||
{
|
||||
//no filename chosen
|
||||
//no fileName chosen
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -80,14 +80,14 @@ class QgisApp : public QMainWindow
|
||||
QgsVectorLayer* addVectorLayer(QString vectorLayerPath, QString baseName, QString providerKey);
|
||||
|
||||
/** \brief overloaded vesion of the privat addLayer method that takes a list of
|
||||
* filenames instead of prompting user with a dialog.
|
||||
* fileNames instead of prompting user with a dialog.
|
||||
@param enc encoding type for the layer
|
||||
@returns true if successfully added layer
|
||||
*/
|
||||
bool addVectorLayers(QStringList const & theLayerQStringList, const QString& enc);
|
||||
|
||||
/** overloaded vesion of the private addRasterLayer()
|
||||
Method that takes a list of filenames instead of prompting
|
||||
Method that takes a list of fileNames instead of prompting
|
||||
user with a dialog.
|
||||
@returns true if successfully added layer(s)
|
||||
*/
|
||||
@ -178,7 +178,7 @@ class QgisApp : public QMainWindow
|
||||
public slots:
|
||||
//! About QGis
|
||||
void about();
|
||||
//! Add a raster layer to the map (will prompt user for filename using dlg )
|
||||
//! Add a raster layer to the map (will prompt user for fileName using dlg )
|
||||
void addRasterLayer();
|
||||
//#ifdef HAVE_POSTGRESQL
|
||||
//! Add a databaselayer to the map
|
||||
@ -452,7 +452,7 @@ private:
|
||||
*/
|
||||
bool addRasterLayer(QgsRasterLayer * theRasterLayer);
|
||||
//@todo We should move these next two into vector layer class
|
||||
/** This helper checks to see whether the filename appears to be a valid vector file name */
|
||||
/** This helper checks to see whether the fileName appears to be a valid vector file name */
|
||||
bool isValidVectorFileName (QString theFileNameQString);
|
||||
/** Overloaded version of the above function provided for convenience that takes a qstring pointer */
|
||||
bool isValidVectorFileName (QString * theFileNameQString);
|
||||
|
@ -245,10 +245,10 @@ void QgsAbout::openUrl(QString url)
|
||||
* Step 2: Replace all bytes of the UTF-8 above 0x7f with the hexcode in lower case.
|
||||
* Step 2: Replace all non [a-z][a-Z][0-9] with underscore (backward compatibility)
|
||||
*/
|
||||
QString QgsAbout::fileSystemSafe(QString filename)
|
||||
QString QgsAbout::fileSystemSafe(QString fileName)
|
||||
{
|
||||
QString result;
|
||||
QByteArray utf8 = filename.toUtf8();
|
||||
QByteArray utf8 = fileName.toUtf8();
|
||||
|
||||
for (int i = 0; i < utf8.size(); i++)
|
||||
{
|
||||
|
@ -367,7 +367,7 @@ void QgsMapserverExport::on_btnChooseFile_clicked()
|
||||
{
|
||||
QString s = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
"Choose a filename for the exported map file",
|
||||
"Choose a fileName for the exported map file",
|
||||
"./",
|
||||
"Mapserver files (*.map)" );
|
||||
txtMapFilePath->setText(s);
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
//! get the full path name of the map file
|
||||
QString fullPathName();
|
||||
//! Set the full path to the file
|
||||
void setFileName(QString filename);
|
||||
void setFileName(QString fileName);
|
||||
enum ACTION {
|
||||
SAVE,
|
||||
SAVEAS,
|
||||
|
@ -804,7 +804,7 @@ void QgsRasterLayerProperties::sync()
|
||||
*/
|
||||
cboxShowDebugInfo->hide();
|
||||
|
||||
//these properties (layername and label) are provided by the qgsmaplayer superclass
|
||||
//these properties (layerName and label) are provided by the qgsmaplayer superclass
|
||||
leLayerSource->setText(mRasterLayer->source());
|
||||
leDisplayName->setText(mRasterLayer->name());
|
||||
|
||||
@ -1824,15 +1824,15 @@ void QgsRasterLayerProperties::on_pbnDefaultValues_clicked()
|
||||
|
||||
void QgsRasterLayerProperties::on_pbnExportTransparentPixelValues_clicked()
|
||||
{
|
||||
QString myFilename = QFileDialog::getSaveFileName(this, tr("Save file"), "/", tr("Textfile (*.txt)"));
|
||||
if(!myFilename.isEmpty())
|
||||
QString myFileName = QFileDialog::getSaveFileName(this, tr("Save file"), "/", tr("Textfile (*.txt)"));
|
||||
if(!myFileName.isEmpty())
|
||||
{
|
||||
if(!myFilename.endsWith(".txt", Qt::CaseInsensitive))
|
||||
if(!myFileName.endsWith(".txt", Qt::CaseInsensitive))
|
||||
{
|
||||
myFilename = myFilename + ".txt";
|
||||
myFileName = myFileName + ".txt";
|
||||
}
|
||||
|
||||
QFile myOutputFile(myFilename);
|
||||
QFile myOutputFile(myFileName);
|
||||
if (myOutputFile.open(QFile::WriteOnly))
|
||||
{
|
||||
QTextStream myOutputStream(&myOutputFile);
|
||||
@ -2307,8 +2307,8 @@ void QgsRasterLayerProperties::on_pbnImportTransparentPixelValues_clicked()
|
||||
int myLineCounter = 0;
|
||||
bool myImportError = false;
|
||||
QString myBadLines;
|
||||
QString myFilename = QFileDialog::getOpenFileName(this, tr("Open file"), "/", tr("Textfile (*.txt)"));
|
||||
QFile myInputFile(myFilename);
|
||||
QString myFileName = QFileDialog::getOpenFileName(this, tr("Open file"), "/", tr("Textfile (*.txt)"));
|
||||
QFile myInputFile(myFileName);
|
||||
if (myInputFile.open(QFile::ReadOnly))
|
||||
{
|
||||
QTextStream myInputStream(&myInputFile);
|
||||
@ -2383,7 +2383,7 @@ void QgsRasterLayerProperties::on_pbnImportTransparentPixelValues_clicked()
|
||||
QMessageBox::warning(this, tr("Import Error"), tr("The following lines contained errors\n\n") + myBadLines );
|
||||
}
|
||||
}
|
||||
else if(!myFilename.isEmpty())
|
||||
else if(!myFileName.isEmpty())
|
||||
{
|
||||
QMessageBox::warning(this, tr("Read access denied"), tr("Read access denied. Adjust the file permissions and try again.\n\n") );
|
||||
}
|
||||
@ -2921,7 +2921,7 @@ void QgsRasterLayerProperties::on_pbnLoadStyle_clicked()
|
||||
myFileDialog->setFileMode ( QFileDialog::AnyFile );
|
||||
myFileDialog->setAcceptMode ( QFileDialog::AcceptOpen );
|
||||
|
||||
//prompt the user for a filename
|
||||
//prompt the user for a fileName
|
||||
QString myFileName;
|
||||
if ( myFileDialog->exec() == QDialog::Accepted )
|
||||
{
|
||||
@ -2936,7 +2936,7 @@ void QgsRasterLayerProperties::on_pbnLoadStyle_clicked()
|
||||
{
|
||||
if ( myFileDialog->selectedFilter() == tr ( "QGIS Layer Style File (*.qml)" ) )
|
||||
{
|
||||
//ensure the user never ommitted the extension from the filename
|
||||
//ensure the user never ommitted the extension from the fileName
|
||||
if ( !myFileName.toUpper().endsWith ( ".QML" ) )
|
||||
{
|
||||
myFileName += ".qml";
|
||||
@ -2987,7 +2987,7 @@ void QgsRasterLayerProperties::on_pbnSaveStyleAs_clicked()
|
||||
myFileDialog->setFileMode ( QFileDialog::AnyFile );
|
||||
myFileDialog->setAcceptMode ( QFileDialog::AcceptSave );
|
||||
|
||||
//prompt the user for a filename
|
||||
//prompt the user for a fileName
|
||||
QString myOutputFileName;
|
||||
if ( myFileDialog->exec() == QDialog::Accepted )
|
||||
{
|
||||
@ -3002,7 +3002,7 @@ void QgsRasterLayerProperties::on_pbnSaveStyleAs_clicked()
|
||||
{
|
||||
if ( myFileDialog->selectedFilter() == tr ( "QGIS Layer Style File (*.qml)" ) )
|
||||
{
|
||||
//ensure the user never ommitted the extension from the filename
|
||||
//ensure the user never ommitted the extension from the fileName
|
||||
if ( !myOutputFileName.toUpper().endsWith ( ".QML" ) )
|
||||
{
|
||||
myOutputFileName += ".qml";
|
||||
|
@ -927,7 +927,7 @@ void QgsVectorLayerProperties::on_pbnLoadStyle_clicked()
|
||||
myFileDialog->setFileMode ( QFileDialog::AnyFile );
|
||||
myFileDialog->setAcceptMode ( QFileDialog::AcceptOpen );
|
||||
|
||||
//prompt the user for a filename
|
||||
//prompt the user for a fileName
|
||||
QString myFileName;
|
||||
if ( myFileDialog->exec() == QDialog::Accepted )
|
||||
{
|
||||
@ -942,7 +942,7 @@ void QgsVectorLayerProperties::on_pbnLoadStyle_clicked()
|
||||
{
|
||||
if ( myFileDialog->selectedFilter() == tr ( "QGIS Layer Style File (*.qml)" ) )
|
||||
{
|
||||
//ensure the user never ommitted the extension from the filename
|
||||
//ensure the user never ommitted the extension from the fileName
|
||||
if ( !myFileName.endsWith( ".qml", Qt::CaseInsensitive ) )
|
||||
{
|
||||
myFileName += ".qml";
|
||||
@ -992,7 +992,7 @@ void QgsVectorLayerProperties::on_pbnSaveStyleAs_clicked()
|
||||
myFileDialog->setFileMode ( QFileDialog::AnyFile );
|
||||
myFileDialog->setAcceptMode ( QFileDialog::AcceptSave );
|
||||
|
||||
//prompt the user for a filename
|
||||
//prompt the user for a fileName
|
||||
QString myOutputFileName;
|
||||
if ( myFileDialog->exec() == QDialog::Accepted )
|
||||
{
|
||||
@ -1009,7 +1009,7 @@ void QgsVectorLayerProperties::on_pbnSaveStyleAs_clicked()
|
||||
{
|
||||
apply(); // make sure the qml to save is uptodate
|
||||
|
||||
//ensure the user never ommitted the extension from the filename
|
||||
//ensure the user never ommitted the extension from the fileName
|
||||
if ( !myOutputFileName.endsWith ( ".qml", Qt::CaseInsensitive ) )
|
||||
{
|
||||
myOutputFileName += ".qml";
|
||||
|
@ -39,7 +39,7 @@ __FILE__, __FUNCTION__, __LINE__);
|
||||
* If the debug level of a message is <= QGIS_DEBUG, the message is written to the
|
||||
* console. It the variable QGIS_DEBUG is not defined, it defaults to 1 for debug
|
||||
* mode and to 0 for release mode
|
||||
* QGIS_DEBUG_FILE may contain a filename. Only the messages from this file are
|
||||
* QGIS_DEBUG_FILE may contain a fileName. Only the messages from this file are
|
||||
* printed (provided they have the right debuglevel). If QGIS_DEBUG_FILE is not
|
||||
* set, messages from all files are printed
|
||||
*/
|
||||
@ -51,7 +51,7 @@ class CORE_EXPORT QgsLogger
|
||||
/**Goes to qDebug.
|
||||
@param msg the message to be printed
|
||||
@param debuglevel
|
||||
@param file filename where the message comes from
|
||||
@param file fileName where the message comes from
|
||||
@param function function where the message comes from
|
||||
@param line place in file where the message comes from*/
|
||||
static void debug(const QString& msg, int debuglevel = 1, const char* file = NULL, const char* function = NULL, int line = -1);
|
||||
|
@ -191,7 +191,7 @@ bool QgsMapLayer::readXML( QDomNode & layer_node )
|
||||
setMaxScale(element.attribute("maxScale").toFloat());
|
||||
|
||||
// set name
|
||||
mnl = layer_node.namedItem("layername");
|
||||
mnl = layer_node.namedItem("layerName");
|
||||
mne = mnl.toElement();
|
||||
setLayerName( mne.text() );
|
||||
|
||||
@ -255,7 +255,7 @@ bool QgsMapLayer::writeXML( QDomNode & layer_node, QDomDocument & document )
|
||||
|
||||
|
||||
// layer name
|
||||
QDomElement layerName = document.createElement( "layername" );
|
||||
QDomElement layerName = document.createElement( "layerName" );
|
||||
QDomText layerNameText = document.createTextNode( name() );
|
||||
layerName.appendChild( layerNameText );
|
||||
|
||||
@ -482,7 +482,7 @@ QString QgsMapLayer::loadNamedStyle ( const QString theURI, bool &theResultFlag)
|
||||
else
|
||||
{
|
||||
QFileInfo project( QgsProject::instance()->fileName() );
|
||||
QgsDebugMsg( QString("project filename: %1").arg( project.absoluteFilePath() ) );
|
||||
QgsDebugMsg( QString("project fileName: %1").arg( project.absoluteFilePath() ) );
|
||||
|
||||
QString qml;
|
||||
if( loadNamedStyleFromDb( QDir( QgsApplication::qgisSettingsDirPath() ).absoluteFilePath( "qgis.qmldb" ), theURI, qml ) ||
|
||||
@ -574,7 +574,7 @@ QString QgsMapLayer::saveNamedStyle ( const QString theURI, bool & theResultFlag
|
||||
QFileInfo myFileInfo ( theURI );
|
||||
if ( myFileInfo.exists() || theURI.endsWith(".qml", Qt::CaseInsensitive) )
|
||||
{
|
||||
QFileInfo myDirInfo ( myFileInfo.path() ); //excludes filename
|
||||
QFileInfo myDirInfo ( myFileInfo.path() ); //excludes fileName
|
||||
if ( !myDirInfo.isWritable() )
|
||||
{
|
||||
return QObject::tr( "The directory containing your dataset needs to be writeable!" );
|
||||
|
@ -402,12 +402,12 @@ QgsProject * QgsProject::theProject_;
|
||||
|
||||
|
||||
|
||||
void QgsProject::setFilename(QString const &name)
|
||||
void QgsProject::setFileName(QString const &name)
|
||||
{
|
||||
imp_->file.setFileName(name);
|
||||
|
||||
dirty(true);
|
||||
} // void QgsProject::setFilename( QString const & name )
|
||||
} // void QgsProject::setFileName( QString const & name )
|
||||
|
||||
|
||||
|
||||
@ -608,7 +608,7 @@ static QgsProjectVersion _getVersion(QDomDocument const &doc)
|
||||
@note XML of form:
|
||||
|
||||
<maplayer type="vector">
|
||||
<layername>Hydrop</layername>
|
||||
<layerName>Hydrop</layerName>
|
||||
<datasource>/data/usgs/city_shp/hydrop.shp</datasource>
|
||||
<zorder>0</zorder>
|
||||
<provider>ogr</provider>
|
||||
|
@ -92,7 +92,7 @@ public:
|
||||
Every project has an associated file that contains its XML
|
||||
*/
|
||||
//@{
|
||||
void setFilename( QString const & name );
|
||||
void setFileName( QString const & name );
|
||||
|
||||
/** returns file name */
|
||||
QString fileName() const;
|
||||
|
@ -254,7 +254,7 @@ void QgsRasterLayer::registerGdalDrivers()
|
||||
}
|
||||
|
||||
|
||||
/** This helper checks to see whether the filename appears to be a valid raster file name */
|
||||
/** This helper checks to see whether the fileName appears to be a valid raster file name */
|
||||
bool QgsRasterLayer::isValidRasterFileName(QString const & theFileNameQString,
|
||||
QString & retErrMsg )
|
||||
{
|
||||
@ -2959,7 +2959,7 @@ QPixmap QgsRasterLayer::getLegendQPixmap(bool theWithNameFlag)
|
||||
myQPainter.drawPixmap(0,myHeight-myNoPyramidPixmap.height(),myNoPyramidPixmap);
|
||||
}
|
||||
//
|
||||
// Overlay the layername
|
||||
// Overlay the layerName
|
||||
//
|
||||
if (drawingStyle == MULTI_BAND_SINGLE_BAND_GRAY || drawingStyle == PALETTED_SINGLE_BAND_GRAY || drawingStyle == SINGLE_BAND_GRAY)
|
||||
{
|
||||
@ -3187,7 +3187,7 @@ QPixmap QgsRasterLayer::getDetailedLegendQPixmap(int theLabelCount=3)
|
||||
QPixmap myQPixmap2 = myLegendQPixmap.transformed(myQWMatrix);
|
||||
QPainter myQPainter2(&myQPixmap2);
|
||||
//
|
||||
// Overlay the layername
|
||||
// Overlay the layerName
|
||||
//
|
||||
if (drawingStyle == MULTI_BAND_SINGLE_BAND_GRAY || drawingStyle == PALETTED_SINGLE_BAND_GRAY || drawingStyle == SINGLE_BAND_GRAY)
|
||||
{
|
||||
@ -4004,7 +4004,7 @@ double QgsRasterLayer::readValue ( void *data, GDALDataType type, int index )
|
||||
Raster layer project file XML of form:
|
||||
|
||||
<maplayer type="raster" visible="1" showInOverviewFlag="1">
|
||||
<layername>Wynoochee_dem</layername>
|
||||
<layerName>Wynoochee_dem</layerName>
|
||||
<datasource>/home/mcoletti/mnt/MCOLETTIF8F9/c/Toolkit_Course/Answers/Training_Data/wynoochee_dem.img</datasource>
|
||||
<zorder>0</zorder>
|
||||
<transparencyLevelInt>255</transparencyLevelInt>
|
||||
|
@ -181,8 +181,8 @@ public:
|
||||
static void buildSupportedRasterFileFilter(QString & fileFilters);
|
||||
static void registerGdalDrivers();
|
||||
|
||||
/** This helper checks to see whether the filename appears to be a valid
|
||||
raster file name. If the filename looks like it could be valid,
|
||||
/** This helper checks to see whether the fileName appears to be a valid
|
||||
raster file name. If the fileName looks like it could be valid,
|
||||
but some sort of error occurs in processing the file, the error is
|
||||
returned in retError. */
|
||||
static bool isValidRasterFileName(const QString & theFileNameQString,
|
||||
|
@ -701,11 +701,11 @@ typedef struct sqlite3_mutex sqlite3_mutex;
|
||||
** The zName field holds the name of the VFS module. The name must
|
||||
** be unique across all VFS modules.
|
||||
**
|
||||
** {F11141} SQLite will guarantee that the zFilename string passed to
|
||||
** {F11141} SQLite will guarantee that the zFileName string passed to
|
||||
** xOpen() is a full pathname as generated by xFullPathname() and
|
||||
** that the string will be valid and unchanged until xClose() is
|
||||
** called. {END} So the [sqlite3_file] can store a pointer to the
|
||||
** filename if it needs to remember the filename for some reason.
|
||||
** fileName if it needs to remember the fileName for some reason.
|
||||
**
|
||||
** {F11142} The flags argument to xOpen() includes all bits set in
|
||||
** the flags argument to [sqlite3_open_v2()]. Or if [sqlite3_open()]
|
||||
@ -797,7 +797,7 @@ struct sqlite3_vfs {
|
||||
int (*xAccess)(sqlite3_vfs*, const char *zName, int flags);
|
||||
int (*xGetTempname)(sqlite3_vfs*, int nOut, char *zOut);
|
||||
int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
|
||||
void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
|
||||
void *(*xDlOpen)(sqlite3_vfs*, const char *zFileName);
|
||||
void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
|
||||
void *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol);
|
||||
void (*xDlClose)(sqlite3_vfs*, void*);
|
||||
@ -1495,8 +1495,8 @@ char *sqlite3_snprintf(int,char*,const char*, ...);
|
||||
**
|
||||
** The windows OS interface layer calls
|
||||
** the system malloc() and free() directly when converting
|
||||
** filenames between the UTF-8 encoding used by SQLite
|
||||
** and whatever filename encoding is used by the particular windows
|
||||
** fileNames between the UTF-8 encoding used by SQLite
|
||||
** and whatever fileName encoding is used by the particular windows
|
||||
** installation. Memory allocation errors are detected, but
|
||||
** they are reported back as [SQLITE_CANTOPEN] or
|
||||
** [SQLITE_IOERR] rather than [SQLITE_NOMEM].
|
||||
@ -1783,7 +1783,7 @@ int sqlite3_set_authorizer(
|
||||
#define SQLITE_SELECT 21 /* NULL NULL */
|
||||
#define SQLITE_TRANSACTION 22 /* NULL NULL */
|
||||
#define SQLITE_UPDATE 23 /* Table Name Column Name */
|
||||
#define SQLITE_ATTACH 24 /* Filename NULL */
|
||||
#define SQLITE_ATTACH 24 /* FileName NULL */
|
||||
#define SQLITE_DETACH 25 /* Database Name NULL */
|
||||
#define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */
|
||||
#define SQLITE_REINDEX 27 /* Index Name NULL */
|
||||
@ -1908,8 +1908,8 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
||||
** CAPI3REF: Opening A New Database Connection {F12700}
|
||||
**
|
||||
** These routines open an SQLite database file whose name
|
||||
** is given by the filename argument.
|
||||
** The filename argument is interpreted as UTF-8
|
||||
** is given by the fileName argument.
|
||||
** The fileName argument is interpreted as UTF-8
|
||||
** for [sqlite3_open()] and [sqlite3_open_v2()] and as UTF-16
|
||||
** in the native byte order for [sqlite3_open16()].
|
||||
** An [sqlite3*] handle is usually returned in *ppDb, even
|
||||
@ -1952,16 +1952,16 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
||||
** The third options is behavior that is always used for [sqlite3_open()]
|
||||
** and [sqlite3_open16()].
|
||||
**
|
||||
** If the filename is ":memory:", then an private
|
||||
** If the fileName is ":memory:", then an private
|
||||
** in-memory database is created for the connection. This in-memory
|
||||
** database will vanish when the database connection is closed. Future
|
||||
** version of SQLite might make use of additional special filenames
|
||||
** version of SQLite might make use of additional special fileNames
|
||||
** that begin with the ":" character. It is recommended that
|
||||
** when a database filename really does begin with
|
||||
** ":" that you prefix the filename with a pathname like "./" to
|
||||
** when a database fileName really does begin with
|
||||
** ":" that you prefix the fileName with a pathname like "./" to
|
||||
** avoid ambiguity.
|
||||
**
|
||||
** If the filename is an empty string, then a private temporary
|
||||
** If the fileName is an empty string, then a private temporary
|
||||
** on-disk database will be created. This private database will be
|
||||
** automatically deleted as soon as the database connection is closed.
|
||||
**
|
||||
@ -1971,9 +1971,9 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
||||
** fourth parameter is a NULL pointer then the default [sqlite3_vfs]
|
||||
** object is used.
|
||||
**
|
||||
** <b>Note to windows users:</b> The encoding used for the filename argument
|
||||
** <b>Note to windows users:</b> The encoding used for the fileName argument
|
||||
** of [sqlite3_open()] and [sqlite3_open_v2()] must be UTF-8, not whatever
|
||||
** codepage is currently defined. Filenames containing international
|
||||
** codepage is currently defined. FileNames containing international
|
||||
** characters must be converted to UTF-8 prior to passing them into
|
||||
** [sqlite3_open()] or [sqlite3_open_v2()].
|
||||
**
|
||||
@ -1984,7 +1984,7 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
||||
** [database connection] associated with
|
||||
** the database file given in their first parameter.
|
||||
**
|
||||
** {F12702} The filename argument is interpreted as UTF-8
|
||||
** {F12702} The fileName argument is interpreted as UTF-8
|
||||
** for [sqlite3_open()] and [sqlite3_open_v2()] and as UTF-16
|
||||
** in the native byte order for [sqlite3_open16()].
|
||||
**
|
||||
@ -2024,13 +2024,13 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
||||
** previously exist, then an attempt is made to create and
|
||||
** initialize the database.
|
||||
**
|
||||
** {F12717} If the filename argument to [sqlite3_open()], [sqlite3_open16()],
|
||||
** {F12717} If the fileName argument to [sqlite3_open()], [sqlite3_open16()],
|
||||
** or [sqlite3_open_v2()] is ":memory:", then an private,
|
||||
** ephemeral, in-memory database is created for the connection.
|
||||
** <todo>Is SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE required
|
||||
** in sqlite3_open_v2()?</todo>
|
||||
**
|
||||
** {F12719} If the filename is an empty string, then a private, ephermeral
|
||||
** {F12719} If the fileName is an empty string, then a private, ephermeral
|
||||
** on-disk database will be created.
|
||||
** <todo>Is SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE required
|
||||
** in sqlite3_open_v2()?</todo>
|
||||
@ -2041,15 +2041,15 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
||||
** the default [sqlite3_vfs] object is V is a NULL pointer.
|
||||
*/
|
||||
int sqlite3_open(
|
||||
const char *filename, /* Database filename (UTF-8) */
|
||||
const char *fileName, /* Database fileName (UTF-8) */
|
||||
sqlite3 **ppDb /* OUT: SQLite db handle */
|
||||
);
|
||||
int sqlite3_open16(
|
||||
const void *filename, /* Database filename (UTF-16) */
|
||||
const void *fileName, /* Database fileName (UTF-16) */
|
||||
sqlite3 **ppDb /* OUT: SQLite db handle */
|
||||
);
|
||||
int sqlite3_open_v2(
|
||||
const char *filename, /* Database filename (UTF-8) */
|
||||
const char *fileName, /* Database fileName (UTF-8) */
|
||||
sqlite3 **ppDb, /* OUT: SQLite db handle */
|
||||
int flags, /* Flags */
|
||||
const char *zVfs /* Name of VFS module to use */
|
||||
|
@ -182,10 +182,10 @@ QPicture QgsMarkerCatalogue::pictureMarker ( QString fullName, double size, QPen
|
||||
return QPicture(); // empty
|
||||
}
|
||||
|
||||
void QgsMarkerCatalogue::svgMarker ( QPainter * thepPainter, QString filename, double scaleFactor)
|
||||
void QgsMarkerCatalogue::svgMarker ( QPainter * thepPainter, QString fileName, double scaleFactor)
|
||||
{
|
||||
QSvgRenderer mySVG;
|
||||
mySVG.load(filename);
|
||||
mySVG.load(fileName);
|
||||
mySVG.render(thepPainter);
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
*/
|
||||
QPicture pictureMarker (QString fullName, double size, QPen pen, QBrush brush, bool qtBug = true );
|
||||
|
||||
/** Returns a pixmap given a filename of a svg marker
|
||||
/** Returns a pixmap given a fileName of a svg marker
|
||||
* NOTE: this method needs to be public static for QgsMarkerDialog::visualizeMarkers */
|
||||
static void svgMarker (QPainter * thepPainter, QString name, double size );
|
||||
private:
|
||||
|
@ -122,7 +122,7 @@ void QgsQuickPrint::printMap()
|
||||
{
|
||||
return;
|
||||
}
|
||||
//ensure the user never ommitted the extension from the filename
|
||||
//ensure the user never ommitted the extension from the fileName
|
||||
if ( !mOutputFileName.toUpper().endsWith ( ".PDF" ) )
|
||||
{
|
||||
mOutputFileName += ".pdf";
|
||||
|
@ -119,7 +119,7 @@ void dxf2shpConverterGui::on_buttonBox_helpRequested()
|
||||
{
|
||||
QString s = tr("Fields description:\n"
|
||||
"* Input DXF file: path to the DXF file to be converted\n"
|
||||
"* Output Shp file: desired filename of the ShapeFile to be created\n"
|
||||
"* Output Shp file: desired fileName of the ShapeFile to be created\n"
|
||||
"* Shp output file type: specifies the type of the output shapefile\n"
|
||||
"* Export text labels checkbox: if checked, an additional shp points layer will be created, "
|
||||
" and the associated dbf table will contain informations about the \"TEXT\" fields found"
|
||||
@ -159,7 +159,7 @@ void dxf2shpConverterGui::getInputFileName()
|
||||
void dxf2shpConverterGui::getOutputDir()
|
||||
{
|
||||
QString s = QFileDialog::getSaveFileName(this,
|
||||
tr("Choose a filename to save to"),
|
||||
tr("Choose a fileName to save to"),
|
||||
"output.shp",
|
||||
"Shapefile (*.shp)");
|
||||
|
||||
|
@ -354,9 +354,9 @@ void SHPAPI_CALL
|
||||
SHPDestroyTree( SHPTree * hTree );
|
||||
|
||||
int SHPAPI_CALL
|
||||
SHPWriteTree( SHPTree *hTree, const char * pszFilename );
|
||||
SHPWriteTree( SHPTree *hTree, const char * pszFileName );
|
||||
SHPTree SHPAPI_CALL
|
||||
SHPReadTree( const char * pszFilename );
|
||||
SHPReadTree( const char * pszFileName );
|
||||
|
||||
int SHPAPI_CALL
|
||||
SHPTreeAddObject( SHPTree * hTree, SHPObject * psObject );
|
||||
@ -470,7 +470,7 @@ int SHPAPI_CALL
|
||||
DBFWriteTuple(DBFHandle psDBF, int hEntity, void * pRawTuple );
|
||||
|
||||
DBFHandle SHPAPI_CALL
|
||||
DBFCloneEmpty(DBFHandle psDBF, const char * pszFilename );
|
||||
DBFCloneEmpty(DBFHandle psDBF, const char * pszFileName );
|
||||
|
||||
void SHPAPI_CALL
|
||||
DBFClose( DBFHandle hDBF );
|
||||
|
@ -80,17 +80,17 @@ void QgsGeorefPluginGui::on_pbnSelectRaster_clicked() {
|
||||
QString dir = settings.value("/Plugin-GeoReferencer/rasterdirectory").toString();
|
||||
if (dir.isEmpty())
|
||||
dir = ".";
|
||||
QString filename =
|
||||
QString fileName =
|
||||
QFileDialog::getOpenFileName(this,
|
||||
tr("Choose a raster file"),
|
||||
dir,
|
||||
tr("Raster files (*.*)"));
|
||||
|
||||
if(filename.isNull())
|
||||
if(fileName.isNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
leSelectRaster->setText(filename);
|
||||
leSelectRaster->setText(fileName);
|
||||
|
||||
// do we think that this is a valid raster?
|
||||
if (!QgsRasterLayer::isValidRasterFileName(leSelectRaster->text())) {
|
||||
@ -149,7 +149,7 @@ void QgsGeorefPluginGui::on_pbnSelectRaster_clicked() {
|
||||
prj->writeEntry("SpatialRefSys", "/ProjectCRSID", mProjectCRSID);
|
||||
}
|
||||
|
||||
mPointDialog->openImageFile(filename);
|
||||
mPointDialog->openImageFile(fileName);
|
||||
mPointDialog->show();
|
||||
}
|
||||
|
||||
|
@ -186,20 +186,20 @@ void QgsPointDialog::on_pbnGenerateAndLoad_clicked()
|
||||
|
||||
void QgsPointDialog::on_pbnSelectWorldFile_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(this,
|
||||
QString fileName = QFileDialog::getSaveFileName(this,
|
||||
tr("Choose a name for the world file"), ".");
|
||||
leSelectWorldFile->setText(filename);
|
||||
leSelectWorldFile->setText(fileName);
|
||||
}
|
||||
|
||||
|
||||
void QgsPointDialog::on_pbnSelectModifiedRaster_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(this,
|
||||
QString fileName = QFileDialog::getSaveFileName(this,
|
||||
tr("Choose a name for the world file"), ".");
|
||||
if (filename.right(4) != ".tif")
|
||||
filename += ".tif";
|
||||
leSelectModifiedRaster->setText(filename);
|
||||
leSelectWorldFile->setText(guessWorldFileName(filename));
|
||||
if (fileName.right(4) != ".tif")
|
||||
fileName += ".tif";
|
||||
leSelectModifiedRaster->setText(fileName);
|
||||
leSelectWorldFile->setText(guessWorldFileName(fileName));
|
||||
}
|
||||
|
||||
void QgsPointDialog::on_cmbTransformType_currentIndexChanged(const QString& value)
|
||||
@ -210,20 +210,20 @@ void QgsPointDialog::on_cmbTransformType_currentIndexChanged(const QString& valu
|
||||
// Make up a modified raster field name based on the layer file name
|
||||
if(mLayer)
|
||||
{
|
||||
QString filename(mLayer->source());
|
||||
QString fileName(mLayer->source());
|
||||
QFileInfo file(mLayer->source());
|
||||
int pos = filename.size()-file.suffix().size()-1;
|
||||
filename.insert(pos, tr("-modified", "Georeferencer:QgsPointDialog.cpp - used to modify a user given filename"));
|
||||
pos = filename.size()-file.suffix().size();
|
||||
filename.replace(pos, filename.size(), "tif");
|
||||
int pos = fileName.size()-file.suffix().size()-1;
|
||||
fileName.insert(pos, tr("-modified", "Georeferencer:QgsPointDialog.cpp - used to modify a user given fileName"));
|
||||
pos = fileName.size()-file.suffix().size();
|
||||
fileName.replace(pos, fileName.size(), "tif");
|
||||
|
||||
leSelectModifiedRaster->setText(filename);
|
||||
leSelectWorldFile->setText(guessWorldFileName(filename));
|
||||
leSelectModifiedRaster->setText(fileName);
|
||||
leSelectWorldFile->setText(guessWorldFileName(fileName));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Reset to the default filenames
|
||||
// Reset to the default fileNames
|
||||
leSelectModifiedRaster->setText("");
|
||||
enableModifiedRasterControls(false);
|
||||
if(mLayer)
|
||||
|
@ -195,11 +195,11 @@ void QgsGPSPlugin::unload()
|
||||
delete mQActionPointer;
|
||||
}
|
||||
|
||||
void QgsGPSPlugin::loadGPXFile(QString filename, bool loadWaypoints, bool loadRoutes,
|
||||
void QgsGPSPlugin::loadGPXFile(QString fileName, bool loadWaypoints, bool loadRoutes,
|
||||
bool loadTracks) {
|
||||
|
||||
//check if input file is readable
|
||||
QFileInfo fileInfo(filename);
|
||||
QFileInfo fileInfo(fileName);
|
||||
if (!fileInfo.isReadable()) {
|
||||
QMessageBox::warning(NULL, tr("GPX Loader"),
|
||||
tr("Unable to read the selected file.\n")+
|
||||
@ -213,22 +213,22 @@ void QgsGPSPlugin::loadGPXFile(QString filename, bool loadWaypoints, bool loadRo
|
||||
|
||||
// add the requested layers
|
||||
if (loadTracks)
|
||||
emit drawVectorLayer(filename + "?type=track",
|
||||
emit drawVectorLayer(fileName + "?type=track",
|
||||
fileInfo.baseName() + ", tracks", "gpx");
|
||||
if (loadRoutes)
|
||||
emit drawVectorLayer(filename + "?type=route",
|
||||
emit drawVectorLayer(fileName + "?type=route",
|
||||
fileInfo.baseName() + ", routes", "gpx");
|
||||
if (loadWaypoints)
|
||||
emit drawVectorLayer(filename + "?type=waypoint",
|
||||
emit drawVectorLayer(fileName + "?type=waypoint",
|
||||
fileInfo.baseName() + ", waypoints", "gpx");
|
||||
|
||||
emit closeGui();
|
||||
}
|
||||
|
||||
|
||||
void QgsGPSPlugin::importGPSFile(QString inputFilename, QgsBabelFormat* importer,
|
||||
void QgsGPSPlugin::importGPSFile(QString inputFileName, QgsBabelFormat* importer,
|
||||
bool importWaypoints, bool importRoutes,
|
||||
bool importTracks, QString outputFilename,
|
||||
bool importTracks, QString outputFileName,
|
||||
QString layerName) {
|
||||
|
||||
// what features does the user want to import?
|
||||
@ -243,7 +243,7 @@ void QgsGPSPlugin::importGPSFile(QString inputFilename, QgsBabelFormat* importer
|
||||
// try to start the gpsbabel process
|
||||
QStringList babelArgs =
|
||||
importer->importCommand(mBabelPath, typeArg,
|
||||
inputFilename, outputFilename);
|
||||
inputFileName, outputFileName);
|
||||
|
||||
QgsDebugMsg(QString("Import command: ") + babelArgs.join("|"));
|
||||
|
||||
@ -268,7 +268,7 @@ void QgsGPSPlugin::importGPSFile(QString inputFilename, QgsBabelFormat* importer
|
||||
if (babelProcess.exitStatus() != 0) {
|
||||
QString babelError(babelProcess.readAllStandardError());
|
||||
QString errorMsg(tr("Could not import data from %1!\n\n")
|
||||
.arg(inputFilename));
|
||||
.arg(inputFileName));
|
||||
errorMsg += babelError;
|
||||
QMessageBox::warning(NULL, tr("Error importing data"), errorMsg);
|
||||
return;
|
||||
@ -276,22 +276,22 @@ void QgsGPSPlugin::importGPSFile(QString inputFilename, QgsBabelFormat* importer
|
||||
|
||||
// add the layer
|
||||
if (importTracks)
|
||||
emit drawVectorLayer(outputFilename + "?type=track",
|
||||
emit drawVectorLayer(outputFileName + "?type=track",
|
||||
layerName, "gpx");
|
||||
if (importRoutes)
|
||||
emit drawVectorLayer(outputFilename + "?type=route",
|
||||
emit drawVectorLayer(outputFileName + "?type=route",
|
||||
layerName, "gpx");
|
||||
if (importWaypoints)
|
||||
emit drawVectorLayer(outputFilename + "?type=waypoint",
|
||||
emit drawVectorLayer(outputFileName + "?type=waypoint",
|
||||
layerName, "gpx");
|
||||
|
||||
emit closeGui();
|
||||
}
|
||||
|
||||
|
||||
void QgsGPSPlugin::convertGPSFile(QString inputFilename,
|
||||
void QgsGPSPlugin::convertGPSFile(QString inputFileName,
|
||||
int convertType,
|
||||
QString outputFilename,
|
||||
QString outputFileName,
|
||||
QString layerName) {
|
||||
|
||||
// what features does the user want to import?
|
||||
@ -311,8 +311,8 @@ void QgsGPSPlugin::convertGPSFile(QString inputFilename,
|
||||
|
||||
// try to start the gpsbabel process
|
||||
QStringList babelArgs;
|
||||
babelArgs << mBabelPath << "-i"<<"gpx"<<"-f"<< inputFilename
|
||||
<< convertStrings <<"-o"<<"gpx"<<"-F"<< outputFilename;
|
||||
babelArgs << mBabelPath << "-i"<<"gpx"<<"-f"<< inputFileName
|
||||
<< convertStrings <<"-o"<<"gpx"<<"-F"<< outputFileName;
|
||||
QgsDebugMsg(QString("Conversion command: ") + babelArgs.join("|"));
|
||||
|
||||
QProcess babelProcess;
|
||||
@ -336,7 +336,7 @@ void QgsGPSPlugin::convertGPSFile(QString inputFilename,
|
||||
if (babelProcess.exitStatus() != 0) {
|
||||
QString babelError(babelProcess.readAllStandardError());
|
||||
QString errorMsg(tr("Could not convert data from %1!\n\n")
|
||||
.arg(inputFilename));
|
||||
.arg(inputFileName));
|
||||
errorMsg += babelError;
|
||||
QMessageBox::warning(NULL, tr("Error converting data"), errorMsg);
|
||||
return;
|
||||
@ -346,11 +346,11 @@ void QgsGPSPlugin::convertGPSFile(QString inputFilename,
|
||||
switch ( convertType )
|
||||
{
|
||||
case 0:
|
||||
emit drawVectorLayer(outputFilename + "?type=waypoint",
|
||||
emit drawVectorLayer(outputFileName + "?type=waypoint",
|
||||
layerName, "gpx");
|
||||
break;
|
||||
case 1:
|
||||
emit drawVectorLayer(outputFilename + "?type=route",
|
||||
emit drawVectorLayer(outputFileName + "?type=route",
|
||||
layerName, "gpx");
|
||||
break;
|
||||
default:
|
||||
@ -363,7 +363,7 @@ void QgsGPSPlugin::convertGPSFile(QString inputFilename,
|
||||
|
||||
void QgsGPSPlugin::downloadFromGPS(QString device, QString port,
|
||||
bool downloadWaypoints, bool downloadRoutes,
|
||||
bool downloadTracks, QString outputFilename,
|
||||
bool downloadTracks, QString outputFileName,
|
||||
QString layerName) {
|
||||
|
||||
// what does the user want to download?
|
||||
@ -384,7 +384,7 @@ void QgsGPSPlugin::downloadFromGPS(QString device, QString port,
|
||||
// try to start the gpsbabel process
|
||||
QStringList babelArgs =
|
||||
mDevices[device]->importCommand(mBabelPath, typeArg,
|
||||
port, outputFilename);
|
||||
port, outputFileName);
|
||||
if (babelArgs.isEmpty()) {
|
||||
QMessageBox::warning(NULL, tr("Not supported"),
|
||||
QString(tr("This device does not support downloading ") +
|
||||
@ -423,13 +423,13 @@ void QgsGPSPlugin::downloadFromGPS(QString device, QString port,
|
||||
|
||||
// add the layer
|
||||
if (downloadWaypoints)
|
||||
emit drawVectorLayer(outputFilename + "?type=waypoint",
|
||||
emit drawVectorLayer(outputFileName + "?type=waypoint",
|
||||
layerName, "gpx");
|
||||
if (downloadRoutes)
|
||||
emit drawVectorLayer(outputFilename + "?type=route",
|
||||
emit drawVectorLayer(outputFileName + "?type=route",
|
||||
layerName, "gpx");
|
||||
if (downloadTracks)
|
||||
emit drawVectorLayer(outputFilename + "?type=track",
|
||||
emit drawVectorLayer(outputFileName + "?type=track",
|
||||
layerName, "gpx");
|
||||
|
||||
// everything was OK, remember the device and port for next time
|
||||
|
@ -57,19 +57,19 @@ public slots:
|
||||
void help();
|
||||
|
||||
//! load a GPX file
|
||||
void loadGPXFile(QString filename, bool loadWaypoints, bool loadRoutes,
|
||||
void loadGPXFile(QString fileName, bool loadWaypoints, bool loadRoutes,
|
||||
bool loadTracks);
|
||||
void importGPSFile(QString inputFilename, QgsBabelFormat* importer,
|
||||
void importGPSFile(QString inputFileName, QgsBabelFormat* importer,
|
||||
bool importWaypoints, bool importRoutes,
|
||||
bool importTracks, QString outputFilename,
|
||||
bool importTracks, QString outputFileName,
|
||||
QString layerName);
|
||||
void convertGPSFile(QString inputFilename,
|
||||
void convertGPSFile(QString inputFileName,
|
||||
int convertType,
|
||||
QString outputFilename,
|
||||
QString outputFileName,
|
||||
QString layerName);
|
||||
void downloadFromGPS(QString device, QString port,
|
||||
bool downloadWaypoints, bool downloadRoutes,
|
||||
bool downloadTracks, QString outputFilename,
|
||||
bool downloadTracks, QString outputFileName,
|
||||
QString layerName);
|
||||
void uploadToGPS(QgsVectorLayer* gpxLayer, QString device,
|
||||
QString port);
|
||||
|
@ -143,7 +143,7 @@ void QgsGPSPluginGui::on_pbnDLOutput_clicked()
|
||||
{
|
||||
QString myFileNameQString =
|
||||
QFileDialog::getSaveFileName(this, //parent dialog
|
||||
tr("Choose a filename to save under"),
|
||||
tr("Choose a fileName to save under"),
|
||||
"." , //initial dir
|
||||
tr("GPS eXchange format (*.gpx)"));
|
||||
if (!myFileNameQString.isEmpty())
|
||||
@ -278,7 +278,7 @@ void QgsGPSPluginGui::on_pbnIMPInput_clicked() {
|
||||
void QgsGPSPluginGui::on_pbnIMPOutput_clicked() {
|
||||
QString myFileNameQString =
|
||||
QFileDialog::getSaveFileName(this, //parent dialog
|
||||
tr("Choose a filename to save under"),
|
||||
tr("Choose a fileName to save under"),
|
||||
".", //initial dir
|
||||
tr("GPS eXchange format (*.gpx)"));
|
||||
if (!myFileNameQString.isEmpty())
|
||||
@ -480,7 +480,7 @@ void QgsGPSPluginGui::populateIMPDialog() {
|
||||
QString sentence1 = tr("QGIS can only load GPX files by itself, but many other formats can be converted to GPX using GPSBabel (%1).")
|
||||
.arg("<a href=\"http://www.gpsbabel.org\">http://www.gpsbabel.org</a>");
|
||||
QString sentence2 = tr("This requires that you have GPSBabel installed where QGIS can find it.");
|
||||
QString sentence3 = tr("Select a GPS file format and the file that you want to import, the feature type that you want to use, a GPX filename that you want to save the converted file as, and a name for the new layer.");
|
||||
QString sentence3 = tr("Select a GPS file format and the file that you want to import, the feature type that you want to use, a GPX fileName that you want to save the converted file as, and a name for the new layer.");
|
||||
QString sentence4 = tr("All file formats can not store waypoints, routes, and tracks, so some feature types may be disabled for some file formats.");
|
||||
|
||||
QString text = format.arg(sentence1).arg(sentence2).arg(sentence3).arg(sentence4);
|
||||
@ -499,7 +499,7 @@ void QgsGPSPluginGui::populateCONVDialog() {
|
||||
QString sentence1 = tr("QGIS can perform conversions of GPX files, by using GPSBabel (%1) to perform the conversions.")
|
||||
.arg("<a href=\"http://www.gpsbabel.org\">http://www.gpsbabel.org</a>");
|
||||
QString sentence2 = tr("This requires that you have GPSBabel installed where QGIS can find it.");
|
||||
QString sentence3 = tr("Select a GPX input file name, the type of conversion you want to perform, a GPX filename that you want to save the converted file as, and a name for the new layer created from the result.");
|
||||
QString sentence3 = tr("Select a GPX input file name, the type of conversion you want to perform, a GPX fileName that you want to save the converted file as, and a name for the new layer created from the result.");
|
||||
|
||||
QString text = format.arg(sentence1).arg(sentence2).arg(sentence3);
|
||||
|
||||
@ -528,7 +528,7 @@ void QgsGPSPluginGui::on_pbnCONVInput_clicked()
|
||||
void QgsGPSPluginGui::on_pbnCONVOutput_clicked() {
|
||||
QString myFileNameQString =
|
||||
QFileDialog::getSaveFileName(this, //parent dialog
|
||||
tr("Choose a filename to save under"),
|
||||
tr("Choose a fileName to save under"),
|
||||
".", //initial dir
|
||||
tr("GPS eXchange format (*.gpx)"));
|
||||
if (!myFileNameQString.isEmpty())
|
||||
|
@ -79,19 +79,19 @@ private slots:
|
||||
signals:
|
||||
void drawRasterLayer(QString);
|
||||
void drawVectorLayer(QString,QString,QString);
|
||||
void loadGPXFile(QString filename, bool showWaypoints, bool showRoutes,
|
||||
void loadGPXFile(QString fileName, bool showWaypoints, bool showRoutes,
|
||||
bool showTracks);
|
||||
void importGPSFile(QString inputFilename, QgsBabelFormat* importer,
|
||||
void importGPSFile(QString inputFileName, QgsBabelFormat* importer,
|
||||
bool importWaypoints, bool importRoutes,
|
||||
bool importTracks, QString outputFilename,
|
||||
bool importTracks, QString outputFileName,
|
||||
QString layerName);
|
||||
void convertGPSFile(QString inputFilename,
|
||||
void convertGPSFile(QString inputFileName,
|
||||
int convertType,
|
||||
QString outputFilename,
|
||||
QString outputFileName,
|
||||
QString layerName);
|
||||
void downloadFromGPS(QString device, QString port, bool downloadWaypoints,
|
||||
bool downloadRoutes, bool downloadTracks,
|
||||
QString outputFilename, QString layerName);
|
||||
QString outputFileName, QString layerName);
|
||||
void uploadToGPS(QgsVectorLayer* gpxLayer, QString device, QString port);
|
||||
|
||||
private:
|
||||
|
@ -89,9 +89,9 @@ void QgsGridMakerPluginGui::on_buttonBox_accepted()
|
||||
//
|
||||
// If you have a produced a raster layer using your plugin, you can ask qgis to
|
||||
// add it to the view using:
|
||||
// emit drawRasterLayer(QString("layername"));
|
||||
// emit drawRasterLayer(QString("layerName"));
|
||||
// or for a vector layer
|
||||
//emit drawVectorLayer(QString("pathname"),QString("layername"),QString("provider name (either ogr or postgres"));
|
||||
//emit drawVectorLayer(QString("pathname"),QString("layerName"),QString("provider name (either ogr or postgres"));
|
||||
//
|
||||
|
||||
emit drawVectorLayer(leOutputShapeFile->text(),QString("Graticule"),QString("ogr"));
|
||||
@ -105,7 +105,7 @@ void QgsGridMakerPluginGui::on_pbnSelectOutputFile_clicked()
|
||||
QgsLogger::debug(" Gps File Importer Gui::pbnSelectOutputFile_clicked()");
|
||||
QString myOutputFileNameQString = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Choose a filename to save under"),
|
||||
tr("Choose a fileName to save under"),
|
||||
".",
|
||||
tr("ESRI Shapefile (*.shp)"));
|
||||
|
||||
|
@ -97,9 +97,9 @@ class DualEdgeTriangulation: public Triangulation
|
||||
/**Returns true, if the point with coordinates x and y is inside the convex hull and false otherwise*/
|
||||
bool pointInside(double x, double y);
|
||||
/**Reads the dual edge structure of a taff file*/
|
||||
//bool readFromTAFF(QString filename);
|
||||
//bool readFromTAFF(QString fileName);
|
||||
/**Saves the dual edge structure to a taff file*/
|
||||
//bool saveToTAFF(QString filename) const;
|
||||
//bool saveToTAFF(QString fileName) const;
|
||||
/**Swaps the edge which is closest to the point with x and y coordinates (if this is possible)*/
|
||||
virtual bool swapEdge(double x, double y);
|
||||
/**Returns a value list with the numbers of the four points, which would be affected by an edge swap. This function is e.g. needed by NormVecDecorator to know the points, for which the normals have to be recalculated. The returned ValueList has to be deleted by the code which calls the method*/
|
||||
|
@ -83,9 +83,9 @@ class Triangulation
|
||||
/**Returns true, if the point with coordinates x and y is inside the convex hull and false otherwise*/
|
||||
virtual bool pointInside(double x, double y)=0;
|
||||
/**Reads the content of a taff-file*/
|
||||
//virtual bool readFromTAFF(QString filename)=0;
|
||||
//virtual bool readFromTAFF(QString fileName)=0;
|
||||
/**Saves the content to a taff file*/
|
||||
//virtual bool saveToTAFF(QString filename) const=0;
|
||||
//virtual bool saveToTAFF(QString fileName) const=0;
|
||||
/**Swaps the edge which is closest to the point with x and y coordinates (if this is possible)*/
|
||||
virtual bool swapEdge(double x, double y)=0;
|
||||
};
|
||||
|
@ -67,9 +67,9 @@ void QgsInterpolationDialog::on_buttonBox_accepted()
|
||||
return;
|
||||
}
|
||||
|
||||
//read filename
|
||||
QString filename = mOutputFileLineEdit->text();
|
||||
QFileInfo theFileInfo(filename);
|
||||
//read fileName
|
||||
QString fileName = mOutputFileLineEdit->text();
|
||||
QFileInfo theFileInfo(fileName);
|
||||
if(!theFileInfo.dir().exists())
|
||||
{
|
||||
QMessageBox::information(0, "File name invalid", "Please enter a valid file name");
|
||||
@ -111,10 +111,10 @@ void QgsInterpolationDialog::on_buttonBox_accepted()
|
||||
}
|
||||
|
||||
//create grid file writer
|
||||
QgsGridFileWriter theWriter(theInterpolator, filename, theVectorLayer->extent(), mNumberOfColumnsSpinBox->value(), mNumberOfRowsSpinBox->value());
|
||||
QgsGridFileWriter theWriter(theInterpolator, fileName, theVectorLayer->extent(), mNumberOfColumnsSpinBox->value(), mNumberOfRowsSpinBox->value());
|
||||
if(theWriter.writeFile(true) == 0)
|
||||
{
|
||||
mIface->addRasterLayer(filename, "Interpolation");
|
||||
mIface->addRasterLayer(fileName, "Interpolation");
|
||||
accept();
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ void QuickPrintGui::on_buttonBox_accepted()
|
||||
myFileDialog->setFileMode ( QFileDialog::AnyFile );
|
||||
myFileDialog->setAcceptMode ( QFileDialog::AcceptSave );
|
||||
|
||||
//prompt the user for a filename
|
||||
//prompt the user for a fileName
|
||||
QString myOutputFileName;
|
||||
if ( myFileDialog->exec() == QDialog::Accepted )
|
||||
{
|
||||
@ -128,7 +128,7 @@ void QuickPrintGui::on_buttonBox_accepted()
|
||||
{
|
||||
if ( myFileDialog->selectedFilter() == tr ( "Portable Document Format (*.pdf)" ) )
|
||||
{
|
||||
//ensure the user never ommitted the extension from the filename
|
||||
//ensure the user never ommitted the extension from the fileName
|
||||
if ( !myOutputFileName.toUpper().endsWith ( ".PDF" ) )
|
||||
{
|
||||
myOutputFileName += ".pdf";
|
||||
|
@ -47,10 +47,10 @@
|
||||
|
||||
|
||||
QgsShapeFile::QgsShapeFile(QString name, QString encoding){
|
||||
filename = name;
|
||||
fileName = name;
|
||||
features = 0;
|
||||
OGRRegisterAll();
|
||||
ogrDataSource = OGROpen(QFile::encodeName(filename).constData(),FALSE,NULL);
|
||||
ogrDataSource = OGROpen(QFile::encodeName(fileName).constData(),FALSE,NULL);
|
||||
if (ogrDataSource != NULL){
|
||||
valid = true;
|
||||
ogrLayer = OGR_DS_GetLayer(ogrDataSource,0);
|
||||
@ -81,7 +81,7 @@ bool QgsShapeFile::scanGeometries()
|
||||
sg->setMinimum(0);
|
||||
sg->setMaximum(0);
|
||||
QString label = tr("Scanning ");
|
||||
label += filename;
|
||||
label += fileName;
|
||||
sg->setLabel(new QLabel(label));
|
||||
sg->show();
|
||||
qApp->processEvents();
|
||||
@ -172,7 +172,7 @@ QString QgsShapeFile::getFeatureClass(){
|
||||
QgsDebugMsg("After escaping, geom_type is : " + geom_type);
|
||||
delete[] esc_str;
|
||||
|
||||
QString file(filename);
|
||||
QString file(fileName);
|
||||
file.replace(file.length()-3, 3, "dbf");
|
||||
// open the dbf file
|
||||
std::ifstream dbf(file.toUtf8(), std::ios::in | std::ios::binary);
|
||||
@ -236,7 +236,7 @@ bool QgsShapeFile::is_valid(){
|
||||
}
|
||||
|
||||
QString QgsShapeFile::getName(){
|
||||
return filename;
|
||||
return fileName;
|
||||
}
|
||||
|
||||
QString QgsShapeFile::getTable(){
|
||||
@ -250,7 +250,7 @@ void QgsShapeFile::setTable(QString new_table){
|
||||
}
|
||||
|
||||
void QgsShapeFile::setDefaultTable(){
|
||||
QFileInfo fi(filename);
|
||||
QFileInfo fi(fileName);
|
||||
table_name = fi.baseName();
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ class QgsShapeFile : public QObject
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
QgsShapeFile(QString filename, QString encoding = QString());
|
||||
QgsShapeFile(QString fileName, QString encoding = QString());
|
||||
~QgsShapeFile();
|
||||
int getFeatureCount();
|
||||
QString getFeatureClass();
|
||||
@ -70,7 +70,7 @@ class QgsShapeFile : public QObject
|
||||
bool isMulti;
|
||||
bool hasMoreDimensions;
|
||||
int features;
|
||||
QString filename;
|
||||
QString fileName;
|
||||
QString geom_type;
|
||||
QStringList geometries;
|
||||
QTextCodec* codec;
|
||||
|
@ -225,7 +225,7 @@ void QgsSpit::addFile()
|
||||
QString featureClass = file->getFeatureClass();
|
||||
fileList.push_back( file );
|
||||
|
||||
QTableWidgetItem *filenameItem = new QTableWidgetItem( name );
|
||||
QTableWidgetItem *fileNameItem = new QTableWidgetItem( name );
|
||||
QTableWidgetItem *featureClassItem = new QTableWidgetItem( featureClass );
|
||||
QTableWidgetItem *featureCountItem = new QTableWidgetItem( QString( "%1" ).arg( file->getFeatureCount() ) );
|
||||
// Sanitize the relation name to make it pg friendly
|
||||
@ -234,12 +234,12 @@ void QgsSpit::addFile()
|
||||
QTableWidgetItem *dbSchemaNameItem = new QTableWidgetItem( cmbSchema->currentText() );
|
||||
|
||||
// All items are editable except for these two
|
||||
filenameItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
||||
fileNameItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
||||
featureCountItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
||||
|
||||
int row = tblShapefiles->rowCount();
|
||||
tblShapefiles->insertRow( row );
|
||||
tblShapefiles->setItem( row, ColFILENAME, filenameItem );
|
||||
tblShapefiles->setItem( row, ColFILENAME, fileNameItem );
|
||||
tblShapefiles->setItem( row, ColFEATURECLASS, featureClassItem );
|
||||
tblShapefiles->setItem( row, ColFEATURECOUNT, featureCountItem );
|
||||
tblShapefiles->setItem( row, ColDBRELATIONNAME, dbRelationNameItem );
|
||||
|
@ -324,16 +324,16 @@ void GPSData::writeXML(QTextStream& stream) {
|
||||
}
|
||||
|
||||
|
||||
GPSData* GPSData::getData(const QString& filename) {
|
||||
GPSData* GPSData::getData(const QString& fileName) {
|
||||
// if the data isn't there already, try to load it
|
||||
if (dataObjects.find(filename) == dataObjects.end()) {
|
||||
QFile file(filename);
|
||||
if (dataObjects.find(fileName) == dataObjects.end()) {
|
||||
QFile file(fileName);
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
QgsLogger::warning(QObject::tr("Couldn't open the data source: ") + filename);
|
||||
QgsLogger::warning(QObject::tr("Couldn't open the data source: ") + fileName);
|
||||
return 0;
|
||||
}
|
||||
GPSData* data = new GPSData;
|
||||
QgsLogger::debug("Loading file " + filename);
|
||||
QgsLogger::debug("Loading file " + fileName);
|
||||
GPXHandler handler(*data);
|
||||
bool failed = false;
|
||||
|
||||
@ -365,27 +365,27 @@ GPSData* GPSData::getData(const QString& filename) {
|
||||
|
||||
data->setNoDataExtent();
|
||||
|
||||
dataObjects[filename] = std::pair<GPSData*, unsigned>(data, 0);
|
||||
dataObjects[fileName] = std::pair<GPSData*, unsigned>(data, 0);
|
||||
}
|
||||
else
|
||||
QgsLogger::debug(filename + " is already loaded");
|
||||
QgsLogger::debug(fileName + " is already loaded");
|
||||
|
||||
// return a pointer and increase the reference count for that filename
|
||||
DataMap::iterator iter = dataObjects.find(filename);
|
||||
// return a pointer and increase the reference count for that fileName
|
||||
DataMap::iterator iter = dataObjects.find(fileName);
|
||||
++(iter->second.second);
|
||||
return (GPSData*)(iter->second.first);
|
||||
}
|
||||
|
||||
|
||||
void GPSData::releaseData(const QString& filename) {
|
||||
void GPSData::releaseData(const QString& fileName) {
|
||||
|
||||
/* decrease the reference count for the filename (if it is used), and erase
|
||||
/* decrease the reference count for the fileName (if it is used), and erase
|
||||
it if the reference count becomes 0 */
|
||||
DataMap::iterator iter = dataObjects.find(filename);
|
||||
DataMap::iterator iter = dataObjects.find(fileName);
|
||||
if (iter != dataObjects.end()) {
|
||||
QgsLogger::debug("unrefing " + filename);
|
||||
QgsLogger::debug("unrefing " + fileName);
|
||||
if (--(iter->second.second) == 0) {
|
||||
QgsLogger::debug("No one's using " + filename + ", I'll erase it");
|
||||
QgsLogger::debug("No one's using " + fileName + ", I'll erase it");
|
||||
delete iter->second.first;
|
||||
dataObjects.erase(iter);
|
||||
}
|
||||
|
@ -210,21 +210,21 @@ class GPSData {
|
||||
void writeXML(QTextStream& stream);
|
||||
|
||||
/** This function returns a pointer to the GPSData object associated with
|
||||
the file @c filename. If the file does not exist or can't be parsed,
|
||||
the file @c fileName. If the file does not exist or can't be parsed,
|
||||
NULL will be returned. If the file is already used by another layer,
|
||||
a pointer to the same GPSData object will be returned. And if the file
|
||||
is not used by any other layer, and can be parsed, a new GPSData object
|
||||
will be created and a pointer to it will be returned. If you use this
|
||||
function you should also call releaseData() with the same @c filename
|
||||
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(const QString& 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
|
||||
called getData() earlier with the same @c fileName, that can cause data
|
||||
that is still in use to be deleted. */
|
||||
static void releaseData(const QString& filename);
|
||||
static void releaseData(const QString& fileName);
|
||||
|
||||
|
||||
/** operator<< is our friend. For debugging, not for file I/O. */
|
||||
@ -242,7 +242,7 @@ class GPSData {
|
||||
/** This is used internally to store GPS data objects (one per file). */
|
||||
typedef std::map<QString, std::pair<GPSData*, unsigned> > DataMap;
|
||||
|
||||
/** This is the static container that maps filenames to GPSData objects and
|
||||
/** This is the static container that maps fileNames to GPSData objects and
|
||||
does reference counting, so several providers can use the same GPSData
|
||||
object. */
|
||||
static DataMap dataObjects;
|
||||
|
@ -64,7 +64,7 @@ QgsGPXProvider::QgsGPXProvider(QString uri) :
|
||||
// we always use UTF-8
|
||||
mEncoding = QTextCodec::codecForName("utf8");
|
||||
|
||||
// get the filename and the type parameter from the URI
|
||||
// get the fileName and the type parameter from the URI
|
||||
int fileNameEnd = uri.indexOf('?');
|
||||
if (fileNameEnd == -1 || uri.mid(fileNameEnd + 1, 5) != "type=") {
|
||||
QgsLogger::warning(tr("Bad URI - you need to specify the feature type."));
|
||||
|
@ -715,14 +715,14 @@ bool QgsOgrProvider::changeGeometryValues(QgsGeometryMap & geometry_map)
|
||||
|
||||
bool QgsOgrProvider::createSpatialIndex()
|
||||
{
|
||||
QString filename=dataSourceUri().section('/',-1,-1);//find out the filename from the uri
|
||||
QString layername=filename.section('.',0,0);
|
||||
QString sql="CREATE SPATIAL INDEX ON "+layername;
|
||||
QString fileName=dataSourceUri().section('/',-1,-1);//find out the fileName from the uri
|
||||
QString layerName=fileName.section('.',0,0);
|
||||
QString sql="CREATE SPATIAL INDEX ON "+layerName;
|
||||
OGR_DS_ExecuteSQL (ogrDataSource, sql.toAscii(), OGR_L_GetSpatialFilter(ogrLayer),"");
|
||||
//find out, if the .qix file is there
|
||||
QString indexname = dataSourceUri();
|
||||
indexname.truncate(dataSourceUri().length()-filename.length());
|
||||
indexname=indexname+layername+".qix";
|
||||
indexname.truncate(dataSourceUri().length()-fileName.length());
|
||||
indexname=indexname+layerName+".qix";
|
||||
QFile indexfile(indexname);
|
||||
if(indexfile.exists())
|
||||
{
|
||||
@ -746,9 +746,9 @@ bool QgsOgrProvider::deleteFeatures(const QgsFeatureIds & id)
|
||||
}
|
||||
|
||||
OGR_L_SyncToDisk(ogrLayer);
|
||||
QString filename=dataSourceUri().section('/',-1,-1);//find out the filename from the uri
|
||||
QString layername=filename.section('.',0,0);
|
||||
QString sql="REPACK " + layername;
|
||||
QString fileName=dataSourceUri().section('/',-1,-1);//find out the fileName from the uri
|
||||
QString layerName=fileName.section('.',0,0);
|
||||
QString sql="REPACK " + layerName;
|
||||
OGR_DS_ExecuteSQL(ogrDataSource,sql.toLocal8Bit().data(), NULL, NULL);
|
||||
numberFeatures = OGR_L_GetFeatureCount(ogrLayer,TRUE); //new feature count
|
||||
return returnvalue;
|
||||
|
@ -101,7 +101,7 @@ class ProjectTest : public CppUnit::TestFixture
|
||||
void testFileName()
|
||||
{
|
||||
QgsProject::instance()->dirty( false );
|
||||
QgsProject::instance()->setFilename( mFile );
|
||||
QgsProject::instance()->setFileName( mFile );
|
||||
|
||||
CPPUNIT_ASSERT( mFile == QgsProject::instance()->fileName() );
|
||||
CPPUNIT_ASSERT( QgsProject::instance()->isDirty() );
|
||||
|
@ -196,7 +196,7 @@ bool QgsMapserverExport::write()
|
||||
{
|
||||
okToSave = QMessageBox::warning(0, tr("Overwrite File?"), txtMapFilePath->text() +
|
||||
tr(" exists. \nDo you want to overwrite it?",
|
||||
"a filename is prepended to this text, and appears in a dialog box"),
|
||||
"a fileName is prepended to this text, and appears in a dialog box"),
|
||||
QMessageBox::Ok | QMessageBox::Cancel);
|
||||
}
|
||||
if (okToSave == QMessageBox::Ok)
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
//! get the full path name of the map file
|
||||
QString fullPathName();
|
||||
//! Set the full path to the file
|
||||
void setFileName(QString filename);
|
||||
void setFileName(QString fileName);
|
||||
enum ACTION {
|
||||
SAVE,
|
||||
SAVEAS,
|
||||
|
Loading…
x
Reference in New Issue
Block a user