1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-31 16:52:10 +01:00

gcs: fix compilation warnings

This commit is contained in:
U-BAMS\philippe.renon 2022-08-18 21:10:51 +02:00
parent b3f20cd9e3
commit bc18da54de
38 changed files with 55 additions and 60 deletions

View File

@ -50,7 +50,7 @@ public:
template <typename T> T *component() template <typename T> T *component()
{ {
QReadLocker(&lock()); QReadLocker &lock();
foreach(QObject * component, m_components) { foreach(QObject * component, m_components) {
if (T * result = qobject_cast<T *>(component)) { if (T * result = qobject_cast<T *>(component)) {
return result; return result;
@ -61,7 +61,7 @@ public:
template <typename T> QList<T *> components() template <typename T> QList<T *> components()
{ {
QReadLocker(&lock()); QReadLocker &lock();
QList<T *> results; QList<T *> results;
foreach(QObject * component, m_components) { foreach(QObject * component, m_components) {
if (T * result = qobject_cast<T *>(component)) { if (T * result = qobject_cast<T *>(component)) {
@ -99,7 +99,7 @@ template <typename T> T *query(QObject *obj)
} }
T *result = qobject_cast<T *>(obj); T *result = qobject_cast<T *>(obj);
if (!result) { if (!result) {
QReadLocker(&lock()); QReadLocker &lock();
Aggregate *parentAggregation = Aggregate::parentAggregate(obj); Aggregate *parentAggregation = Aggregate::parentAggregate(obj);
result = (parentAggregation ? query<T>(parentAggregation) : 0); result = (parentAggregation ? query<T>(parentAggregation) : 0);
} }
@ -120,7 +120,7 @@ template <typename T> QList<T *> query_all(QObject *obj)
if (!obj) { if (!obj) {
return QList<T *>(); return QList<T *>();
} }
QReadLocker(&lock()); QReadLocker &lock();
Aggregate *parentAggregation = Aggregate::parentAggregate(obj); Aggregate *parentAggregation = Aggregate::parentAggregate(obj);
QList<T *> results; QList<T *> results;
if (parentAggregation) { if (parentAggregation) {

View File

@ -730,7 +730,7 @@ void PluginManagerPrivate::readPluginPaths()
} }
resolveDependencies(); resolveDependencies();
// ensure deterministic plugin load order by sorting // ensure deterministic plugin load order by sorting
qSort(pluginSpecs.begin(), pluginSpecs.end(), lessThanByPluginName); std::sort(pluginSpecs.begin(), pluginSpecs.end(), lessThanByPluginName);
emit q->pluginsChanged(); emit q->pluginsChanged();
} }

View File

@ -129,7 +129,7 @@ void PluginView::updateList()
item->setToolTip(4, QDir::toNativeSeparators(spec->filePath())); item->setToolTip(4, QDir::toNativeSeparators(spec->filePath()));
item->setIcon(0, spec->hasError() ? errorIcon : okIcon); item->setIcon(0, spec->hasError() ? errorIcon : okIcon);
item->setData(0, Qt::UserRole, qVariantFromValue(spec)); item->setData(0, Qt::UserRole, QVariant::fromValue(spec));
items.append(item); items.append(item);
if (currPlugin == spec) { if (currPlugin == spec) {
currentItem = item; currentItem = item;

View File

@ -63,7 +63,7 @@ QString Cache::GetGeocoderFromCache(const QString &urlEnd)
#ifdef DEBUG_GetGeocoderFromCache #ifdef DEBUG_GetGeocoderFromCache
qDebug() << "Entered GetGeocoderFromCache"; qDebug() << "Entered GetGeocoderFromCache";
#endif #endif
QString ret = QString::null; QString ret = QString();
QString filename = geoCache + QString(urlEnd) + ".geo"; QString filename = geoCache + QString(urlEnd) + ".geo";
#ifdef DEBUG_GetGeocoderFromCache #ifdef DEBUG_GetGeocoderFromCache
qDebug() << "GetGeocoderFromCache: Does file exist?:" << filename; qDebug() << "GetGeocoderFromCache: Does file exist?:" << filename;
@ -87,7 +87,7 @@ QString Cache::GetGeocoderFromCache(const QString &urlEnd)
} }
void Cache::CacheGeocoder(const QString &urlEnd, const QString &content) void Cache::CacheGeocoder(const QString &urlEnd, const QString &content)
{ {
QString ret = QString::null; QString ret = QString();
QString filename = geoCache + QString(urlEnd) + ".geo"; QString filename = geoCache + QString(urlEnd) + ".geo";
#ifdef DEBUG_CACHE #ifdef DEBUG_CACHE
@ -127,7 +127,7 @@ QString Cache::GetPlacemarkFromCache(const QString &urlEnd)
#ifdef DEBUG_CACHE #ifdef DEBUG_CACHE
qDebug() << "Entered GetPlacemarkFromCache"; qDebug() << "Entered GetPlacemarkFromCache";
#endif // DEBUG_CACHE #endif // DEBUG_CACHE
QString ret = QString::null; QString ret = QString();
QString filename = placemarkCache + QString(urlEnd) + ".plc"; QString filename = placemarkCache + QString(urlEnd) + ".plc";
#ifdef DEBUG_CACHE #ifdef DEBUG_CACHE
qDebug() << "GetPlacemarkFromCache: Does file exist?:" << filename; qDebug() << "GetPlacemarkFromCache: Does file exist?:" << filename;
@ -151,7 +151,7 @@ QString Cache::GetPlacemarkFromCache(const QString &urlEnd)
} }
void Cache::CachePlacemark(const QString &urlEnd, const QString &content) void Cache::CachePlacemark(const QString &urlEnd, const QString &content)
{ {
QString ret = QString::null; QString ret = QString();
QString filename = placemarkCache + QString(urlEnd) + ".plc"; QString filename = placemarkCache + QString(urlEnd) + ".plc";
#ifdef DEBUG_CACHE #ifdef DEBUG_CACHE

View File

@ -465,7 +465,7 @@ QString UrlFactory::MakeImageUrl(const MapType::Types &type, const Point &pos, c
break; break;
} }
return QString::null; return QString();
} }
void UrlFactory::GetSecGoogleWords(const Point &pos, QString &sec1, QString &sec2) void UrlFactory::GetSecGoogleWords(const Point &pos, QString &sec1, QString &sec2)
{ {

View File

@ -95,7 +95,7 @@ QMap<double, QString> QwtCompassScaleDraw::labelMap() const
label() looks in the labelMap() for a corresponding label for value label() looks in the labelMap() for a corresponding label for value
or returns an null text. or returns an null text.
\return Label, or QString::null \return Label, or QString()
\sa labelMap(), setLabelMap() \sa labelMap(), setLabelMap()
*/ */

View File

@ -155,7 +155,7 @@ void QwtCounter::setValid( bool on )
} }
else else
{ {
d_data->valueEdit->setText( QString::null ); d_data->valueEdit->setText( QString() );
} }
} }
} }

View File

@ -157,7 +157,7 @@ QString QwtDateScaleDraw::dateFormat(
return d_data->dateFormats[ intervalType ]; return d_data->dateFormats[ intervalType ];
} }
return QString::null; return QString();
} }
/*! /*!

View File

@ -67,7 +67,7 @@ public:
LegendBarTitles LegendBarTitles
}; };
explicit QwtPlotBarChart( const QString &title = QString::null ); explicit QwtPlotBarChart( const QString &title = QString() );
explicit QwtPlotBarChart( const QwtText &title ); explicit QwtPlotBarChart( const QwtText &title );
virtual ~QwtPlotBarChart(); virtual ~QwtPlotBarChart();

View File

@ -210,7 +210,7 @@ public:
//! Paint attributes //! Paint attributes
typedef QFlags<PaintAttribute> PaintAttributes; typedef QFlags<PaintAttribute> PaintAttributes;
explicit QwtPlotCurve( const QString &title = QString::null ); explicit QwtPlotCurve( const QString &title = QString() );
explicit QwtPlotCurve( const QwtText &title ); explicit QwtPlotCurve( const QwtText &title );
virtual ~QwtPlotCurve(); virtual ~QwtPlotCurve();

View File

@ -76,7 +76,7 @@ public:
UserStyle = 100 UserStyle = 100
}; };
explicit QwtPlotHistogram( const QString &title = QString::null ); explicit QwtPlotHistogram( const QString &title = QString() );
explicit QwtPlotHistogram( const QwtText &title ); explicit QwtPlotHistogram( const QwtText &title );
virtual ~QwtPlotHistogram(); virtual ~QwtPlotHistogram();

View File

@ -76,7 +76,7 @@ public:
//! Paint attributes //! Paint attributes
typedef QFlags<PaintAttribute> PaintAttributes; typedef QFlags<PaintAttribute> PaintAttributes;
explicit QwtPlotIntervalCurve( const QString &title = QString::null ); explicit QwtPlotIntervalCurve( const QString &title = QString() );
explicit QwtPlotIntervalCurve( const QwtText &title ); explicit QwtPlotIntervalCurve( const QwtText &title );
virtual ~QwtPlotIntervalCurve(); virtual ~QwtPlotIntervalCurve();

View File

@ -68,7 +68,7 @@ public:
Cross Cross
}; };
explicit QwtPlotMarker( const QString &title = QString::null ); explicit QwtPlotMarker( const QString &title = QString() );
explicit QwtPlotMarker( const QwtText &title ); explicit QwtPlotMarker( const QwtText &title );
virtual ~QwtPlotMarker(); virtual ~QwtPlotMarker();

View File

@ -61,7 +61,7 @@ public:
Stacked Stacked
}; };
explicit QwtPlotMultiBarChart( const QString &title = QString::null ); explicit QwtPlotMultiBarChart( const QString &title = QString() );
explicit QwtPlotMultiBarChart( const QwtText &title ); explicit QwtPlotMultiBarChart( const QwtText &title );
virtual ~QwtPlotMultiBarChart(); virtual ~QwtPlotMultiBarChart();

View File

@ -83,7 +83,7 @@ public:
//! Paint attributes //! Paint attributes
typedef QFlags<PaintAttribute> PaintAttributes; typedef QFlags<PaintAttribute> PaintAttributes;
explicit QwtPlotRasterItem( const QString& title = QString::null ); explicit QwtPlotRasterItem( const QString& title = QString() );
explicit QwtPlotRasterItem( const QwtText& title ); explicit QwtPlotRasterItem( const QwtText& title );
virtual ~QwtPlotRasterItem(); virtual ~QwtPlotRasterItem();

View File

@ -23,7 +23,7 @@ class QWT_EXPORT QwtPlotSeriesItem: public QwtPlotItem,
public virtual QwtAbstractSeriesStore public virtual QwtAbstractSeriesStore
{ {
public: public:
explicit QwtPlotSeriesItem( const QString &title = QString::null ); explicit QwtPlotSeriesItem( const QString &title = QString() );
explicit QwtPlotSeriesItem( const QwtText &title ); explicit QwtPlotSeriesItem( const QwtText &title );
virtual ~QwtPlotSeriesItem(); virtual ~QwtPlotSeriesItem();

View File

@ -64,7 +64,7 @@ public:
LegendColor LegendColor
}; };
explicit QwtPlotShapeItem( const QString &title = QString::null ); explicit QwtPlotShapeItem( const QString &title = QString() );
explicit QwtPlotShapeItem( const QwtText &title ); explicit QwtPlotShapeItem( const QwtText &title );
virtual ~QwtPlotShapeItem(); virtual ~QwtPlotShapeItem();

View File

@ -35,7 +35,7 @@ public:
//! Paint attributes //! Paint attributes
typedef QFlags<PaintAttribute> PaintAttributes; typedef QFlags<PaintAttribute> PaintAttributes;
explicit QwtPlotSpectroCurve( const QString &title = QString::null ); explicit QwtPlotSpectroCurve( const QString &title = QString() );
explicit QwtPlotSpectroCurve( const QwtText &title ); explicit QwtPlotSpectroCurve( const QwtText &title );
virtual ~QwtPlotSpectroCurve(); virtual ~QwtPlotSpectroCurve();

View File

@ -55,7 +55,7 @@ public:
//! Display modes //! Display modes
typedef QFlags<DisplayMode> DisplayModes; typedef QFlags<DisplayMode> DisplayModes;
explicit QwtPlotSpectrogram( const QString &title = QString::null ); explicit QwtPlotSpectrogram( const QString &title = QString() );
virtual ~QwtPlotSpectrogram(); virtual ~QwtPlotSpectrogram();
void setDisplayMode( DisplayMode, bool on = true ); void setDisplayMode( DisplayMode, bool on = true );

View File

@ -27,7 +27,7 @@ class QByteArray;
class QWT_EXPORT QwtPlotSvgItem: public QwtPlotItem class QWT_EXPORT QwtPlotSvgItem: public QwtPlotItem
{ {
public: public:
explicit QwtPlotSvgItem( const QString& title = QString::null ); explicit QwtPlotSvgItem( const QString& title = QString() );
explicit QwtPlotSvgItem( const QwtText& title ); explicit QwtPlotSvgItem( const QwtText& title );
virtual ~QwtPlotSvgItem(); virtual ~QwtPlotSvgItem();

View File

@ -101,7 +101,7 @@ public:
//! Paint attributes //! Paint attributes
typedef QFlags<PaintAttribute> PaintAttributes; typedef QFlags<PaintAttribute> PaintAttributes;
explicit QwtPlotTradingCurve( const QString &title = QString::null ); explicit QwtPlotTradingCurve( const QString &title = QString() );
explicit QwtPlotTradingCurve( const QwtText &title ); explicit QwtPlotTradingCurve( const QwtText &title );
virtual ~QwtPlotTradingCurve(); virtual ~QwtPlotTradingCurve();

View File

@ -28,7 +28,7 @@ void QwtPlot::applyProperties( const QString & /* xmlDocument */ )
This method is intended for manipulating the plot widget This method is intended for manipulating the plot widget
from a specific editor in the Qwt designer plugin. from a specific editor in the Qwt designer plugin.
\return QString::null \return QString()
\warning The plot editor has never been implemented. \warning The plot editor has never been implemented.
*/ */
QString QwtPlot::grabProperties() const QString QwtPlot::grabProperties() const
@ -37,6 +37,6 @@ QString QwtPlot::grabProperties() const
// Temporary dummy code, for designer tests // Temporary dummy code, for designer tests
return title().text(); return title().text();
#else #else
return QString::null; return QString();
#endif #endif
} }

