Skip to content

Commit 619dd2e

Browse files
author
timlinux
committed
Follow Qt naming style: fileName instead of filename, layerName instead of layerName
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9136 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9576836 commit 619dd2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+221
-221
lines changed

python/core/qgslogger.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
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
55

6-
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
6+
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
77
*/
88

99
class QgsLogger
@@ -17,7 +17,7 @@ class QgsLogger
1717
/**Goes to qDebug.
1818
@param msg the message to be printed
1919
@param debuglevel
20-
@param file filename where the message comes from
20+
@param file fileName where the message comes from
2121
@param function function where the message comes from
2222
@param line place in file where the message comes from*/
2323
static void debug(const QString& msg, int debuglevel = 1, const char* file = NULL, const char* function = NULL, int line = -1);

python/core/qgsmarkercatalogue.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public:
2626
*/
2727
QPicture pictureMarker (QString fullName, int size, QPen pen, QBrush brush, bool qtBug = true );
2828

29-
/** Returns a pixmap given a filename of a svg marker
29+
/** Returns a pixmap given a fileName of a svg marker
3030
* NOTE: this method needs to be public static for QgsMarkerDialog::visualizeMarkers */
3131
static void svgMarker (QPainter * thepPainter, QString name, int size );
3232
};

python/core/qgsproject.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public:
5959
Every project has an associated file that contains its XML
6060
*/
6161
//@{
62-
void setFilename( const QString & name );
62+
void setFileName( const QString & name );
6363

6464
/** returns file name */
6565
QString fileName() const;

python/core/qgsrasterlayer.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public:
2121
static void buildSupportedRasterFileFilter(QString & fileFilters);
2222
static void registerGdalDrivers();
2323

24-
/** This helper checks to see whether the filename appears to be a valid
24+
/** This helper checks to see whether the fileName appears to be a valid
2525
raster file name */
2626
static bool isValidRasterFileName(const QString & theFileNameQString);
2727

