From fc0d3a4c0b21aa126dd13cd4dd818cc43fb90d42 Mon Sep 17 00:00:00 2001 From: David Partyka Date: Wed, 17 Aug 2011 17:29:48 -0400 Subject: [PATCH] Fix lots of unused variable warnings. --- QtTestingConfigure.h.in | 8 ++++++++ pq3DViewEventPlayer.cxx | 2 +- pqNativeFileDialogEventPlayer.cxx | 18 +++++++++--------- pqNativeFileDialogEventTranslator.cxx | 4 ++-- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/QtTestingConfigure.h.in b/QtTestingConfigure.h.in index f9fab22..e0e2bb8 100644 --- a/QtTestingConfigure.h.in +++ b/QtTestingConfigure.h.in @@ -39,5 +39,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define QT_TESTING_EVENT_PLAYBACK_DELAY @QT_TESTING_EVENT_PLAYBACK_DELAY@ +// +// This macro is used to quiet compiler warnings about unused parameters +// to methods. Only use it when the parameter really shouldn't be used. +// Don't use it as a way to shut up the compiler while you take your +// sweet time getting around to implementing the method. +// +#define pqNotUsed(x) + #endif // _QtTestingConfigure_h diff --git a/pq3DViewEventPlayer.cxx b/pq3DViewEventPlayer.cxx index d4b0ed8..2b75482 100644 --- a/pq3DViewEventPlayer.cxx +++ b/pq3DViewEventPlayer.cxx @@ -47,7 +47,7 @@ pq3DViewEventPlayer::pq3DViewEventPlayer(const QByteArray& classname, QObject * bool pq3DViewEventPlayer::playEvent(QObject* Object, const QString& Command, const QString& Arguments, - bool& Error) + bool& pqNotUsed(Error)) { QWidget* widget = qobject_cast(Object); if(widget && Object->inherits(mClassType.data())) diff --git a/pqNativeFileDialogEventPlayer.cxx b/pqNativeFileDialogEventPlayer.cxx index 64747c7..f42651a 100644 --- a/pqNativeFileDialogEventPlayer.cxx +++ b/pqNativeFileDialogEventPlayer.cxx @@ -63,26 +63,26 @@ namespace QString filename; QStringList filenames; - QString dir_hook(QWidget* parent, const QString& caption, const QString& dir, - QFileDialog::Options options) + QString dir_hook(QWidget* pqNotUsed(parent), const QString& pqNotUsed(caption), const QString& pqNotUsed(dir), + QFileDialog::Options pqNotUsed(options)) { // wait for next event played to give us a filename loop->exec(); return filename; } - QString filename_hook(QWidget* parent, const QString& caption, const QString& dir, - const QString& filter, QString *selectedFilter, - QFileDialog::Options options) + QString filename_hook(QWidget* pqNotUsed(parent), const QString& pqNotUsed(caption), const QString& pqNotUsed(dir), + const QString& pqNotUsed(filter), QString * pqNotUsed(selectedFilter), + QFileDialog::Options pqNotUsed(options)) { // wait for next event played to give us a filename loop->exec(); return filename; } - QStringList filenames_hook(QWidget* parent, const QString& caption, const QString& dir, - const QString& filter, QString *selectedFilter, - QFileDialog::Options options) + QStringList filenames_hook(QWidget* pqNotUsed(parent), const QString& pqNotUsed(caption), const QString& pqNotUsed(dir), + const QString& pqNotUsed(filter), QString *pqNotUsed(selectedFilter), + QFileDialog::Options pqNotUsed(options)) { // wait for next event played to give us a filename loop->exec(); @@ -144,7 +144,7 @@ void pqNativeFileDialogEventPlayer::stop() qt_filedialog_save_filename_hook = old_save_filename_hook; } -bool pqNativeFileDialogEventPlayer::playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error) +bool pqNativeFileDialogEventPlayer::playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& pqNotUsed(Error)) { if(!qobject_cast(Object)) diff --git a/pqNativeFileDialogEventTranslator.cxx b/pqNativeFileDialogEventTranslator.cxx index 3ee216c..2a0714b 100644 --- a/pqNativeFileDialogEventTranslator.cxx +++ b/pqNativeFileDialogEventTranslator.cxx @@ -153,8 +153,8 @@ void pqNativeFileDialogEventTranslator::stop() qt_filedialog_save_filename_hook = old_save_filename_hook; } -bool pqNativeFileDialogEventTranslator::translateEvent(QObject* Object, QEvent* Event, - bool& /*Error*/) +bool pqNativeFileDialogEventTranslator::translateEvent(QObject* Object, QEvent* pqNotUsed(Event), + bool& pqNotUsed(Error)) { // capture events under a filedialog and consume them QObject* tmp = Object; -- GitLab