Skip to content

Commit

Permalink
cleanup cleanup
Browse files Browse the repository at this point in the history
- remove method names from QgsDebugMsg calls as they are already included in the output
- replace filename with file name in strings and comments instead of fileName (same for layerName)
- fix debugging output in interpolation plugin
  (QgsDebugMsg migration ate the last argument where std::flush was used)
- fix some common typos



git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9150 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 24, 2008
1 parent d975240 commit 2a4a699
Show file tree
Hide file tree
Showing 86 changed files with 1,057 additions and 1,181 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 file name. 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 file name 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 file name 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/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 file name appears to be a valid
raster file name */
static bool isValidRasterFileName(const QString & theFileNameQString);

Expand Down
12 changes: 6 additions & 6 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -104,7 +104,7 @@ QgsComposer::QgsComposer( QgisApp *qgis ): QMainWindow()
mQgis = qgis;
mFirstTime = true;

QgsDebugMsg( "QgsComposer::QgsComposer" );
QgsDebugMsg( "entered." );

setMouseTracking( true );
//mSplitter->setMouseTracking(true);
Expand Down Expand Up @@ -788,7 +788,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 file name to save the map image as" ),
file.path(),
myFilters
)
Expand All @@ -804,7 +804,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 file name
QString myOutputFileNameQString; // = myQFileDialog->getSaveFileName(); //delete this

int result = myQFileDialog->exec();
Expand Down Expand Up @@ -881,7 +881,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 file name to save the map as" ),
file.path(), tr( "SVG Format" ) + " (*.svg *SVG)" );
myQFileDialog->selectFile( file.fileName() );
myQFileDialog->setFileMode( QFileDialog::AnyFile );
Expand Down Expand Up @@ -1074,7 +1074,7 @@ void QgsComposer::on_closePButton_clicked()