src/app/composer/qgscomposer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
781781
std::auto_ptr < QFileDialog > myQFileDialog(
782782
new QFileDialog(
783783
this,
784-
tr("Choose a filename to save the map image as"),
784+
tr("Choose a fileName to save the map image as"),
785785
file.path(),
786786
myFilters
787787
)
@@ -797,7 +797,7 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
797797
// set the 'Open' button to something that makes more sense
798798
myQFileDialog->setAcceptMode(QFileDialog::AcceptSave);
799799

800-
//prompt the user for a filename
800+
//prompt the user for a fileName
801801
QString myOutputFileNameQString; // = myQFileDialog->getSaveFileName(); //delete this
802802

803803
int result = myQFileDialog->exec();
@@ -876,7 +876,7 @@ void QgsComposer::on_mActionExportAsSVG_activated(void)
876876
}
877877
QString myLastUsedFile = myQSettings.value("/UI/lastSaveAsSvgFile","qgis.svg").toString();
878878
QFileInfo file(myLastUsedFile);
879-
QFileDialog *myQFileDialog = new QFileDialog( this, tr("Choose a filename to save the map as"),
879+
QFileDialog *myQFileDialog = new QFileDialog( this, tr("Choose a fileName to save the map as"),
880880
file.path(), tr("SVG Format") + " (*.svg *SVG)" );
881881
myQFileDialog->selectFile( file.fileName() );
882882
myQFileDialog->setFileMode(QFileDialog::AnyFile);

src/app/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void usage( std::string const & appName )
8484
<< "raster and vector data.\n"
8585
<< "Usage: " << appName << " [options] [FILES]\n"
8686
<< " options:\n"
87-
<< "\t[--snapshot filename]\temit snapshot of loaded datasets to given file\n"
87+
<< "\t[--snapshot fileName]\temit snapshot of loaded datasets to given file\n"
8888
<< "\t[--lang language]\tuse language for interface text\n"
8989
<< "\t[--project projectfile]\tload the given QGIS project\n"
9090
<< "\t[--extent xmin,ymin,xmax,ymax]\tset initial map extent\n"
@@ -584,7 +584,7 @@ int main(int argc, char *argv[])
584584

585585

586586
/////////////////////////////////////////////////////////////////////
587-
// autoload any filenames that were passed in on the command line
587+
// autoload any fileNames that were passed in on the command line
588588
/////////////////////////////////////////////////////////////////////
589589
#ifdef QGISDEBUG
590590
std::cout << "Number of files in myFileList: " << myFileList.count() << std::endl;

src/app/qgisapp.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1975,7 +1975,7 @@ static void openFilesRememberingFilter_(QString const &filterName,
19751975

19761976

19771977
/**
1978-
This method prompts the user for a list of vector filenames with a dialog.
1978+
This method prompts the user for a list of vector fileNames with a dialog.
19791979
*/
19801980
void QgisApp::addVectorLayer()
19811981
{
@@ -2074,7 +2074,7 @@ bool QgisApp::addVectorLayers(QStringList const & theLayerQStringList, const QSt
20742074

20752075

20762076

2077-
/** This helper checks to see whether the filename appears to be a valid vector file name */
2077+
/** This helper checks to see whether the fileName appears to be a valid vector file name */
20782078
bool QgisApp::isValidVectorFileName(QString theFileNameQString)
20792079
{
20802080
return (theFileNameQString.toLower().endsWith(".shp"));
@@ -2527,7 +2527,7 @@ void QgisApp::fileNew(bool thePromptToSaveFlag)
25272527

25282528
QgsProject* prj = QgsProject::instance();
25292529
prj->title( QString::null );
2530-
prj->setFilename( QString::null );
2530+
prj->setFileName( QString::null );
25312531
prj->clearProperties(); // why carry over properties from previous projects?
25322532

25332533
QSettings settings;
@@ -2599,7 +2599,7 @@ void QgisApp::newVectorLayer()
25992599
bool haveLastUsedFilter = false; // by default, there is no last
26002600
// used filter
26012601
QString enc;
2602-
QString filename;
2602+
QString fileName;
26032603

26042604
QSettings settings; // where we keep last used filter in
26052605
// persistant state
@@ -2634,14 +2634,14 @@ void QgisApp::newVectorLayer()
26342634
return;
26352635
}
26362636

2637-
filename = openFileDialog->selectedFiles().first();
2637+
fileName = openFileDialog->selectedFiles().first();
26382638
enc = openFileDialog->encoding();
26392639

26402640
// If the file exists, delete it otherwise we'll end up loading that
26412641
// file, which can cause problems (e.g., if the file contains
26422642
// linestrings, but we're wanting to create points, we'll end up
26432643
// with a linestring file).
2644-
QFile::remove(filename);
2644+
QFile::remove(fileName);
26452645

26462646
settings.setValue("/UI/lastVectorFileFilter", openFileDialog->selectedFilter());
26472647

@@ -2668,20 +2668,20 @@ void QgisApp::newVectorLayer()
26682668
#if 0
26692669
if(geometrytype == QGis::WKBPoint)
26702670
{
2671-
createEmptyDataSource(filename,fileformat, enc, QGis::WKBPoint, attributes);
2671+
createEmptyDataSource(fileName,fileformat, enc, QGis::WKBPoint, attributes);
26722672
}
26732673
else if (geometrytype == QGis::WKBLineString)
26742674
{
2675-
createEmptyDataSource(filename,fileformat, enc, QGis::WKBLineString, attributes);
2675+
createEmptyDataSource(fileName,fileformat, enc, QGis::WKBLineString, attributes);
26762676
}
26772677
else if(geometrytype == QGis::WKBPolygon)
26782678
{
2679-
createEmptyDataSource(filename,fileformat, enc, QGis::WKBPolygon, attributes);
2679+
createEmptyDataSource(fileName,fileformat, enc, QGis::WKBPolygon, attributes);
26802680
}
26812681
#endif
26822682
if(geometrytype != QGis::WKBUnknown)
26832683
{
2684-
createEmptyDataSource(filename,fileformat, enc, geometrytype, attributes);
2684+
createEmptyDataSource(fileName,fileformat, enc, geometrytype, attributes);
26852685
}
26862686
else
26872687
{
@@ -2696,9 +2696,9 @@ void QgisApp::newVectorLayer()
26962696
}
26972697

26982698
//then add the layer to the view
2699-
QStringList filenames;
2700-
filenames.append(filename);
2701-
addVectorLayers(filenames, enc);
2699+
QStringList fileNames;
2700+
fileNames.append(fileName);
2701+
addVectorLayers(fileNames, enc);
27022702
}
27032703

27042704
void QgisApp::fileOpen()
@@ -2749,7 +2749,7 @@ void QgisApp::fileOpen()
27492749
delete mComposer;
27502750
mComposer = new QgsComposer(this);
27512751

2752-
QgsProject::instance()->setFilename( fullPath );
2752+
QgsProject::instance()->setFileName( fullPath );
27532753

27542754
try
27552755
{
@@ -2873,7 +2873,7 @@ bool QgisApp::fileSave()
28732873
return false;
28742874
}
28752875

2876-
// if we don't have a filename, then obviously we need to get one; note
2876+
// if we don't have a fileName, then obviously we need to get one; note
28772877
// that the project file name is reset to null in fileNew()
28782878
QFileInfo fullPath;
28792879

@@ -2917,7 +2917,7 @@ bool QgisApp::fileSave()
29172917
}
29182918

29192919

2920-
QgsProject::instance()->setFilename( fullPath.filePath() );
2920+
QgsProject::instance()->setFileName( fullPath.filePath() );
29212921
}
29222922

29232923
try
@@ -2964,7 +2964,7 @@ void QgisApp::fileSaveAs()
29642964
QString lastUsedDir = settings.value("/UI/lastProjectDir", ".").toString();
29652965

29662966
auto_ptr<QFileDialog> saveFileDialog( new QFileDialog(this,
2967-
tr("Choose a filename to save the QGIS project file as"),
2967+
tr("Choose a fileName to save the QGIS project file as"),
29682968
lastUsedDir, QObject::tr("QGis files (*.qgs)")) );
29692969

29702970
saveFileDialog->setFileMode(QFileDialog::AnyFile);
@@ -2973,7 +2973,7 @@ void QgisApp::fileSaveAs()
29732973

29742974
saveFileDialog->setConfirmOverwrite( true );
29752975

2976-
// if we don't have a filename, then obviously we need to get one; note
2976+
// if we don't have a fileName, then obviously we need to get one; note
29772977
// that the project file name is reset to null in fileNew()
29782978
QFileInfo fullPath;
29792979

@@ -3003,7 +3003,7 @@ void QgisApp::fileSaveAs()
30033003

30043004
try
30053005
{
3006-
QgsProject::instance()->setFilename( fullPath.filePath() );
3006+
QgsProject::instance()->setFileName( fullPath.filePath() );
30073007

30083008
if ( QgsProject::instance()->write() )
30093009
{
@@ -3205,7 +3205,7 @@ void QgisApp::saveMapAsImage()
32053205

32063206
//create a file dialog using the the filter list generated above
32073207
std::auto_ptr < QFileDialog > myQFileDialog( new QFileDialog(this,
3208-
tr("Choose a filename to save the map image as"),
3208+
tr("Choose a fileName to save the map image as"),
32093209
myLastUsedDir, myFilters) );
32103210

32113211
// allow for selection of more than one file
@@ -3222,7 +3222,7 @@ void QgisApp::saveMapAsImage()
32223222
}
32233223

32243224

3225-
//prompt the user for a filename
3225+
//prompt the user for a fileName
32263226
QString myOutputFileNameQString; // = myQFileDialog->getSaveFileName(); //delete this
32273227
if (myQFileDialog->exec() == QDialog::Accepted)
32283228
{
@@ -3233,7 +3233,7 @@ void QgisApp::saveMapAsImage()
32333233
QgsDebugMsg("Selected filter: " + myFilterString);
32343234
QgsDebugMsg("Image type to be passed to mapcanvas: " + myFilterMap[myFilterString]);
32353235

3236-
// Add the file type suffix to the filename if required
3236+
// Add the file type suffix to the fileName if required
32373237
if (!myOutputFileNameQString.endsWith(myFilterMap[myFilterString]))
32383238
{
32393239
myOutputFileNameQString += "." + myFilterMap[myFilterString];
@@ -3259,7 +3259,7 @@ void QgisApp::saveMapAsImage(QString theImageFileNameQString, QPixmap * theQPixm
32593259
{
32603260
if ( theImageFileNameQString=="")
32613261
{
3262-
//no filename chosen
3262+
//no fileName chosen
32633263
return;
32643264
}
32653265
else

src/app/qgisapp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ class QgisApp : public QMainWindow
8080
QgsVectorLayer* addVectorLayer(QString vectorLayerPath, QString baseName, QString providerKey);
8181

8282
/** \brief overloaded vesion of the privat addLayer method that takes a list of
83-
* filenames instead of prompting user with a dialog.
83+
* fileNames instead of prompting user with a dialog.
8484
@param enc encoding type for the layer
8585
@returns true if successfully added layer
8686
*/
8787
bool addVectorLayers(QStringList const & theLayerQStringList, const QString& enc);
8888

8989
/** overloaded vesion of the private addRasterLayer()
90-
Method that takes a list of filenames instead of prompting
90+
Method that takes a list of fileNames instead of prompting
9191
user with a dialog.
9292
@returns true if successfully added layer(s)
9393
*/
@@ -178,7 +178,7 @@ class QgisApp : public QMainWindow
178178
public slots:
179179
//! About QGis
180180
void about();
181-
//! Add a raster layer to the map (will prompt user for filename using dlg )
181+
//! Add a raster layer to the map (will prompt user for fileName using dlg )
182182
void addRasterLayer();
183183
//#ifdef HAVE_POSTGRESQL
184184
//! Add a databaselayer to the map
@@ -452,7 +452,7 @@ public slots:
452452
*/
453453
bool addRasterLayer(QgsRasterLayer * theRasterLayer);
454454
//@todo We should move these next two into vector layer class
455-
/** This helper checks to see whether the filename appears to be a valid vector file name */
455+
/** This helper checks to see whether the fileName appears to be a valid vector file name */
456456
bool isValidVectorFileName (QString theFileNameQString);
457457
/** Overloaded version of the above function provided for convenience that takes a qstring pointer */
458458
bool isValidVectorFileName (QString * theFileNameQString);

src/app/qgsabout.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ void QgsAbout::openUrl(QString url)
245245
* Step 2: Replace all bytes of the UTF-8 above 0x7f with the hexcode in lower case.
246246
* Step 2: Replace all non [a-z][a-Z][0-9] with underscore (backward compatibility)
247247
*/
248-
QString QgsAbout::fileSystemSafe(QString filename)
248+
QString QgsAbout::fileSystemSafe(QString fileName)
249249
{
250250
QString result;
251-
QByteArray utf8 = filename.toUtf8();
251+
QByteArray utf8 = fileName.toUtf8();
252252

253253
for (int i = 0; i < utf8.size(); i++)
254254
{

src/app/qgsmapserverexport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ void QgsMapserverExport::on_btnChooseFile_clicked()
367367
{
368368
QString s = QFileDialog::getSaveFileName(
369369
this,
370-
"Choose a filename for the exported map file",
370+
"Choose a fileName for the exported map file",
371371
"./",
372372
"Mapserver files (*.map)" );
373373
txtMapFilePath->setText(s);

0 commit comments

Comments
 (0)