Skip to content

Commit

Permalink
Follow Qt naming style: fileName instead of filename, layerName inste…
Browse files Browse the repository at this point in the history
…ad of layerName

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9136 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Aug 23, 2008
1 parent 9576836 commit 619dd2e
Show file tree
Hide file tree
Showing 46 changed files with 221 additions and 221 deletions.
4 changes: 2 additions & 2 deletions python/core/qgslogger.sip
Expand Up @@ -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
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsmarkercatalogue.sip
Expand Up @@ -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 );
};
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsproject.sip
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsrasterlayer.sip
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -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
)
Expand All @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/app/main.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down
46 changes: 23 additions & 23 deletions src/app/qgisapp.cpp
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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"));
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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());

Expand All @@ -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
{
Expand All @@ -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()
Expand Down Expand Up @@ -2749,7 +2749,7 @@ void QgisApp::fileOpen()
delete mComposer;
mComposer = new QgsComposer(this);

QgsProject::instance()->setFilename( fullPath );
QgsProject::instance()->setFileName( fullPath );

try
{
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -2917,7 +2917,7 @@ bool QgisApp::fileSave()
}


QgsProject::instance()->setFilename( fullPath.filePath() );
QgsProject::instance()->setFileName( fullPath.filePath() );
}

try
Expand Down Expand Up @@ -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);
Expand All @@ -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;

Expand Down Expand Up @@ -3003,7 +3003,7 @@ void QgisApp::fileSaveAs()

try
{
QgsProject::instance()->setFilename( fullPath.filePath() );
QgsProject::instance()->setFileName( fullPath.filePath() );

if ( QgsProject::instance()->write() )
{
Expand Down Expand Up @@ -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
Expand All @@ -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)
{
Expand All @@ -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];
Expand All @@ -3259,7 +3259,7 @@ void QgisApp::saveMapAsImage(QString theImageFileNameQString, QPixmap * theQPixm
{
if ( theImageFileNameQString=="")
{
//no filename chosen
//no fileName chosen
return;
}
else
Expand Down
8 changes: 4 additions & 4 deletions src/app/qgisapp.h
Expand Up @@ -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)
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -452,7 +452,7 @@ public slots:
*/
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);
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsabout.cpp
Expand Up @@ -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++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmapserverexport.cpp
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmapserverexport.h
Expand Up @@ -45,7 +45,7 @@ Q_OBJECT
//! 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,
Expand Down

0 comments on commit 619dd2e

Please sign in to comment.