View File

@ -139,7 +139,7 @@ public:
//! Layout attributes //! Layout attributes
typedef QFlags<LayoutAttribute> LayoutAttributes; typedef QFlags<LayoutAttribute> LayoutAttributes;
QwtText( const QString & = QString::null, QwtText( const QString & = QString(),
TextFormat textFormat = AutoText ); TextFormat textFormat = AutoText );
QwtText( const QwtText & ); QwtText( const QwtText & );
~QwtText(); ~QwtText();

View File

@ -560,9 +560,9 @@ void QwtThermo::drawLiquid(
QVector<double> values = qwtTickList( scaleDraw()->scaleDiv() ); QVector<double> values = qwtTickList( scaleDraw()->scaleDiv() );
if ( scaleMap.isInverting() ) if ( scaleMap.isInverting() )
qSort( values.begin(), values.end(), qGreater<double>() ); std::sort( values.begin(), values.end(), qGreater<double>() );
else else
qSort( values.begin(), values.end(), qLess<double>() ); std::sort( values.begin(), values.end(), qLess<double>() );
int from; int from;
if ( !values.isEmpty() ) if ( !values.isEmpty() )

View File

@ -52,7 +52,7 @@ class QTCREATOR_UTILS_EXPORT WelcomeModeTreeWidget : public QTreeWidget {
public: public:
WelcomeModeTreeWidget(QWidget *parent = 0); WelcomeModeTreeWidget(QWidget *parent = 0);
~WelcomeModeTreeWidget(); ~WelcomeModeTreeWidget();
QTreeWidgetItem *addItem(const QString &label, const QString &data, const QString &toolTip = QString::null); QTreeWidgetItem *addItem(const QString &label, const QString &data, const QString &toolTip = QString());
public slots: public slots:
void slotAddNewsItem(const QString &title, const QString &description, const QString &link); void slotAddNewsItem(const QString &title, const QString &description, const QString &link);

View File

@ -54,7 +54,7 @@ QWidget *AntennaTrackGadgetOptionsPage::createPage(QWidget *parent)
// PORTS // PORTS
QList<QSerialPortInfo> ports = QSerialPortInfo::availablePorts(); QList<QSerialPortInfo> ports = QSerialPortInfo::availablePorts();
qSort(ports.begin(), ports.end(), sortPorts); std::sort(ports.begin(), ports.end(), sortPorts);
foreach(QSerialPortInfo port, ports) { foreach(QSerialPortInfo port, ports) {
qDebug() << "Adding port: " << port.systemLocation() << " (" << port.portName() << ")"; qDebug() << "Adding port: " << port.systemLocation() << " (" << port.portName() << ")";
options_page->portComboBox->addItem(port.portName(), port.portName()); options_page->portComboBox->addItem(port.portName(), port.portName());

View File

@ -168,10 +168,10 @@ Q_DECLARE_METATYPE(::PageData) SettingsDialog::SettingsDialog(QWidget *parent, c
// the plugin options page list is sorted by untranslated category and names // the plugin options page list is sorted by untranslated category and names
// this is done to facilitate access to the language settings when GCS is not running in a language understood by the user. // this is done to facilitate access to the language settings when GCS is not running in a language understood by the user.
qStableSort(pluginPages.begin(), pluginPages.end(), compareOptionsPageByCategoryAndId); std::stable_sort(pluginPages.begin(), pluginPages.end(), compareOptionsPageByCategoryAndId);
// the plugin options page list is sorted by translated names // the plugin options page list is sorted by translated names
qStableSort(gadgetPages.begin(), gadgetPages.end(), compareOptionsPageByCategoryAndNameTr); std::stable_sort(gadgetPages.begin(), gadgetPages.end(), compareOptionsPageByCategoryAndNameTr);
// will hold the initially selected item if any // will hold the initially selected item if any
QTreeWidgetItem *initialItem = 0; QTreeWidgetItem *initialItem = 0;
@ -256,12 +256,12 @@ QTreeWidgetItem *SettingsDialog::addPage(IOptionsPage *page)
categoryItem = new QTreeWidgetItem(pageTree); categoryItem = new QTreeWidgetItem(pageTree);
categoryItem->setIcon(0, page->icon()); categoryItem->setIcon(0, page->icon());
categoryItem->setText(0, page->trCategory()); categoryItem->setText(0, page->trCategory());
categoryItem->setData(0, Qt::UserRole, qVariantFromValue(pageData)); categoryItem->setData(0, Qt::UserRole, QVariant::fromValue(pageData));
} }
QTreeWidgetItem *item = new QTreeWidgetItem(categoryItem); QTreeWidgetItem *item = new QTreeWidgetItem(categoryItem);
item->setText(0, page->trName()); item->setText(0, page->trName());
item->setData(0, Qt::UserRole, qVariantFromValue(pageData)); item->setData(0, Qt::UserRole, QVariant::fromValue(pageData));
switch (categoryItemList->size()) { switch (categoryItemList->size()) {
case 0: case 0:
@ -390,7 +390,7 @@ void SettingsDialog::insertPage(IOptionsPage *page)
QTreeWidgetItem *item = new QTreeWidgetItem; QTreeWidgetItem *item = new QTreeWidgetItem;
item->setText(0, page->trName()); item->setText(0, page->trName());
item->setData(0, Qt::UserRole, qVariantFromValue(pageData)); item->setData(0, Qt::UserRole, QVariant::fromValue(pageData));
categoryItem->addChild(item); categoryItem->addChild(item);
categoryItemList->append(item); categoryItemList->append(item);

View File

@ -318,7 +318,7 @@ void ShortcutSettings::initialize()
} }
item->setText(2, s->m_key.toString()); item->setText(2, s->m_key.toString());
item->setData(0, Qt::UserRole, qVariantFromValue(s)); item->setData(0, Qt::UserRole, QVariant::fromValue(s));
} }
} }

