1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

* cleaned up notifyplugin

cause:
   /projects/OpenPilot/git/ground/openpilotgcs/src/plugins/notify/notifyplugin.cpp:104:6:
   warning: unused parameter ‘configInfo’ [-Wunused-parameter]
   /projects/OpenPilot/git/ground/openpilotgcs/src/plugins/notify/notifyplugin.cpp:353:6:
   warning: unused parameter ‘values’ [-Wunused-parameter]
   /projects/OpenPilot/git/ground/openpilotgcs/src/plugins/notify/notifypluginoptionspage.cpp:73:10:
   warning: unused parameter ‘parent’ [-Wunused-parameter]
   /projects/OpenPilot/git/ground/openpilotgcs/src/plugins/notify/notifypluginoptionspage.cpp:451:6:
   warning: unused parameter ‘rangeStr’ [-Wunused-parameter]
   /projects/OpenPilot/git/ground/openpilotgcs/src/plugins/notify/notifypluginoptionspage.cpp:512:7:
   warning: unused parameter ‘oldstate’ [-Wunused-parameter]
   /projects/OpenPilot/git/ground/openpilotgcs/src/plugins/notify/notifypluginoptionspage.cpp:527:6:
   warning: unused parameter ‘deselected’ [-Wunused-parameter]

   implemented solution:
   fixed all of them (commented out var name)

* fixed bug in check code

   cause:
   /projects/OpenPilot/git/ground/openpilotgcs/src/plugins/notify/notifyplugin.cpp:
   In member function ‘void SoundNotifyPlugin::checkNotificationRule(NotificationItem*, UAVObject*)’:
   /projects/OpenPilot/git/ground/openpilotgcs/src/plugins/notify/notifyplugin.cpp:398:109:
   warning: suggest parentheses around comparison in operand of ‘|’ [-Wparentheses]

   implemented solution:
   this is an obvious bug that is syntactically correct but leads to a
   warning with a good compiler so this bug can be found. fixed that to use
   logical or instead of bitwise or.

* fixed bug in include file (error in compilation under Linux)

   cause:
   In file included from
   /projects/OpenPilot/git/ground/openpilotgcs/src/plugins/notify/notifypluginoptionspage.cpp:47:0:
   /projects/OpenPilot/git/ground/openpilotgcs/src/plugins/notify/notifytablemodel.h:86:39:
   error: reference ‘_list’ cannot be declared ‘mutable’ [-fpermissive]

   implemented solution:
   removed the mutable flag, as this is wrongly used on a reference (and
   therefore correctly causing a compile-time error
This commit is contained in:
Michael Rumpler 2012-01-11 22:16:26 +01:00
parent b212d0d594
commit 1b314ee256
4 changed files with 9 additions and 9 deletions

View File

@ -29,7 +29,7 @@
#ifndef NOTIFYLOGGING_H
#define NOTIFYLOGGING_H
#include "QDebug.h"
#include "qdebug.h"
#define DEBUG_NOTIFIES_ENABLE

View File

@ -101,7 +101,7 @@ void SoundNotifyPlugin::saveConfig( QSettings* settings, UAVConfigInfo *configIn
}
void SoundNotifyPlugin::readConfig( QSettings* settings, UAVConfigInfo *configInfo)
void SoundNotifyPlugin::readConfig( QSettings* settings, UAVConfigInfo * /* configInfo */)
{
// Just for migration to the new format.
//Q_ASSERT(configInfo->version() == UAVConfigVersion());
@ -350,7 +350,7 @@ void SoundNotifyPlugin::stateChanged(Phonon::State newstate, Phonon::State oldst
}
}
bool checkRange(QString fieldValue, QString enumValue, QStringList values, int direction)
bool checkRange(QString fieldValue, QString enumValue, QStringList /* values */, int direction)
{
bool ret = false;
@ -395,7 +395,7 @@ bool checkRange(double fieldValue, double min, double max, int direction)
void SoundNotifyPlugin::checkNotificationRule(NotificationItem* notification, UAVObject* object)
{
if(notification->getDataObject()!=object->getName() | object->getField(notification->getObjectField())==NULL)
if(notification->getDataObject()!=object->getName() || object->getField(notification->getObjectField())==NULL)
return;
bool condition=false;

View File

@ -70,7 +70,7 @@ NotifyPluginOptionsPage::NotifyPluginOptionsPage(QObject *parent)
NotifyPluginOptionsPage::~NotifyPluginOptionsPage()
{}
QWidget *NotifyPluginOptionsPage::createPage(QWidget *parent)
QWidget *NotifyPluginOptionsPage::createPage(QWidget * /* parent */)
{
_optionsPage.reset(new Ui::NotifyPluginOptionsPage());
//main widget
@ -448,7 +448,7 @@ void NotifyPluginOptionsPage::updateConfigView(NotificationItem* notification)
}
void NotifyPluginOptionsPage::on_changedIndex_rangeValue(QString rangeStr)
void NotifyPluginOptionsPage::on_changedIndex_rangeValue(QString /* rangeStr */)
{
Q_ASSERT(_dynamicFieldWidget);
UAVObjectField* field = getObjectFieldFromSelected();
@ -509,7 +509,7 @@ void NotifyPluginOptionsPage::on_changedIndex_soundLanguage(int index)
}
void NotifyPluginOptionsPage::on_changed_playButtonText(Phonon::State newstate, Phonon::State oldstate)
void NotifyPluginOptionsPage::on_changed_playButtonText(Phonon::State newstate, Phonon::State /* oldstate */)
{
//Q_ASSERT(Phonon::ErrorState != newstate);
@ -524,7 +524,7 @@ void NotifyPluginOptionsPage::on_changed_playButtonText(Phonon::State newstate,
}
}
void NotifyPluginOptionsPage::on_changedSelection_notifyTable(const QItemSelection & selected, const QItemSelection & deselected )
void NotifyPluginOptionsPage::on_changedSelection_notifyTable(const QItemSelection & selected, const QItemSelection & /* deselected */ )
{
bool select = false;
_testSound->stop();

View File

@ -83,7 +83,7 @@ private slots:
void dropRows(int position, int count) const;
private:
mutable QList<NotificationItem*>& _list;
QList<NotificationItem*>& _list;
QStringList _headerStrings;
};