mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-05 01:45:53 +00:00
fix some found warning
This commit is contained in:
@ -79,7 +79,7 @@ public slots:
|
||||
virtual void readConfiguration();
|
||||
virtual QVariantHash run() = 0;
|
||||
virtual int showConfiguration(const QVariant &_args) = 0;
|
||||
virtual bool tryDelete() const;
|
||||
[[nodiscard]] virtual bool tryDelete() const;
|
||||
virtual void writeConfiguration() const;
|
||||
|
||||
private slots:
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
void editItem();
|
||||
QString getName();
|
||||
virtual void initItems() = 0;
|
||||
AbstractExtItem *itemFromWidget() const;
|
||||
[[nodiscard]] AbstractExtItem *itemFromWidget() const;
|
||||
void repaintList() const;
|
||||
[[nodiscard]] int uniqNumber() const;
|
||||
// get methods
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
{
|
||||
return dynamic_cast<AbstractExtItem *>(parent())->tag(_type);
|
||||
};
|
||||
virtual QUrl url() const = 0;
|
||||
[[nodiscard]] virtual QUrl url() const = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
|
||||
public slots:
|
||||
void readConfiguration() override;
|
||||
QVariantHash run() override { return QVariantHash(); };
|
||||
QVariantHash run() override { return {}; };
|
||||
void writeConfiguration() const override;
|
||||
|
||||
private:
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include <KI18n/KLocalizedString>
|
||||
|
||||
#include <QDir>
|
||||
#include <QSettings>
|
||||
#include <QTextCodec>
|
||||
|
||||
|
@ -100,7 +100,7 @@ QString GraphicalItem::image(const QVariant &value)
|
||||
|
||||
m_scene->clear();
|
||||
int scale[2] = {1, 1};
|
||||
float converted = m_helper->getPercents(value.toFloat(), minValue(), maxValue());
|
||||
float converted = GraphicalItemHelper::getPercents(value.toFloat(), minValue(), maxValue());
|
||||
|
||||
// paint
|
||||
switch (m_type) {
|
||||
@ -457,12 +457,12 @@ int GraphicalItem::showConfiguration(const QVariant &_args)
|
||||
ui->doubleSpinBox_max->setValue(maxValue());
|
||||
ui->doubleSpinBox_min->setValue(minValue());
|
||||
ui->spinBox_count->setValue(count());
|
||||
if (m_helper->isColor(activeColor()))
|
||||
if (GraphicalItemHelper::isColor(activeColor()))
|
||||
ui->comboBox_activeImageType->setCurrentIndex(0);
|
||||
else
|
||||
ui->comboBox_activeImageType->setCurrentIndex(1);
|
||||
ui->lineEdit_activeColor->setText(activeColor());
|
||||
if (m_helper->isColor(inactiveColor()))
|
||||
if (GraphicalItemHelper::isColor(inactiveColor()))
|
||||
ui->comboBox_inactiveImageType->setCurrentIndex(0);
|
||||
else
|
||||
ui->comboBox_inactiveImageType->setCurrentIndex(1);
|
||||
@ -539,7 +539,7 @@ void GraphicalItem::changeColor()
|
||||
|
||||
QString outputColor;
|
||||
if (state == 0) {
|
||||
QColor color = m_helper->stringToColor(lineEdit->text());
|
||||
QColor color = GraphicalItemHelper::stringToColor(lineEdit->text());
|
||||
QColor newColor = QColorDialog::getColor(color, this, i18n("Select color"), QColorDialog::ShowAlphaChannel);
|
||||
if (!newColor.isValid())
|
||||
return;
|
||||
|
@ -91,7 +91,7 @@ public:
|
||||
|
||||
public slots:
|
||||
void readConfiguration() override;
|
||||
QVariantHash run() override { return QVariantHash(); };
|
||||
QVariantHash run() override { return {}; };
|
||||
int showConfiguration(const QVariant &_args) override;
|
||||
void writeConfiguration() const override;
|
||||
|
||||
|
@ -135,7 +135,7 @@ QList<int> QCronScheduler::QCronField::toList()
|
||||
{
|
||||
// error checking
|
||||
if ((minValue == -1) || (maxValue == -1))
|
||||
return QList<int>();
|
||||
return {};
|
||||
|
||||
QList<int> output;
|
||||
for (auto &i = minValue; i <= maxValue; ++i) {
|
||||
|
@ -57,7 +57,7 @@ QVariantHash YahooWeatherProvider::parse(const QVariantMap &_json) const
|
||||
QVariantMap jsonMap = _json["query"].toMap();
|
||||
if (jsonMap["count"].toInt() != 1) {
|
||||
qCWarning(LOG_LIB) << "Found data count" << _json["count"].toInt() << "is not 1";
|
||||
return QVariantHash();
|
||||
return {};
|
||||
}
|
||||
QVariantMap results = jsonMap["results"].toMap()["channel"].toMap();
|
||||
QVariantMap item = results["item"].toMap();
|
||||
|
Reference in New Issue
Block a user