View File

@ -108,7 +108,7 @@ void DialGadgetWidget::connectNeedles(QString object1, QString nfield1,
// qDebug() << "Connected Object 1 (" << object1 << ")."; // qDebug() << "Connected Object 1 (" << object1 << ").";
connect(obj1, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateNeedle1(UAVObject *))); connect(obj1, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateNeedle1(UAVObject *)));
if (nfield1.contains("-")) { if (nfield1.contains("-")) {
QStringList fieldSubfield = nfield1.split("-", QString::SkipEmptyParts); QStringList fieldSubfield = nfield1.split("-", Qt::SkipEmptyParts);
field1 = fieldSubfield.at(0); field1 = fieldSubfield.at(0);
subfield1 = fieldSubfield.at(1); subfield1 = fieldSubfield.at(1);
haveSubField1 = true; haveSubField1 = true;
@ -128,7 +128,7 @@ void DialGadgetWidget::connectNeedles(QString object1, QString nfield1,
// qDebug() << "Connected Object 2 (" << object2 << ")."; // qDebug() << "Connected Object 2 (" << object2 << ").";
connect(obj2, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateNeedle2(UAVObject *))); connect(obj2, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateNeedle2(UAVObject *)));
if (nfield2.contains("-")) { if (nfield2.contains("-")) {
QStringList fieldSubfield = nfield2.split("-", QString::SkipEmptyParts); QStringList fieldSubfield = nfield2.split("-", Qt::SkipEmptyParts);
field2 = fieldSubfield.at(0); field2 = fieldSubfield.at(0);
subfield2 = fieldSubfield.at(1); subfield2 = fieldSubfield.at(1);
haveSubField2 = true; haveSubField2 = true;
@ -148,7 +148,7 @@ void DialGadgetWidget::connectNeedles(QString object1, QString nfield1,
// qDebug() << "Connected Object 3 (" << object3 << ")."; // qDebug() << "Connected Object 3 (" << object3 << ").";
connect(obj3, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateNeedle3(UAVObject *))); connect(obj3, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateNeedle3(UAVObject *)));
if (nfield3.contains("-")) { if (nfield3.contains("-")) {
QStringList fieldSubfield = nfield3.split("-", QString::SkipEmptyParts); QStringList fieldSubfield = nfield3.split("-", Qt::SkipEmptyParts);
field3 = fieldSubfield.at(0); field3 = fieldSubfield.at(0);
subfield3 = fieldSubfield.at(1); subfield3 = fieldSubfield.at(1);
haveSubField3 = true; haveSubField3 = true;

View File

@ -55,7 +55,7 @@ QWidget *GpsDisplayGadgetOptionsPage::createPage(QWidget *parent)
// PORTS // PORTS
QList<QSerialPortInfo> ports = QSerialPortInfo::availablePorts(); QList<QSerialPortInfo> ports = QSerialPortInfo::availablePorts();
qSort(ports.begin(), ports.end(), sortPorts); std::sort(ports.begin(), ports.end(), sortPorts);
foreach(QSerialPortInfo port, ports) { foreach(QSerialPortInfo port, ports) {
qDebug() << "Adding port: " << port.systemLocation() << " (" << port.portName() << ")"; qDebug() << "Adding port: " << port.systemLocation() << " (" << port.portName() << ")";
options_page->portComboBox->addItem(port.portName(), port.portName()); options_page->portComboBox->addItem(port.portName(), port.portName());

View File

@ -91,7 +91,7 @@ void LineardialGadgetWidget::connectInput(QString object1, QString nfield1)
if (obj1 != NULL) { if (obj1 != NULL) {
connect(obj1, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateIndex(UAVObject *))); connect(obj1, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateIndex(UAVObject *)));
if (nfield1.contains("-")) { if (nfield1.contains("-")) {
QStringList fieldSubfield = nfield1.split("-", QString::SkipEmptyParts); QStringList fieldSubfield = nfield1.split("-", Qt::SkipEmptyParts);
field1 = fieldSubfield.at(0); field1 = fieldSubfield.at(0);
subfield1 = fieldSubfield.at(1); subfield1 = fieldSubfield.at(1);
haveSubField1 = true; haveSubField1 = true;

View File

@ -460,7 +460,7 @@ void SoundNotifyPlugin::checkNotificationRule(NotificationItem *notification, UA
qNotifyDebug() << "add to pending list - " << notification->toString(); qNotifyDebug() << "add to pending list - " << notification->toString();
// if audio is busy, start expiration timer // if audio is busy, start expiration timer
// ms = (notification->getExpiredTimeout()[in sec])*1000 // ms = (notification->getExpiredTimeout()[in sec])*1000
// QxtTimer::singleShot(notification->getExpireTimeout()*1000, this, SLOT(expirationTimerHandler(NotificationItem*)), qVariantFromValue(notification)); // QxtTimer::singleShot(notification->getExpireTimeout()*1000, this, SLOT(expirationTimerHandler(NotificationItem*)), QVariant::fromValue(notification));
_pendingNotifications.append(notification); _pendingNotifications.append(notification);
notification->startExpireTimer(); notification->startExpireTimer();
connect(notification->getExpireTimer(), SIGNAL(timeout()), connect(notification->getExpireTimer(), SIGNAL(timeout()),

View File

@ -355,7 +355,7 @@ void ScopeGadgetWidget::addCurvePlot(QString objectName, QString fieldPlusSubFie
int element = 0; int element = 0;
if (fieldPlusSubField.contains("-")) { if (fieldPlusSubField.contains("-")) {
QStringList fieldSubfield = fieldName.split("-", QString::SkipEmptyParts); QStringList fieldSubfield = fieldName.split("-", Qt::SkipEmptyParts);
fieldName = fieldSubfield.at(0); fieldName = fieldSubfield.at(0);
elementName = fieldSubfield.at(1); elementName = fieldSubfield.at(1);
} }

View File

@ -137,7 +137,7 @@ QList <Core::IConnection::device> SerialConnection::availableDevices()
QList<QSerialPortInfo> ports = availablePorts(); QList<QSerialPortInfo> ports = availablePorts();
// sort the list by port number (nice idea from PT_Dreamer :)) // sort the list by port number (nice idea from PT_Dreamer :))
qSort(ports.begin(), ports.end(), sortPorts); std::sort(ports.begin(), ports.end(), sortPorts);
foreach(QSerialPortInfo port, ports) { foreach(QSerialPortInfo port, ports) {
device d; device d;

View File

@ -606,7 +606,7 @@ QVariant UAVObjectTreeModel::data(const QModelIndex &index, int role) const
case Qt::UserRole: case Qt::UserRole:
// UserRole gives access to TreeItem // UserRole gives access to TreeItem
// cast to void* is necessary // cast to void* is necessary
return qVariantFromValue((void *)item); return QVariant::fromValue((void *)item);
default: default:
return QVariant(); return QVariant();

View File

@ -206,7 +206,7 @@ void UploaderGadgetWidget::getSerialPorts()
QList<QSerialPortInfo> ports = QSerialPortInfo::availablePorts(); QList<QSerialPortInfo> ports = QSerialPortInfo::availablePorts();
// sort the list by port number (nice idea from PT_Dreamer :)) // sort the list by port number (nice idea from PT_Dreamer :))
qSort(ports.begin(), ports.end(), sortPorts); std::sort(ports.begin(), ports.end(), sortPorts);
foreach(QSerialPortInfo port, ports) { foreach(QSerialPortInfo port, ports) {
list.append(port.portName()); list.append(port.portName());
} }

View File

@ -76,7 +76,7 @@ struct Context {
struct FieldContext { struct FieldContext {
FieldContext(FieldInfo *fieldInfo, ObjectInfo *object); FieldContext(FieldInfo *fieldInfo, ObjectInfo *object);
FieldContext(const FieldContext &fieldContext); FieldContext(const FieldContext &fieldContext) = default;
FieldInfo *field; FieldInfo *field;
// field // field
@ -617,11 +617,6 @@ bool UAVObjectGeneratorGCS::generate(UAVObjectParser *parser, QString templatepa
return true; return true;
} }
FieldContext::FieldContext(const FieldContext &fieldContext)
{
*this = fieldContext;
}
FieldContext::FieldContext(FieldInfo *fieldInfo, ObjectInfo *object) FieldContext::FieldContext(FieldInfo *fieldInfo, ObjectInfo *object)
{ {
field = fieldInfo; field = fieldInfo;

View File

@ -223,7 +223,7 @@ QString UAVObjectParser::parseXML(QString & xml, QString & filename)
} }
// Sort all fields according to size // Sort all fields according to size
qStableSort(info->fields.begin(), info->fields.end(), fieldTypeLessThan); std::stable_sort(info->fields.begin(), info->fields.end(), fieldTypeLessThan);
// Make sure that required elements were found // Make sure that required elements were found
if (!fieldFound) { if (!fieldFound) {
@ -528,7 +528,7 @@ QString UAVObjectParser::processObjectFields(QDomNode & childNode, ObjectInfo *i
return QString("Object:field:elementnames attribute is not allowed for cloned fields"); return QString("Object:field:elementnames attribute is not allowed for cloned fields");
} }
// Get element names // Get element names
QStringList names = elemAttr.nodeValue().split(",", QString::SkipEmptyParts); QStringList names = elemAttr.nodeValue().split(",", Qt::SkipEmptyParts);
for (int n = 0; n < names.length(); ++n) { for (int n = 0; n < names.length(); ++n) {
names[n] = names[n].trimmed(); names[n] = names[n].trimmed();
} }
@ -581,7 +581,7 @@ QString UAVObjectParser::processObjectFields(QDomNode & childNode, ObjectInfo *i
QStringList options; QStringList options;
elemAttr = elemAttributes.namedItem("options"); elemAttr = elemAttributes.namedItem("options");
if (!elemAttr.isNull()) { if (!elemAttr.isNull()) {
options = elemAttr.nodeValue().split(",", QString::SkipEmptyParts); options = elemAttr.nodeValue().split(",", Qt::SkipEmptyParts);
for (int n = 0; n < options.length(); ++n) { for (int n = 0; n < options.length(); ++n) {
options[n] = options[n].trimmed(); options[n] = options[n].trimmed();
} }
@ -623,7 +623,7 @@ QString UAVObjectParser::processObjectFields(QDomNode & childNode, ObjectInfo *i
// Get the default value attribute (required for settings objects, optional for the rest) // Get the default value attribute (required for settings objects, optional for the rest)
elemAttr = elemAttributes.namedItem("defaultvalue"); elemAttr = elemAttributes.namedItem("defaultvalue");
if (!elemAttr.isNull()) { if (!elemAttr.isNull()) {
QStringList defaults = elemAttr.nodeValue().split(",", QString::SkipEmptyParts); QStringList defaults = elemAttr.nodeValue().split(",", Qt::SkipEmptyParts);
for (int n = 0; n < defaults.length(); ++n) { for (int n = 0; n < defaults.length(); ++n) {
defaults[n] = defaults[n].trimmed(); defaults[n] = defaults[n].trimmed();
} }