Skip to content

Commit

Permalink
fix some found warning
Browse files Browse the repository at this point in the history
  • Loading branch information
arcan1s committed May 17, 2023
1 parent e9beea2 commit 09a3c32
Show file tree
Hide file tree
Showing 23 changed files with 35 additions and 37 deletions.
4 changes: 2 additions & 2 deletions sources/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveAssignments: None
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
Expand Down
2 changes: 1 addition & 1 deletion sources/awesome-widget/plugin/awabstractpairhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ QStringList AWAbstractPairHelper::values() const
QSet<QString> AWAbstractPairHelper::valuesSet() const
{
auto values = m_pairs.values();
return QSet(values.cbegin(), values.cend());
return {values.cbegin(), values.cend()};
}


Expand Down
2 changes: 1 addition & 1 deletion sources/awesome-widget/plugin/awbugreporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AWBugReporter : public QObject
Q_INVOKABLE void sendBugReport(const QString &_title, const QString &_body);

signals:
void replyReceived(const int _number, const QString &_url);
void replyReceived(int _number, const QString &_url);

private slots:
void issueReplyRecieved(QNetworkReply *_reply);
Expand Down
2 changes: 1 addition & 1 deletion sources/awesome-widget/plugin/awcustomkeyshelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ QStringList AWCustomKeysHelper::leftKeys()

QStringList AWCustomKeysHelper::rightKeys()
{
return QStringList();
return {};
}
1 change: 0 additions & 1 deletion sources/awesome-widget/plugin/awdataengineaggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <Plasma/DataContainer>

#include "awdebug.h"
#include "awkeys.h"


AWDataEngineAggregator::AWDataEngineAggregator(QObject *_parent)
Expand Down
2 changes: 1 addition & 1 deletion sources/awesome-widget/plugin/awdbusadaptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ AWDBusAdaptor::~AWDBusAdaptor()
}


QStringList AWDBusAdaptor::ActiveServices() const
QStringList AWDBusAdaptor::ActiveServices()
{
QDBusMessage listServices = QDBusConnection::sessionBus().interface()->call(QDBus::BlockWithGui, "ListNames");
if (listServices.arguments().isEmpty()) {
Expand Down
10 changes: 5 additions & 5 deletions sources/awesome-widget/plugin/awdbusadaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class AWDBusAdaptor : public QDBusAbstractAdaptor

public slots:
// get methods
QStringList ActiveServices() const;
QString Info(const QString &key) const;
QStringList Keys(const QString &regexp) const;
QString Value(const QString &key) const;
qlonglong WhoAmI() const;
[[nodiscard]] static QStringList ActiveServices();
[[nodiscard]] QString Info(const QString &key) const;
[[nodiscard]] QStringList Keys(const QString &regexp) const;
[[nodiscard]] QString Value(const QString &key) const;
[[nodiscard]] qlonglong WhoAmI() const;
// set methods
void SetLogLevel(const QString &what, int level);
void SetLogLevel(const QString &what, const QString &level, bool enabled);
Expand Down
2 changes: 1 addition & 1 deletion sources/awesome-widget/plugin/awformatterhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void AWFormatterHelper::editPairs()

QStringList AWFormatterHelper::leftKeys()
{
return QStringList();
return {};
}


Expand Down
1 change: 0 additions & 1 deletion sources/awesome-widget/plugin/awkeyoperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "awkeyoperations.h"

#include <QDir>
#include <QJSEngine>
#include <QRegExp>
#include <QThread>

Expand Down
2 changes: 1 addition & 1 deletion sources/awesome-widget/plugin/awkeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AWKeys : public QObject
public slots:
void dataUpdated(const QString &_sourceName, const Plasma::DataEngine::Data &_data);
// dummy method required by DataEngine connections
static void modelChanged(QString, QAbstractItemModel *){};
static void modelChanged(const QString &, QAbstractItemModel *){};

signals:
void dropSourceFromDataengine(const QString &_source);
Expand Down
2 changes: 1 addition & 1 deletion sources/awesomewidgets/abstractextitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion sources/awesomewidgets/abstractextitemaggregator.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class AbstractExtItemAggregator : public QDialog
void editItem();
QString getName();
virtual void initItems() = 0;
AbstractExtItem *itemFromWidget() const;
[[nodiscard]] AbstractExtItem *itemFromWidget() const;
void repaintList() const;
[[nodiscard]] int uniqNumber() const;
// get methods
Expand Down
2 changes: 1 addition & 1 deletion sources/awesomewidgets/abstractweatherprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AbstractWeatherProvider : public QObject
{
return dynamic_cast<AbstractExtItem *>(parent())->tag(_type);
};
virtual QUrl url() const = 0;
[[nodiscard]] virtual QUrl url() const = 0;
};


Expand Down
2 changes: 1 addition & 1 deletion sources/awesomewidgets/awabstractformatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AWAbstractFormatter : public AbstractExtItem

public slots:
void readConfiguration() override;
QVariantHash run() override { return QVariantHash(); };
QVariantHash run() override { return {}; };
void writeConfiguration() const override;

private:
Expand Down
1 change: 0 additions & 1 deletion sources/awesomewidgets/extupgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include <KI18n/KLocalizedString>

#include <QDir>
#include <QSettings>
#include <QTextCodec>

Expand Down
8 changes: 4 additions & 4 deletions sources/awesomewidgets/graphicalitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion sources/awesomewidgets/graphicalitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class GraphicalItem : public AbstractExtItem

public slots:
void readConfiguration() override;
QVariantHash run() override { return QVariantHash(); };
QVariantHash run() override { return {}; };
int showConfiguration(const QVariant &_args) override;
void writeConfiguration() const override;

Expand Down
2 changes: 1 addition & 1 deletion sources/awesomewidgets/qcronscheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion sources/awesomewidgets/yahooweatherprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
7 changes: 4 additions & 3 deletions sources/changelog.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
exec_program(
"sed -n '1,/^Ver/ p' CHANGELOG 2> /dev/null | grep -v '^Ver' | tr '\n' '@'"
${CMAKE_CURRENT_SOURCE_DIR}
execute_process(
COMMAND "sed -n '1,/^Ver/ p' CHANGELOG 2> /dev/null | grep -v '^Ver' | tr '\n' '@'"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE PROJECT_CHANGELOG
OUTPUT_STRIP_TRAILING_WHITESPACE
)
10 changes: 5 additions & 5 deletions sources/checkgit.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
exec_program(
"git"
${CMAKE_CURRENT_SOURCE_DIR}
ARGS "log" "-1" "--format=\"%h\""
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE COMMIT_SHA
RETURN_VALUE GIT_RETURN
RESULT_VARIABLE GIT_RETURN
OUTPUT_STRIP_TRAILING_WHITESPACE
)

if (${GIT_RETURN} EQUAL "0")
Expand Down
2 changes: 1 addition & 1 deletion sources/extsysmonsources/desktopsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ QVariant DesktopSource::data(const QString &_source)
return m_vdi->numberOfDesktops();
}

return QVariant();
return {};
}


Expand Down
2 changes: 1 addition & 1 deletion sources/test/testjsonformatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ private slots:
};


#endif /* TESTJSONFORMATTER_Hl */
#endif /* TESTJSONFORMATTER_H */

0 comments on commit 09a3c32

Please sign in to comment.