void QgsComposer::projectRead( void )
{
QgsDebugMsg( "QgsComposer::projectRead" );
QgsDebugMsg( "entered." );
//if ( mComposition ) delete mComposition;
//mComposition = new QgsComposition( this, 1 );

Expand Down Expand Up @@ -1115,7 +1115,7 @@ void QgsComposer::projectRead( void )

void QgsComposer::newProject( void )
{
QgsDebugMsg( "QgsComposer::newProject" );
QgsDebugMsg( "entered." );
//if ( mComposition ) delete mComposition;

//mComposition = new QgsComposition( this, 1 );
Expand Down
4 changes: 2 additions & 2 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -1795,12 +1795,12 @@ void QgsLegend::legendLayerZoomNative()
if ( layer )
{
QgsDebugMsg( "Raster units per pixel : " + QString::number( layer->rasterUnitsPerPixel() ) );
QgsDebugMsg( "MapUnitsPerPixel before : " + QString::number( mMapCanvas->mapUnitsPerPixel() ) );
QgsDebugMsg( "MapUnitsPerPixel before : " + QString::number( mMapCanvas->mapUnitsPerPixel() ) );

mMapCanvas->zoom( fabs( layer->rasterUnitsPerPixel() / mMapCanvas->mapUnitsPerPixel() ) );
mMapCanvas->refresh();

QgsDebugMsg( "MapUnitsPerPixel after : " + QString::number( mMapCanvas->mapUnitsPerPixel() ) );
QgsDebugMsg( "MapUnitsPerPixel after : " + QString::number( mMapCanvas->mapUnitsPerPixel() ) );

// notify the project we've made a change
QgsProject::instance()->dirty( true );
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 @@ -583,7 +583,7 @@ int main( int argc, char *argv[] )


/////////////////////////////////////////////////////////////////////
// autoload any fileNames that were passed in on the command line
// autoload any file names that were passed in on the command line
/////////////////////////////////////////////////////////////////////
QgsDebugMsg( QString( "Number of files in myFileList: %1" ).arg( myFileList.count() ) );
for ( QStringList::Iterator myIterator = myFileList.begin(); myIterator != myFileList.end(); ++myIterator )
Expand Down
16 changes: 8 additions & 8 deletions src/app/qgisapp.cpp
Expand Up @@ -1981,7 +1981,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 file names with a dialog.
*/
void QgisApp::addVectorLayer()
{
Expand Down Expand Up @@ -2080,7 +2080,7 @@ bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QS



/** This helper checks to see whether the fileName appears to be a valid vector file name */
/** This helper checks to see whether the file name appears to be a valid vector file name */
bool QgisApp::isValidVectorFileName( QString theFileNameQString )
{
return ( theFileNameQString.toLower().endsWith( ".shp" ) );
Expand Down Expand Up @@ -2879,7 +2879,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 file name, 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 @@ -2970,7 +2970,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 file name to save the QGIS project file as" ),
lastUsedDir, QObject::tr( "QGis files (*.qgs)" ) ) );

saveFileDialog->setFileMode( QFileDialog::AnyFile );
Expand All @@ -2979,7 +2979,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 file name, 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 @@ -3211,7 +3211,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 file name to save the map image as" ),
myLastUsedDir, myFilters ) );

// allow for selection of more than one file
Expand Down Expand Up @@ -3314,10 +3314,10 @@ void QgisApp::toggleFullScreen()
// would otherwise cause two re-renders of the map, which can take a
// long time.
bool renderFlag = getMapCanvas()->renderFlag();
getMapCanvas()->setRenderFlag(false);
getMapCanvas()->setRenderFlag( false );
showNormal();
showMaximized();
getMapCanvas()->setRenderFlag(renderFlag);
getMapCanvas()->setRenderFlag( renderFlag );
mPrevScreenModeMaximized = false;
}
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.
* file names 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 file names 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 file name using dlg )
void addRasterLayer();
//#ifdef HAVE_POSTGRESQL
//! Add a databaselayer to the map
Expand Down Expand Up @@ -452,7 +452,7 @@ class QgisApp : public QMainWindow
*/
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 file name 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
20 changes: 8 additions & 12 deletions src/app/qgsclipboard.cpp
Expand Up @@ -46,7 +46,7 @@ void QgsClipboard::replaceWithCopyOf( const QgsFieldMap& fields, QgsFeatureList&

// Replace the QGis clipboard.
mFeatureClipboard = features;
QgsDebugMsg( "QgsClipboard::replaceWith: replaced QGis clipboard." );
QgsDebugMsg( "replaced QGis clipboard." );

// Replace the system clipboard.

Expand Down Expand Up @@ -76,14 +76,11 @@ void QgsClipboard::replaceWithCopyOf( const QgsFieldMap& fields, QgsFeatureList&
else
textFields += "NULL";

#ifdef QGISDEBUG
// QgsDebugMsg("QgsClipboard::replaceWithCopyOf: about to traverse fields.");
#endif
// QgsDebugMsg("about to traverse fields.");
//
for ( QgsAttributeMap::iterator it2 = attributes.begin(); it2 != attributes.end(); ++it2 )
{
#ifdef QGISDEBUG
// QgsDebugMsg(QString("QgsClipboard::replaceWithCopyOf: inspecting field '%1'.").arg(it2->toString()));
#endif
// QgsDebugMsg(QString("inspecting field '%1'.").arg(it2->toString()));
textFields += it2->toString();
}

Expand All @@ -108,14 +105,13 @@ void QgsClipboard::replaceWithCopyOf( const QgsFieldMap& fields, QgsFeatureList&
cb->setText( textCopy, QClipboard::Selection );
cb->setText( textCopy, QClipboard::Clipboard );

QgsDebugMsg( QString( "QgsClipboard::replaceWith: replaced system clipboard with: %1." ).arg( textCopy ) );

QgsDebugMsg( QString( "replaced system clipboard with: %1." ).arg( textCopy ) );
}

QgsFeatureList QgsClipboard::copyOf()
{

QgsDebugMsg( "QgsClipboard::copyOf: returning clipboard." );
QgsDebugMsg( "returning clipboard." );

//TODO: Slurp from the system clipboard as well.

Expand All @@ -129,13 +125,13 @@ void QgsClipboard::clear()
{
mFeatureClipboard.clear();

QgsDebugMsg( "QgsClipboard::clear: cleared clipboard." );
QgsDebugMsg( "cleared clipboard." );
}

void QgsClipboard::insert( QgsFeature& feature )
{
mFeatureClipboard.push_back( feature );

QgsDebugMsg( "QgsClipboard::insert: inserted " + feature.geometry()->exportToWkt() );
QgsDebugMsg( "inserted " + feature.geometry()->exportToWkt() );
}

14 changes: 7 additions & 7 deletions src/app/qgscustomprojectiondialog.cpp
Expand Up @@ -392,7 +392,7 @@ QString QgsCustomProjectionDialog::getEllipsoidAcronym( QString theEllipsoidName

void QgsCustomProjectionDialog::on_pbnFirst_clicked()
{
QgsDebugMsg( "QgsCustomProjectionDialog::on_pbnFirst_clicked()" );
QgsDebugMsg( "entered." );
sqlite3 *myDatabase;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
Expand Down Expand Up @@ -460,7 +460,7 @@ void QgsCustomProjectionDialog::on_pbnFirst_clicked()

void QgsCustomProjectionDialog::on_pbnPrevious_clicked()
{
QgsDebugMsg( "QgsCustomProjectionDialog::on_pbnPrevious_clicked()" );
QgsDebugMsg( "entered." );
if ( mCurrentRecordLong <= 1 )
{
return;
Expand Down Expand Up @@ -533,7 +533,7 @@ void QgsCustomProjectionDialog::on_pbnPrevious_clicked()

void QgsCustomProjectionDialog::on_pbnNext_clicked()
{
QgsDebugMsg( "QgsCustomProjectionDialog::on_pbnNext_clicked()" );
QgsDebugMsg( "entered." );
if ( mCurrentRecordLong >= mRecordCountLong )
{
return;
Expand Down Expand Up @@ -606,7 +606,7 @@ void QgsCustomProjectionDialog::on_pbnNext_clicked()

void QgsCustomProjectionDialog::on_pbnLast_clicked()
{
QgsDebugMsg( "QgsCustomProjectionDialog::on_pbnLast_clicked()" );
QgsDebugMsg( "entered." );
sqlite3 *myDatabase;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
Expand Down Expand Up @@ -710,7 +710,7 @@ void QgsCustomProjectionDialog::on_pbnNew_clicked()

void QgsCustomProjectionDialog::on_pbnSave_clicked()
{
QgsDebugMsg( "QgsCustomProjectionDialog::on_pbnSave_clicked()" );
QgsDebugMsg( "entered." );

QString myName = leName->text();
QString myParameters = leParameters->text();
Expand Down Expand Up @@ -830,7 +830,7 @@ void QgsCustomProjectionDialog::on_pbnSave_clicked()
myResult = sqlite3_open( QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase );
if ( myResult != SQLITE_OK )
{
QgsDebugMsg( QString( "Can't open database: %1 /n please notify QGIS developers of this error \n %2 (file name) " ).arg( sqlite3_errmsg( myDatabase ) ).arg( QgsApplication::qgisUserDbFilePath() ) );
QgsDebugMsg( QString( "Can't open database: %1 \n please notify QGIS developers of this error \n %2 (file name) " ).arg( sqlite3_errmsg( myDatabase ) ).arg( QgsApplication::qgisUserDbFilePath() ) );
// XXX This will likely never happen since on open, sqlite creates the
// database if it does not exist.
assert( myResult == SQLITE_OK );
Expand Down Expand Up @@ -859,7 +859,7 @@ void QgsCustomProjectionDialog::on_pbnSave_clicked()

void QgsCustomProjectionDialog::on_pbnCalculate_clicked()
{
QgsDebugMsg( "QgsCustomProjectionDialog::on_pbnCalculate_clicked()" );
QgsDebugMsg( "entered." );


//
Expand Down

0 comments on commit 2a4a699

Please sign in to comment.