mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-14 06:15:49 +00:00
massive changes inside
* use pass by ref instead of by value if possible * use reference in interation over collections * fix no tag inserting
This commit is contained in:
@ -28,7 +28,7 @@
|
||||
#include "qcronscheduler.h"
|
||||
|
||||
|
||||
AbstractExtItem::AbstractExtItem(QWidget *parent, const QString filePath)
|
||||
AbstractExtItem::AbstractExtItem(QWidget *parent, const QString &filePath)
|
||||
: QDialog(parent)
|
||||
, m_fileName(filePath)
|
||||
{
|
||||
@ -166,7 +166,7 @@ QString AbstractExtItem::socket() const
|
||||
}
|
||||
|
||||
|
||||
QString AbstractExtItem::tag(const QString _type) const
|
||||
QString AbstractExtItem::tag(const QString &_type) const
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Tag type" << _type;
|
||||
|
||||
@ -190,7 +190,7 @@ void AbstractExtItem::setActive(const bool _state)
|
||||
}
|
||||
|
||||
|
||||
void AbstractExtItem::setComment(const QString _comment)
|
||||
void AbstractExtItem::setComment(const QString &_comment)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Comment" << _comment;
|
||||
|
||||
@ -198,7 +198,7 @@ void AbstractExtItem::setComment(const QString _comment)
|
||||
}
|
||||
|
||||
|
||||
void AbstractExtItem::setCron(const QString _cron)
|
||||
void AbstractExtItem::setCron(const QString &_cron)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Cron string" << _cron;
|
||||
// deinit module first
|
||||
@ -230,7 +230,7 @@ void AbstractExtItem::setInterval(const int _interval)
|
||||
}
|
||||
|
||||
|
||||
void AbstractExtItem::setName(const QString _name)
|
||||
void AbstractExtItem::setName(const QString &_name)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Name" << _name;
|
||||
|
||||
@ -259,7 +259,7 @@ void AbstractExtItem::setNumber(int _number)
|
||||
}
|
||||
|
||||
|
||||
void AbstractExtItem::setSocket(const QString _socket)
|
||||
void AbstractExtItem::setSocket(const QString &_socket)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Socket" << _socket;
|
||||
// remove old socket first
|
||||
|
@ -41,10 +41,10 @@ class AbstractExtItem : public QDialog
|
||||
|
||||
public:
|
||||
explicit AbstractExtItem(QWidget *parent,
|
||||
const QString filePath = QString());
|
||||
const QString &filePath = QString());
|
||||
virtual ~AbstractExtItem();
|
||||
virtual void bumpApi(const int _newVer);
|
||||
virtual AbstractExtItem *copy(const QString _fileName, const int _number)
|
||||
virtual AbstractExtItem *copy(const QString &_fileName, const int _number)
|
||||
= 0;
|
||||
virtual void copyDefaults(AbstractExtItem *_other) const;
|
||||
virtual void startTimer();
|
||||
@ -59,17 +59,17 @@ public:
|
||||
QString name() const;
|
||||
int number() const;
|
||||
QString socket() const;
|
||||
QString tag(const QString _type) const;
|
||||
QString tag(const QString &_type) const;
|
||||
virtual QString uniq() const = 0;
|
||||
// set methods
|
||||
void setApiVersion(const int _apiVersion = 0);
|
||||
void setActive(const bool _state = true);
|
||||
void setComment(const QString _comment = QString("empty"));
|
||||
void setCron(const QString _cron = "");
|
||||
void setComment(const QString &_comment = QString("empty"));
|
||||
void setCron(const QString &_cron = "");
|
||||
void setInterval(const int _interval = 1);
|
||||
void setName(const QString _name = QString("none"));
|
||||
void setName(const QString &_name = QString("none"));
|
||||
void setNumber(int _number = -1);
|
||||
void setSocket(const QString _socket = QString(""));
|
||||
void setSocket(const QString &_socket = QString(""));
|
||||
|
||||
signals:
|
||||
void dataReceived(const QVariantHash &data);
|
||||
@ -80,7 +80,7 @@ public slots:
|
||||
virtual void initSocket();
|
||||
virtual void readConfiguration();
|
||||
virtual QVariantHash run() = 0;
|
||||
virtual int showConfiguration(const QVariant args = QVariant()) = 0;
|
||||
virtual int showConfiguration(const QVariant &args = QVariant()) = 0;
|
||||
virtual bool tryDelete() const;
|
||||
virtual void writeConfiguration() const;
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
|
||||
AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *parent,
|
||||
const QString type)
|
||||
const QString &type)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::AbstractExtItemAggregator)
|
||||
, m_type(type)
|
||||
@ -132,7 +132,7 @@ AbstractExtItem *AbstractExtItemAggregator::itemFromWidget()
|
||||
return nullptr;
|
||||
|
||||
AbstractExtItem *found = nullptr;
|
||||
for (auto item : items()) {
|
||||
for (auto &item : items()) {
|
||||
QString fileName = QFileInfo(item->fileName()).fileName();
|
||||
if (fileName != widgetItem->text())
|
||||
continue;
|
||||
@ -150,7 +150,7 @@ AbstractExtItem *AbstractExtItemAggregator::itemFromWidget()
|
||||
void AbstractExtItemAggregator::repaintList()
|
||||
{
|
||||
ui->listWidget->clear();
|
||||
for (auto _item : items()) {
|
||||
for (auto &_item : items()) {
|
||||
QString fileName = QFileInfo(_item->fileName()).fileName();
|
||||
QListWidgetItem *item = new QListWidgetItem(fileName, ui->listWidget);
|
||||
QStringList tooltip;
|
||||
@ -166,7 +166,7 @@ void AbstractExtItemAggregator::repaintList()
|
||||
int AbstractExtItemAggregator::uniqNumber() const
|
||||
{
|
||||
QList<int> tagList;
|
||||
for (auto item : items())
|
||||
for (auto &item : items())
|
||||
tagList.append(item->number());
|
||||
int number = 0;
|
||||
while (tagList.contains(number))
|
||||
@ -188,7 +188,7 @@ QString AbstractExtItemAggregator::type() const
|
||||
}
|
||||
|
||||
|
||||
void AbstractExtItemAggregator::setConfigArgs(const QVariant _configArgs)
|
||||
void AbstractExtItemAggregator::setConfigArgs(const QVariant &_configArgs)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Configuration arguments" << _configArgs;
|
||||
|
||||
|
@ -39,7 +39,7 @@ class AbstractExtItemAggregator : public QDialog
|
||||
Q_PROPERTY(QVariant type READ type)
|
||||
|
||||
public:
|
||||
explicit AbstractExtItemAggregator(QWidget *parent, const QString type);
|
||||
explicit AbstractExtItemAggregator(QWidget *parent, const QString &type);
|
||||
virtual ~AbstractExtItemAggregator();
|
||||
// methods
|
||||
void copyItem();
|
||||
@ -75,7 +75,7 @@ public:
|
||||
virtual QList<AbstractExtItem *> items() const = 0;
|
||||
QString type() const;
|
||||
// set methods
|
||||
void setConfigArgs(const QVariant _configArgs);
|
||||
void setConfigArgs(const QVariant &_configArgs);
|
||||
|
||||
private slots:
|
||||
void editItemActivated(QListWidgetItem *);
|
||||
|
@ -32,7 +32,7 @@ public:
|
||||
: QObject(parent)
|
||||
, m_number(number){};
|
||||
virtual ~AbstractWeatherProvider(){};
|
||||
virtual void initUrl(const QString city, const QString country,
|
||||
virtual void initUrl(const QString &city, const QString &country,
|
||||
const int ts)
|
||||
= 0;
|
||||
virtual QVariantHash parse(const QVariantMap &json) const = 0;
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
AWAbstractFormatter::AWAbstractFormatter(QWidget *parent,
|
||||
const QString filePath)
|
||||
const QString &filePath)
|
||||
: AbstractExtItem(parent, filePath)
|
||||
{
|
||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||
@ -87,7 +87,7 @@ AWAbstractFormatter::FormatterClass AWAbstractFormatter::type() const
|
||||
}
|
||||
|
||||
|
||||
void AWAbstractFormatter::setStrType(const QString _type)
|
||||
void AWAbstractFormatter::setStrType(const QString &_type)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Type" << _type;
|
||||
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
};
|
||||
|
||||
explicit AWAbstractFormatter(QWidget *parent,
|
||||
const QString filePath = QString());
|
||||
const QString &filePath = QString());
|
||||
virtual ~AWAbstractFormatter();
|
||||
virtual QString convert(const QVariant &_value) const = 0;
|
||||
void copyDefaults(AbstractExtItem *_other) const;
|
||||
@ -47,7 +47,7 @@ public:
|
||||
// properties
|
||||
QString strType() const;
|
||||
FormatterClass type() const;
|
||||
void setStrType(const QString type);
|
||||
void setStrType(const QString &type);
|
||||
void setType(const FormatterClass _type = FormatterClass::NoFormat);
|
||||
|
||||
public slots:
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
AWDateTimeFormatter::AWDateTimeFormatter(QWidget *parent,
|
||||
const QString filePath)
|
||||
const QString &filePath)
|
||||
: AWAbstractFormatter(parent, filePath)
|
||||
, ui(new Ui::AWDateTimeFormatter)
|
||||
{
|
||||
@ -58,7 +58,7 @@ QString AWDateTimeFormatter::convert(const QVariant &_value) const
|
||||
}
|
||||
|
||||
|
||||
AWDateTimeFormatter *AWDateTimeFormatter::copy(const QString _fileName,
|
||||
AWDateTimeFormatter *AWDateTimeFormatter::copy(const QString &_fileName,
|
||||
const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
@ -86,7 +86,7 @@ bool AWDateTimeFormatter::translateString() const
|
||||
}
|
||||
|
||||
|
||||
void AWDateTimeFormatter::setFormat(const QString _format)
|
||||
void AWDateTimeFormatter::setFormat(const QString &_format)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Set format" << _format;
|
||||
|
||||
@ -119,7 +119,7 @@ void AWDateTimeFormatter::readConfiguration()
|
||||
}
|
||||
|
||||
|
||||
int AWDateTimeFormatter::showConfiguration(const QVariant args)
|
||||
int AWDateTimeFormatter::showConfiguration(const QVariant &args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
|
@ -36,19 +36,19 @@ class AWDateTimeFormatter : public AWAbstractFormatter
|
||||
|
||||
public:
|
||||
explicit AWDateTimeFormatter(QWidget *parent,
|
||||
const QString filePath = QString());
|
||||
const QString &filePath = QString());
|
||||
virtual ~AWDateTimeFormatter();
|
||||
QString convert(const QVariant &_value) const;
|
||||
AWDateTimeFormatter *copy(const QString _fileName, const int _number);
|
||||
AWDateTimeFormatter *copy(const QString &_fileName, const int _number);
|
||||
// properties
|
||||
QString format() const;
|
||||
bool translateString() const;
|
||||
void setFormat(const QString _format);
|
||||
void setFormat(const QString &_format);
|
||||
void setTranslateString(const bool _translate);
|
||||
|
||||
public slots:
|
||||
void readConfiguration();
|
||||
int showConfiguration(const QVariant args = QVariant());
|
||||
int showConfiguration(const QVariant &args = QVariant());
|
||||
void writeConfiguration() const;
|
||||
|
||||
private:
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "awdebug.h"
|
||||
|
||||
|
||||
AWFloatFormatter::AWFloatFormatter(QWidget *parent, const QString filePath)
|
||||
AWFloatFormatter::AWFloatFormatter(QWidget *parent, const QString &filePath)
|
||||
: AWAbstractFormatter(parent, filePath)
|
||||
, ui(new Ui::AWFloatFormatter)
|
||||
{
|
||||
@ -62,7 +62,7 @@ QString AWFloatFormatter::convert(const QVariant &_value) const
|
||||
}
|
||||
|
||||
|
||||
AWFloatFormatter *AWFloatFormatter::copy(const QString _fileName,
|
||||
AWFloatFormatter *AWFloatFormatter::copy(const QString &_fileName,
|
||||
const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
@ -133,7 +133,7 @@ void AWFloatFormatter::setCount(const int _count)
|
||||
}
|
||||
|
||||
|
||||
void AWFloatFormatter::setFillChar(const QChar _fillChar)
|
||||
void AWFloatFormatter::setFillChar(const QChar &_fillChar)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Set char" << _fillChar;
|
||||
|
||||
@ -214,7 +214,7 @@ void AWFloatFormatter::readConfiguration()
|
||||
}
|
||||
|
||||
|
||||
int AWFloatFormatter::showConfiguration(const QVariant args)
|
||||
int AWFloatFormatter::showConfiguration(const QVariant &args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
|
@ -39,10 +39,10 @@ class AWFloatFormatter : public AWAbstractFormatter
|
||||
|
||||
public:
|
||||
explicit AWFloatFormatter(QWidget *parent,
|
||||
const QString filePath = QString());
|
||||
const QString &filePath = QString());
|
||||
virtual ~AWFloatFormatter();
|
||||
QString convert(const QVariant &_value) const;
|
||||
AWFloatFormatter *copy(const QString _fileName, const int _number);
|
||||
AWFloatFormatter *copy(const QString &_fileName, const int _number);
|
||||
// properties
|
||||
int count() const;
|
||||
QChar fillChar() const;
|
||||
@ -52,7 +52,7 @@ public:
|
||||
int precision() const;
|
||||
double summand() const;
|
||||
void setCount(const int _count);
|
||||
void setFillChar(const QChar _fillChar);
|
||||
void setFillChar(const QChar &_fillChar);
|
||||
void setForceWidth(const bool _forceWidth);
|
||||
void setFormat(char _format);
|
||||
void setMultiplier(const double _multiplier);
|
||||
@ -61,7 +61,7 @@ public:
|
||||
|
||||
public slots:
|
||||
void readConfiguration();
|
||||
int showConfiguration(const QVariant args = QVariant());
|
||||
int showConfiguration(const QVariant &args = QVariant());
|
||||
void writeConfiguration() const;
|
||||
|
||||
private:
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "awdebug.h"
|
||||
|
||||
|
||||
AWJsonFormatter::AWJsonFormatter(QWidget *parent, const QString filePath)
|
||||
AWJsonFormatter::AWJsonFormatter(QWidget *parent, const QString &filePath)
|
||||
: AWAbstractFormatter(parent, filePath)
|
||||
, ui(new Ui::AWJsonFormatter)
|
||||
{
|
||||
@ -65,7 +65,7 @@ QString AWJsonFormatter::convert(const QVariant &_value) const
|
||||
}
|
||||
|
||||
|
||||
AWJsonFormatter *AWJsonFormatter::copy(const QString _fileName,
|
||||
AWJsonFormatter *AWJsonFormatter::copy(const QString &_fileName,
|
||||
const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
@ -86,7 +86,7 @@ QString AWJsonFormatter::path() const
|
||||
}
|
||||
|
||||
|
||||
void AWJsonFormatter::setPath(const QString _path)
|
||||
void AWJsonFormatter::setPath(const QString &_path)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Path" << _path;
|
||||
|
||||
@ -109,7 +109,7 @@ void AWJsonFormatter::readConfiguration()
|
||||
}
|
||||
|
||||
|
||||
int AWJsonFormatter::showConfiguration(const QVariant args)
|
||||
int AWJsonFormatter::showConfiguration(const QVariant &args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
@ -190,10 +190,7 @@ void AWJsonFormatter::initPath()
|
||||
for (auto &element : splittedByDot) {
|
||||
bool ok;
|
||||
int number = element.toInt(&ok);
|
||||
if (ok)
|
||||
m_splittedPath.append(number);
|
||||
else
|
||||
m_splittedPath.append(element);
|
||||
m_splittedPath.append(ok ? QVariant(number) : QVariant(element));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,17 +33,17 @@ class AWJsonFormatter : public AWAbstractFormatter
|
||||
|
||||
public:
|
||||
explicit AWJsonFormatter(QWidget *parent,
|
||||
const QString filePath = QString());
|
||||
const QString &filePath = QString());
|
||||
virtual ~AWJsonFormatter();
|
||||
QString convert(const QVariant &_value) const;
|
||||
AWJsonFormatter *copy(const QString _fileName, const int _number);
|
||||
AWJsonFormatter *copy(const QString &_fileName, const int _number);
|
||||
// properties
|
||||
QString path() const;
|
||||
void setPath(const QString _path);
|
||||
void setPath(const QString &_path);
|
||||
|
||||
public slots:
|
||||
void readConfiguration();
|
||||
int showConfiguration(const QVariant args = QVariant());
|
||||
int showConfiguration(const QVariant &args = QVariant());
|
||||
void writeConfiguration() const;
|
||||
|
||||
private:
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "awdebug.h"
|
||||
|
||||
|
||||
AWListFormatter::AWListFormatter(QWidget *parent, const QString filePath)
|
||||
AWListFormatter::AWListFormatter(QWidget *parent, const QString &filePath)
|
||||
: AWAbstractFormatter(parent, filePath)
|
||||
, ui(new Ui::AWListFormatter)
|
||||
{
|
||||
@ -59,7 +59,7 @@ QString AWListFormatter::convert(const QVariant &_value) const
|
||||
}
|
||||
|
||||
|
||||
AWListFormatter *AWListFormatter::copy(const QString _fileName,
|
||||
AWListFormatter *AWListFormatter::copy(const QString &_fileName,
|
||||
const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
@ -94,7 +94,7 @@ QString AWListFormatter::separator() const
|
||||
}
|
||||
|
||||
|
||||
void AWListFormatter::setFilter(const QString _filter)
|
||||
void AWListFormatter::setFilter(const QString &_filter)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Filter" << _filter;
|
||||
|
||||
@ -103,7 +103,7 @@ void AWListFormatter::setFilter(const QString _filter)
|
||||
}
|
||||
|
||||
|
||||
void AWListFormatter::setSeparator(const QString _separator)
|
||||
void AWListFormatter::setSeparator(const QString &_separator)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Separtor" << _separator;
|
||||
|
||||
@ -136,7 +136,7 @@ void AWListFormatter::readConfiguration()
|
||||
}
|
||||
|
||||
|
||||
int AWListFormatter::showConfiguration(const QVariant args)
|
||||
int AWListFormatter::showConfiguration(const QVariant &args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
|
@ -35,21 +35,21 @@ class AWListFormatter : public AWAbstractFormatter
|
||||
|
||||
public:
|
||||
explicit AWListFormatter(QWidget *parent,
|
||||
const QString filePath = QString());
|
||||
const QString &filePath = QString());
|
||||
virtual ~AWListFormatter();
|
||||
QString convert(const QVariant &_value) const;
|
||||
AWListFormatter *copy(const QString _fileName, const int _number);
|
||||
AWListFormatter *copy(const QString &_fileName, const int _number);
|
||||
// properties
|
||||
QString filter() const;
|
||||
bool isSorted() const;
|
||||
QString separator() const;
|
||||
void setFilter(const QString _filter);
|
||||
void setSeparator(const QString _separator);
|
||||
void setFilter(const QString &_filter);
|
||||
void setSeparator(const QString &_separator);
|
||||
void setSorted(const bool _sorted);
|
||||
|
||||
public slots:
|
||||
void readConfiguration();
|
||||
int showConfiguration(const QVariant args = QVariant());
|
||||
int showConfiguration(const QVariant &args = QVariant());
|
||||
void writeConfiguration() const;
|
||||
|
||||
private:
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "awdebug.h"
|
||||
|
||||
|
||||
AWNoFormatter::AWNoFormatter(QWidget *parent, const QString filePath)
|
||||
AWNoFormatter::AWNoFormatter(QWidget *parent, const QString &filePath)
|
||||
: AWAbstractFormatter(parent, filePath)
|
||||
, ui(new Ui::AWNoFormatter)
|
||||
{
|
||||
@ -53,7 +53,7 @@ QString AWNoFormatter::convert(const QVariant &_value) const
|
||||
}
|
||||
|
||||
|
||||
AWNoFormatter *AWNoFormatter::copy(const QString _fileName, const int _number)
|
||||
AWNoFormatter *AWNoFormatter::copy(const QString &_fileName, const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
|
||||
@ -66,7 +66,7 @@ AWNoFormatter *AWNoFormatter::copy(const QString _fileName, const int _number)
|
||||
}
|
||||
|
||||
|
||||
int AWNoFormatter::showConfiguration(const QVariant args)
|
||||
int AWNoFormatter::showConfiguration(const QVariant &args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
|
@ -31,13 +31,13 @@ class AWNoFormatter : public AWAbstractFormatter
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AWNoFormatter(QWidget *parent, const QString filePath = QString());
|
||||
explicit AWNoFormatter(QWidget *parent, const QString &filePath = QString());
|
||||
virtual ~AWNoFormatter();
|
||||
QString convert(const QVariant &_value) const;
|
||||
AWNoFormatter *copy(const QString _fileName, const int _number);
|
||||
AWNoFormatter *copy(const QString &_fileName, const int _number);
|
||||
|
||||
public slots:
|
||||
int showConfiguration(const QVariant args = QVariant());
|
||||
int showConfiguration(const QVariant &args = QVariant());
|
||||
|
||||
private:
|
||||
Ui::AWNoFormatter *ui = nullptr;
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "awdebug.h"
|
||||
|
||||
|
||||
AWScriptFormatter::AWScriptFormatter(QWidget *parent, const QString filePath)
|
||||
AWScriptFormatter::AWScriptFormatter(QWidget *parent, const QString &filePath)
|
||||
: AWAbstractFormatter(parent, filePath)
|
||||
, ui(new Ui::AWScriptFormatter)
|
||||
{
|
||||
@ -70,7 +70,7 @@ QString AWScriptFormatter::convert(const QVariant &_value) const
|
||||
}
|
||||
|
||||
|
||||
AWScriptFormatter *AWScriptFormatter::copy(const QString _fileName,
|
||||
AWScriptFormatter *AWScriptFormatter::copy(const QString &_fileName,
|
||||
const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
@ -120,7 +120,7 @@ void AWScriptFormatter::setAppendCode(const bool _appendCode)
|
||||
}
|
||||
|
||||
|
||||
void AWScriptFormatter::setCode(const QString _code)
|
||||
void AWScriptFormatter::setCode(const QString &_code)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Set code" << _code;
|
||||
|
||||
@ -156,7 +156,7 @@ void AWScriptFormatter::readConfiguration()
|
||||
}
|
||||
|
||||
|
||||
int AWScriptFormatter::showConfiguration(const QVariant args)
|
||||
int AWScriptFormatter::showConfiguration(const QVariant &args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
|
@ -36,22 +36,22 @@ class AWScriptFormatter : public AWAbstractFormatter
|
||||
|
||||
public:
|
||||
explicit AWScriptFormatter(QWidget *parent,
|
||||
const QString filePath = QString());
|
||||
const QString &filePath = QString());
|
||||
virtual ~AWScriptFormatter();
|
||||
QString convert(const QVariant &_value) const;
|
||||
AWScriptFormatter *copy(const QString _fileName, const int _number);
|
||||
AWScriptFormatter *copy(const QString &_fileName, const int _number);
|
||||
// properties
|
||||
bool appendCode() const;
|
||||
QString code() const;
|
||||
bool hasReturn() const;
|
||||
QString program() const;
|
||||
void setAppendCode(const bool _appendCode);
|
||||
void setCode(const QString _code);
|
||||
void setCode(const QString &_code);
|
||||
void setHasReturn(const bool _hasReturn);
|
||||
|
||||
public slots:
|
||||
void readConfiguration();
|
||||
int showConfiguration(const QVariant args = QVariant());
|
||||
int showConfiguration(const QVariant &args = QVariant());
|
||||
void writeConfiguration() const;
|
||||
|
||||
private:
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "awdebug.h"
|
||||
|
||||
|
||||
AWStringFormatter::AWStringFormatter(QWidget *parent, const QString filePath)
|
||||
AWStringFormatter::AWStringFormatter(QWidget *parent, const QString &filePath)
|
||||
: AWAbstractFormatter(parent, filePath)
|
||||
, ui(new Ui::AWStringFormatter)
|
||||
{
|
||||
@ -60,7 +60,7 @@ QString AWStringFormatter::convert(const QVariant &_value) const
|
||||
}
|
||||
|
||||
|
||||
AWStringFormatter *AWStringFormatter::copy(const QString _fileName,
|
||||
AWStringFormatter *AWStringFormatter::copy(const QString &_fileName,
|
||||
const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
@ -103,7 +103,7 @@ void AWStringFormatter::setCount(const int _count)
|
||||
}
|
||||
|
||||
|
||||
void AWStringFormatter::setFillChar(const QChar _fillChar)
|
||||
void AWStringFormatter::setFillChar(const QChar &_fillChar)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Set char" << _fillChar;
|
||||
|
||||
@ -137,7 +137,7 @@ void AWStringFormatter::readConfiguration()
|
||||
}
|
||||
|
||||
|
||||
int AWStringFormatter::showConfiguration(const QVariant args)
|
||||
int AWStringFormatter::showConfiguration(const QVariant &args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
|
@ -35,21 +35,21 @@ class AWStringFormatter : public AWAbstractFormatter
|
||||
|
||||
public:
|
||||
explicit AWStringFormatter(QWidget *parent,
|
||||
const QString filePath = QString());
|
||||
const QString &filePath = QString());
|
||||
virtual ~AWStringFormatter();
|
||||
QString convert(const QVariant &_value) const;
|
||||
AWStringFormatter *copy(const QString _fileName, const int _number);
|
||||
AWStringFormatter *copy(const QString &_fileName, const int _number);
|
||||
// properties
|
||||
int count() const;
|
||||
QChar fillChar() const;
|
||||
bool forceWidth() const;
|
||||
void setCount(const int _count);
|
||||
void setFillChar(const QChar _fillChar);
|
||||
void setFillChar(const QChar &_fillChar);
|
||||
void setForceWidth(const bool _forceWidth);
|
||||
|
||||
public slots:
|
||||
void readConfiguration();
|
||||
int showConfiguration(const QVariant args = QVariant());
|
||||
int showConfiguration(const QVariant &args = QVariant());
|
||||
void writeConfiguration() const;
|
||||
|
||||
private:
|
||||
|
@ -31,7 +31,7 @@
|
||||
template <class T> class ExtItemAggregator : public AbstractExtItemAggregator
|
||||
{
|
||||
public:
|
||||
explicit ExtItemAggregator(QWidget *parent, const QString type)
|
||||
explicit ExtItemAggregator(QWidget *parent, const QString &type)
|
||||
: AbstractExtItemAggregator(parent, type)
|
||||
{
|
||||
qSetMessagePattern(AWDebug::LOG_FORMAT);
|
||||
@ -66,16 +66,16 @@ public:
|
||||
// HACK as soon as per one widget instance we have two objects each of
|
||||
// them will try to control socket, whereas actually only one of them
|
||||
// should be owner of the socket
|
||||
for (auto item : m_items)
|
||||
for (auto &item : m_items)
|
||||
item->initSocket();
|
||||
}
|
||||
|
||||
T *itemByTag(const QString _tag, const QString _type) const
|
||||
T *itemByTag(const QString &_tag, const QString &_type) const
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Tag" << _tag << "with used type" << _type;
|
||||
|
||||
T *found = nullptr;
|
||||
for (auto item : m_items) {
|
||||
for (auto &item : m_items) {
|
||||
if (item->tag(_type) != _tag)
|
||||
continue;
|
||||
found = static_cast<T *>(item);
|
||||
@ -92,7 +92,7 @@ public:
|
||||
qCDebug(LOG_LIB) << "Number" << _number;
|
||||
|
||||
T *found = nullptr;
|
||||
for (auto item : m_items) {
|
||||
for (auto &item : m_items) {
|
||||
if (item->number() != _number)
|
||||
continue;
|
||||
found = static_cast<T *>(item);
|
||||
@ -129,9 +129,9 @@ private:
|
||||
QStandardPaths::LocateDirectory);
|
||||
QStringList names;
|
||||
QList<AbstractExtItem *> items;
|
||||
for (auto dir : dirs) {
|
||||
for (auto &dir : dirs) {
|
||||
QStringList files = QDir(dir).entryList(QDir::Files, QDir::Name);
|
||||
for (auto file : files) {
|
||||
for (auto &file : files) {
|
||||
if ((!file.endsWith(QString(".desktop")))
|
||||
|| (names.contains(file)))
|
||||
continue;
|
||||
@ -156,7 +156,7 @@ private:
|
||||
m_activeItems.clear();
|
||||
|
||||
m_items = getItems();
|
||||
for (auto item : m_items) {
|
||||
for (auto &item : m_items) {
|
||||
if (!item->isActive())
|
||||
continue;
|
||||
m_activeItems.append(static_cast<T *>(item));
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "awdebug.h"
|
||||
|
||||
|
||||
ExtNetworkRequest::ExtNetworkRequest(QWidget *parent, const QString filePath)
|
||||
ExtNetworkRequest::ExtNetworkRequest(QWidget *parent, const QString &filePath)
|
||||
: AbstractExtItem(parent, filePath)
|
||||
, ui(new Ui::ExtNetworkRequest)
|
||||
{
|
||||
@ -67,7 +67,7 @@ ExtNetworkRequest::~ExtNetworkRequest()
|
||||
}
|
||||
|
||||
|
||||
ExtNetworkRequest *ExtNetworkRequest::copy(const QString _fileName,
|
||||
ExtNetworkRequest *ExtNetworkRequest::copy(const QString &_fileName,
|
||||
const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
@ -94,7 +94,7 @@ QString ExtNetworkRequest::uniq() const
|
||||
}
|
||||
|
||||
|
||||
void ExtNetworkRequest::setStringUrl(const QString _url)
|
||||
void ExtNetworkRequest::setStringUrl(const QString &_url)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Url" << _url;
|
||||
|
||||
@ -127,7 +127,7 @@ QVariantHash ExtNetworkRequest::run()
|
||||
}
|
||||
|
||||
|
||||
int ExtNetworkRequest::showConfiguration(const QVariant args)
|
||||
int ExtNetworkRequest::showConfiguration(const QVariant &args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
|
@ -35,19 +35,19 @@ class ExtNetworkRequest : public AbstractExtItem
|
||||
|
||||
public:
|
||||
explicit ExtNetworkRequest(QWidget *parent,
|
||||
const QString filePath = QString());
|
||||
const QString &filePath = QString());
|
||||
virtual ~ExtNetworkRequest();
|
||||
ExtNetworkRequest *copy(const QString _fileName, const int _number);
|
||||
ExtNetworkRequest *copy(const QString &_fileName, const int _number);
|
||||
// get methods
|
||||
QString stringUrl() const;
|
||||
QString uniq() const;
|
||||
// set methods
|
||||
void setStringUrl(const QString _url = QString("https://httpbin.org/get"));
|
||||
void setStringUrl(const QString &_url = QString("https://httpbin.org/get"));
|
||||
|
||||
public slots:
|
||||
void readConfiguration();
|
||||
QVariantHash run();
|
||||
int showConfiguration(const QVariant args = QVariant());
|
||||
int showConfiguration(const QVariant &args = QVariant());
|
||||
void writeConfiguration() const;
|
||||
|
||||
private slots:
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "awdebug.h"
|
||||
|
||||
|
||||
ExtQuotes::ExtQuotes(QWidget *parent, const QString filePath)
|
||||
ExtQuotes::ExtQuotes(QWidget *parent, const QString &filePath)
|
||||
: AbstractExtItem(parent, filePath)
|
||||
, ui(new Ui::ExtQuotes)
|
||||
{
|
||||
@ -77,7 +77,7 @@ ExtQuotes::~ExtQuotes()
|
||||
}
|
||||
|
||||
|
||||
ExtQuotes *ExtQuotes::copy(const QString _fileName, const int _number)
|
||||
ExtQuotes *ExtQuotes::copy(const QString &_fileName, const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
|
||||
@ -103,7 +103,7 @@ QString ExtQuotes::uniq() const
|
||||
}
|
||||
|
||||
|
||||
void ExtQuotes::setTicker(const QString _ticker)
|
||||
void ExtQuotes::setTicker(const QString &_ticker)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Ticker" << _ticker;
|
||||
|
||||
@ -136,7 +136,7 @@ QVariantHash ExtQuotes::run()
|
||||
}
|
||||
|
||||
|
||||
int ExtQuotes::showConfiguration(const QVariant args)
|
||||
int ExtQuotes::showConfiguration(const QVariant &args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
|
@ -38,19 +38,19 @@ public:
|
||||
const char *YAHOO_QUOTES_QUERY
|
||||
= "select * from yahoo.finance.quotes where symbol='%1'";
|
||||
|
||||
explicit ExtQuotes(QWidget *parent, const QString filePath = QString());
|
||||
explicit ExtQuotes(QWidget *parent, const QString &filePath = QString());
|
||||
virtual ~ExtQuotes();
|
||||
ExtQuotes *copy(const QString _fileName, const int _number);
|
||||
ExtQuotes *copy(const QString &_fileName, const int _number);
|
||||
// get methods
|
||||
QString ticker() const;
|
||||
QString uniq() const;
|
||||
// set methods
|
||||
void setTicker(const QString _ticker = QString("EURUSD=X"));
|
||||
void setTicker(const QString &_ticker = QString("EURUSD=X"));
|
||||
|
||||
public slots:
|
||||
void readConfiguration();
|
||||
QVariantHash run();
|
||||
int showConfiguration(const QVariant args = QVariant());
|
||||
int showConfiguration(const QVariant &args = QVariant());
|
||||
void writeConfiguration() const;
|
||||
|
||||
private slots:
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "awdebug.h"
|
||||
|
||||
|
||||
ExtScript::ExtScript(QWidget *parent, const QString filePath)
|
||||
ExtScript::ExtScript(QWidget *parent, const QString &filePath)
|
||||
: AbstractExtItem(parent, filePath)
|
||||
, ui(new Ui::ExtScript)
|
||||
{
|
||||
@ -66,7 +66,7 @@ ExtScript::~ExtScript()
|
||||
}
|
||||
|
||||
|
||||
ExtScript *ExtScript::copy(const QString _fileName, const int _number)
|
||||
ExtScript *ExtScript::copy(const QString &_fileName, const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
|
||||
@ -147,7 +147,7 @@ QString ExtScript::strRedirect() const
|
||||
}
|
||||
|
||||
|
||||
void ExtScript::setExecutable(const QString _executable)
|
||||
void ExtScript::setExecutable(const QString &_executable)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Executable" << _executable;
|
||||
|
||||
@ -155,7 +155,7 @@ void ExtScript::setExecutable(const QString _executable)
|
||||
}
|
||||
|
||||
|
||||
void ExtScript::setFilters(const QStringList _filters)
|
||||
void ExtScript::setFilters(const QStringList &_filters)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Filters" << _filters;
|
||||
|
||||
@ -164,7 +164,7 @@ void ExtScript::setFilters(const QStringList _filters)
|
||||
}
|
||||
|
||||
|
||||
void ExtScript::setPrefix(const QString _prefix)
|
||||
void ExtScript::setPrefix(const QString &_prefix)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Prefix" << _prefix;
|
||||
|
||||
@ -180,7 +180,7 @@ void ExtScript::setRedirect(const Redirect _redirect)
|
||||
}
|
||||
|
||||
|
||||
void ExtScript::setStrRedirect(const QString _redirect)
|
||||
void ExtScript::setStrRedirect(const QString &_redirect)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Redirect" << _redirect;
|
||||
|
||||
@ -199,7 +199,7 @@ QString ExtScript::applyFilters(QString _value) const
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Value" << _value;
|
||||
|
||||
for (auto filt : filters()) {
|
||||
for (auto &filt : filters()) {
|
||||
qCInfo(LOG_LIB) << "Found filter" << filt;
|
||||
QVariantMap filter = m_jsonFilters[filt].toMap();
|
||||
if (filter.isEmpty()) {
|
||||
@ -207,7 +207,7 @@ QString ExtScript::applyFilters(QString _value) const
|
||||
<< "Could not find filter" << _value << "in the json";
|
||||
continue;
|
||||
}
|
||||
for (auto f : filter.keys())
|
||||
for (auto &f : filter.keys())
|
||||
_value.replace(f, filter[f].toString());
|
||||
}
|
||||
|
||||
@ -215,7 +215,7 @@ QString ExtScript::applyFilters(QString _value) const
|
||||
}
|
||||
|
||||
|
||||
void ExtScript::updateFilter(const QString _filter, const bool _add)
|
||||
void ExtScript::updateFilter(const QString &_filter, const bool _add)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Should be added filters" << _add << "from" << _filter;
|
||||
|
||||
@ -283,7 +283,7 @@ QVariantHash ExtScript::run()
|
||||
}
|
||||
|
||||
|
||||
int ExtScript::showConfiguration(const QVariant args)
|
||||
int ExtScript::showConfiguration(const QVariant &args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
|
@ -44,9 +44,9 @@ public:
|
||||
swap = 3
|
||||
};
|
||||
|
||||
explicit ExtScript(QWidget *parent, const QString filePath = QString());
|
||||
explicit ExtScript(QWidget *parent, const QString &filePath = QString());
|
||||
virtual ~ExtScript();
|
||||
ExtScript *copy(const QString _fileName, const int _number);
|
||||
ExtScript *copy(const QString &_fileName, const int _number);
|
||||
QString jsonFiltersFile() const;
|
||||
// get methods
|
||||
QString executable() const;
|
||||
@ -57,20 +57,20 @@ public:
|
||||
// derivatives
|
||||
QString strRedirect() const;
|
||||
// set methods
|
||||
void setExecutable(const QString _executable = QString("/usr/bin/true"));
|
||||
void setFilters(const QStringList _filters = QStringList());
|
||||
void setPrefix(const QString _prefix = QString(""));
|
||||
void setExecutable(const QString &_executable = QString("/usr/bin/true"));
|
||||
void setFilters(const QStringList &_filters = QStringList());
|
||||
void setPrefix(const QString &_prefix = QString(""));
|
||||
void setRedirect(const Redirect _redirect = Redirect::nothing);
|
||||
void setStrRedirect(const QString _redirect = QString("nothing"));
|
||||
void setStrRedirect(const QString &_redirect = QString("nothing"));
|
||||
// filters
|
||||
QString applyFilters(QString _value) const;
|
||||
void updateFilter(const QString _filter, const bool _add = true);
|
||||
void updateFilter(const QString &_filter, const bool _add = true);
|
||||
|
||||
public slots:
|
||||
void readConfiguration();
|
||||
void readJsonFilters();
|
||||
QVariantHash run();
|
||||
int showConfiguration(const QVariant args = QVariant());
|
||||
int showConfiguration(const QVariant &args = QVariant());
|
||||
void writeConfiguration() const;
|
||||
|
||||
private slots:
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "awdebug.h"
|
||||
|
||||
|
||||
ExtUpgrade::ExtUpgrade(QWidget *parent, const QString filePath)
|
||||
ExtUpgrade::ExtUpgrade(QWidget *parent, const QString &filePath)
|
||||
: AbstractExtItem(parent, filePath)
|
||||
, ui(new Ui::ExtUpgrade)
|
||||
{
|
||||
@ -60,7 +60,7 @@ ExtUpgrade::~ExtUpgrade()
|
||||
}
|
||||
|
||||
|
||||
ExtUpgrade *ExtUpgrade::copy(const QString _fileName, const int _number)
|
||||
ExtUpgrade *ExtUpgrade::copy(const QString &_fileName, const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
|
||||
@ -100,7 +100,7 @@ QString ExtUpgrade::uniq() const
|
||||
}
|
||||
|
||||
|
||||
void ExtUpgrade::setExecutable(const QString _executable)
|
||||
void ExtUpgrade::setExecutable(const QString &_executable)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Executable" << _executable;
|
||||
|
||||
@ -108,7 +108,7 @@ void ExtUpgrade::setExecutable(const QString _executable)
|
||||
}
|
||||
|
||||
|
||||
void ExtUpgrade::setFilter(const QString _filter)
|
||||
void ExtUpgrade::setFilter(const QString &_filter)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Filter" << _filter;
|
||||
|
||||
@ -153,7 +153,7 @@ QVariantHash ExtUpgrade::run()
|
||||
}
|
||||
|
||||
|
||||
int ExtUpgrade::showConfiguration(const QVariant args)
|
||||
int ExtUpgrade::showConfiguration(const QVariant &args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
|
@ -36,23 +36,23 @@ class ExtUpgrade : public AbstractExtItem
|
||||
Q_PROPERTY(int null READ null WRITE setNull)
|
||||
|
||||
public:
|
||||
explicit ExtUpgrade(QWidget *parent, const QString filePath = QString());
|
||||
explicit ExtUpgrade(QWidget *parent, const QString &filePath = QString());
|
||||
virtual ~ExtUpgrade();
|
||||
ExtUpgrade *copy(const QString _fileName, const int _number);
|
||||
ExtUpgrade *copy(const QString &_fileName, const int _number);
|
||||
// get methods
|
||||
QString executable() const;
|
||||
QString filter() const;
|
||||
int null() const;
|
||||
QString uniq() const;
|
||||
// set methods
|
||||
void setExecutable(const QString _executable = QString("/usr/bin/true"));
|
||||
void setFilter(const QString _filter = QString());
|
||||
void setExecutable(const QString &_executable = QString("/usr/bin/true"));
|
||||
void setFilter(const QString &_filter = QString());
|
||||
void setNull(const int _null = 0);
|
||||
|
||||
public slots:
|
||||
void readConfiguration();
|
||||
QVariantHash run();
|
||||
int showConfiguration(const QVariant args = QVariant());
|
||||
int showConfiguration(const QVariant &args = QVariant());
|
||||
void writeConfiguration() const;
|
||||
|
||||
private slots:
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "yahooweatherprovider.h"
|
||||
|
||||
|
||||
ExtWeather::ExtWeather(QWidget *parent, const QString filePath)
|
||||
ExtWeather::ExtWeather(QWidget *parent, const QString &filePath)
|
||||
: AbstractExtItem(parent, filePath)
|
||||
, ui(new Ui::ExtWeather)
|
||||
{
|
||||
@ -77,7 +77,7 @@ ExtWeather::~ExtWeather()
|
||||
}
|
||||
|
||||
|
||||
ExtWeather *ExtWeather::copy(const QString _fileName, const int _number)
|
||||
ExtWeather *ExtWeather::copy(const QString &_fileName, const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "number" << _number;
|
||||
|
||||
@ -168,7 +168,7 @@ QString ExtWeather::uniq() const
|
||||
}
|
||||
|
||||
|
||||
void ExtWeather::setCity(const QString _city)
|
||||
void ExtWeather::setCity(const QString &_city)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "City" << _city;
|
||||
|
||||
@ -177,7 +177,7 @@ void ExtWeather::setCity(const QString _city)
|
||||
}
|
||||
|
||||
|
||||
void ExtWeather::setCountry(const QString _country)
|
||||
void ExtWeather::setCountry(const QString &_country)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Country" << _country;
|
||||
|
||||
@ -203,7 +203,7 @@ void ExtWeather::setProvider(const Provider _provider)
|
||||
}
|
||||
|
||||
|
||||
void ExtWeather::setStrProvider(const QString _provider)
|
||||
void ExtWeather::setStrProvider(const QString &_provider)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Provider" << _provider;
|
||||
|
||||
@ -278,7 +278,7 @@ QVariantHash ExtWeather::run()
|
||||
}
|
||||
|
||||
|
||||
int ExtWeather::showConfiguration(const QVariant args)
|
||||
int ExtWeather::showConfiguration(const QVariant &args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
|
@ -42,9 +42,9 @@ class ExtWeather : public AbstractExtItem
|
||||
public:
|
||||
enum class Provider { OWM = 0, Yahoo = 1 };
|
||||
|
||||
explicit ExtWeather(QWidget *parent, const QString filePath = QString());
|
||||
explicit ExtWeather(QWidget *parent, const QString &filePath = QString());
|
||||
virtual ~ExtWeather();
|
||||
ExtWeather *copy(const QString _fileName, const int _number);
|
||||
ExtWeather *copy(const QString &_fileName, const int _number);
|
||||
QString jsonMapFile() const;
|
||||
QString weatherFromInt(const int _id) const;
|
||||
// get methods
|
||||
@ -56,18 +56,18 @@ public:
|
||||
int ts() const;
|
||||
QString uniq() const;
|
||||
// set methods
|
||||
void setCity(const QString _city = QString("London"));
|
||||
void setCountry(const QString _country = QString("uk"));
|
||||
void setCity(const QString &_city = QString("London"));
|
||||
void setCountry(const QString &_country = QString("uk"));
|
||||
void setImage(const bool _image = false);
|
||||
void setProvider(const Provider _provider = Provider::OWM);
|
||||
void setStrProvider(const QString _provider = QString("OWM"));
|
||||
void setStrProvider(const QString &_provider = QString("OWM"));
|
||||
void setTs(const int _ts = 0);
|
||||
|
||||
public slots:
|
||||
void readConfiguration();
|
||||
void readJsonMap();
|
||||
QVariantHash run();
|
||||
int showConfiguration(const QVariant args = QVariant());
|
||||
int showConfiguration(const QVariant &args = QVariant());
|
||||
void writeConfiguration() const;
|
||||
|
||||
private slots:
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "graphicalitemhelper.h"
|
||||
|
||||
|
||||
GraphicalItem::GraphicalItem(QWidget *parent, const QString filePath)
|
||||
GraphicalItem::GraphicalItem(QWidget *parent, const QString &filePath)
|
||||
: AbstractExtItem(parent, filePath)
|
||||
, ui(new Ui::GraphicalItem)
|
||||
{
|
||||
@ -64,7 +64,7 @@ GraphicalItem::~GraphicalItem()
|
||||
}
|
||||
|
||||
|
||||
GraphicalItem *GraphicalItem::copy(const QString _fileName, const int _number)
|
||||
GraphicalItem *GraphicalItem::copy(const QString &_fileName, const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
|
||||
@ -283,7 +283,7 @@ QString GraphicalItem::uniq() const
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItem::setBar(const QString _bar)
|
||||
void GraphicalItem::setBar(const QString &_bar)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Bar" << _bar;
|
||||
|
||||
@ -291,7 +291,7 @@ void GraphicalItem::setBar(const QString _bar)
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItem::setActiveColor(const QString _color)
|
||||
void GraphicalItem::setActiveColor(const QString &_color)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Color" << _color;
|
||||
|
||||
@ -317,7 +317,7 @@ void GraphicalItem::setCustom(const bool _custom)
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItem::setInactiveColor(const QString _color)
|
||||
void GraphicalItem::setInactiveColor(const QString &_color)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Color" << _color;
|
||||
|
||||
@ -369,7 +369,7 @@ void GraphicalItem::setType(const Type _type)
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItem::setStrType(const QString _type)
|
||||
void GraphicalItem::setStrType(const QString &_type)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Type" << _type;
|
||||
|
||||
@ -394,7 +394,7 @@ void GraphicalItem::setDirection(const Direction _direction)
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItem::setStrDirection(const QString _direction)
|
||||
void GraphicalItem::setStrDirection(const QString &_direction)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Direction" << _direction;
|
||||
|
||||
@ -405,14 +405,14 @@ void GraphicalItem::setStrDirection(const QString _direction)
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItem::setUsedKeys(const QStringList _usedKeys)
|
||||
void GraphicalItem::setUsedKeys(const QStringList &_usedKeys)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Used keys" << _usedKeys;
|
||||
|
||||
// remove dubs
|
||||
// HACK converting to set may break order
|
||||
usedKeys().clear();
|
||||
for (auto key : _usedKeys) {
|
||||
for (auto &key : _usedKeys) {
|
||||
if (usedKeys().contains(key))
|
||||
continue;
|
||||
usedKeys().append(key);
|
||||
@ -460,7 +460,7 @@ void GraphicalItem::readConfiguration()
|
||||
}
|
||||
|
||||
|
||||
int GraphicalItem::showConfiguration(const QVariant args)
|
||||
int GraphicalItem::showConfiguration(const QVariant &args)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Combobox arguments" << args;
|
||||
QStringList tags = args.toStringList();
|
||||
|
@ -58,9 +58,9 @@ public:
|
||||
Bars = 4
|
||||
};
|
||||
|
||||
explicit GraphicalItem(QWidget *parent, const QString filePath = QString());
|
||||
explicit GraphicalItem(QWidget *parent, const QString &filePath = QString());
|
||||
virtual ~GraphicalItem();
|
||||
GraphicalItem *copy(const QString _fileName, const int _number);
|
||||
GraphicalItem *copy(const QString &_fileName, const int _number);
|
||||
QString image(const QVariant &value);
|
||||
void initScene();
|
||||
// get methods
|
||||
@ -80,26 +80,26 @@ public:
|
||||
QStringList usedKeys() const;
|
||||
QString uniq() const;
|
||||
// set methods
|
||||
void setBar(const QString _bar = QString("cpu"));
|
||||
void setActiveColor(const QString _color = QString("color://0,0,0,130"));
|
||||
void setBar(const QString &_bar = QString("cpu"));
|
||||
void setActiveColor(const QString &_color = QString("color://0,0,0,130"));
|
||||
void setCount(const int _count = 100);
|
||||
void setCustom(const bool _custom = false);
|
||||
void setInactiveColor(const QString _color
|
||||
void setInactiveColor(const QString &_color
|
||||
= QString("color://255,255,255,130"));
|
||||
void setItemHeight(const int _height = 100);
|
||||
void setItemWidth(const int _width = 100);
|
||||
void setMinValue(const float _value = 0.0);
|
||||
void setMaxValue(const float _value = 100.0);
|
||||
void setType(const Type _type = Type::Horizontal);
|
||||
void setStrType(const QString _type = QString("Horizontal"));
|
||||
void setStrType(const QString &_type = QString("Horizontal"));
|
||||
void setDirection(const Direction _direction = Direction::LeftToRight);
|
||||
void setStrDirection(const QString _direction = QString("LeftToRight"));
|
||||
void setUsedKeys(const QStringList _usedKeys = QStringList());
|
||||
void setStrDirection(const QString &_direction = QString("LeftToRight"));
|
||||
void setUsedKeys(const QStringList &_usedKeys = QStringList());
|
||||
|
||||
public slots:
|
||||
void readConfiguration();
|
||||
QVariantHash run() { return QVariantHash(); };
|
||||
int showConfiguration(const QVariant args = QVariant());
|
||||
int showConfiguration(const QVariant &args = QVariant());
|
||||
void writeConfiguration() const;
|
||||
|
||||
private slots:
|
||||
|
@ -41,8 +41,8 @@ GraphicalItemHelper::~GraphicalItemHelper()
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItemHelper::setParameters(const QString active,
|
||||
const QString inactive, const int width,
|
||||
void GraphicalItemHelper::setParameters(const QString &active,
|
||||
const QString &inactive, const int width,
|
||||
const int height, const int count)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Use active color" << active << ", inactive" << inactive
|
||||
@ -81,7 +81,7 @@ void GraphicalItemHelper::setParameters(const QString active,
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItemHelper::paintBars(const float &value)
|
||||
void GraphicalItemHelper::paintBars(const float value)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Paint with value" << value;
|
||||
|
||||
@ -105,7 +105,7 @@ void GraphicalItemHelper::paintBars(const float &value)
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItemHelper::paintCircle(const float &percent)
|
||||
void GraphicalItemHelper::paintCircle(const float percent)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Paint with percent" << percent;
|
||||
|
||||
@ -128,7 +128,7 @@ void GraphicalItemHelper::paintCircle(const float &percent)
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItemHelper::paintGraph(const float &value)
|
||||
void GraphicalItemHelper::paintGraph(const float value)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Paint with value" << value;
|
||||
|
||||
@ -153,7 +153,7 @@ void GraphicalItemHelper::paintGraph(const float &value)
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItemHelper::paintHorizontal(const float &percent)
|
||||
void GraphicalItemHelper::paintHorizontal(const float percent)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Paint with percent" << percent;
|
||||
|
||||
@ -169,7 +169,7 @@ void GraphicalItemHelper::paintHorizontal(const float &percent)
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItemHelper::paintVertical(const float &percent)
|
||||
void GraphicalItemHelper::paintVertical(const float percent)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Paint with percent" << percent;
|
||||
|
||||
@ -184,8 +184,8 @@ void GraphicalItemHelper::paintVertical(const float &percent)
|
||||
}
|
||||
|
||||
|
||||
float GraphicalItemHelper::getPercents(const float &value, const float &min,
|
||||
const float &max)
|
||||
float GraphicalItemHelper::getPercents(const float value, const float min,
|
||||
const float max)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Get percent value from" << value;
|
||||
// newest Qt crashes here if value is nan
|
||||
@ -224,7 +224,7 @@ QColor GraphicalItemHelper::stringToColor(const QString &color)
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItemHelper::storeValue(const float &value)
|
||||
void GraphicalItemHelper::storeValue(const float value)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Save value to array" << value;
|
||||
|
||||
|
@ -34,21 +34,21 @@ public:
|
||||
QGraphicsScene *scene = nullptr);
|
||||
virtual ~GraphicalItemHelper();
|
||||
// parameters
|
||||
void setParameters(const QString active, const QString inactive,
|
||||
void setParameters(const QString &active, const QString &inactive,
|
||||
const int width, const int height, const int count);
|
||||
// paint methods
|
||||
void paintBars(const float &value);
|
||||
void paintCircle(const float &percent);
|
||||
void paintGraph(const float &value);
|
||||
void paintHorizontal(const float &percent);
|
||||
void paintVertical(const float &percent);
|
||||
void paintBars(const float value);
|
||||
void paintCircle(const float percent);
|
||||
void paintGraph(const float value);
|
||||
void paintHorizontal(const float percent);
|
||||
void paintVertical(const float percent);
|
||||
// additional conversion methods
|
||||
float getPercents(const float &value, const float &min, const float &max);
|
||||
float getPercents(const float value, const float min, const float max);
|
||||
bool isColor(const QString &input);
|
||||
QColor stringToColor(const QString &color);
|
||||
|
||||
private:
|
||||
void storeValue(const float &value);
|
||||
void storeValue(const float value);
|
||||
QGraphicsScene *m_scene = nullptr;
|
||||
int m_count = 100;
|
||||
QPen m_activePen;
|
||||
|
@ -36,7 +36,7 @@ OWMWeatherProvider::~OWMWeatherProvider()
|
||||
}
|
||||
|
||||
|
||||
void OWMWeatherProvider::initUrl(const QString city, const QString country,
|
||||
void OWMWeatherProvider::initUrl(const QString &city, const QString &country,
|
||||
const int ts)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Init query for" << city << country << "with ts" << ts;
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
|
||||
explicit OWMWeatherProvider(QObject *parent, const int number);
|
||||
virtual ~OWMWeatherProvider();
|
||||
void initUrl(const QString city, const QString country, const int);
|
||||
void initUrl(const QString &city, const QString &country, const int);
|
||||
QVariantHash parse(const QVariantMap &json) const;
|
||||
QUrl url() const;
|
||||
|
||||
|
@ -147,7 +147,7 @@ QList<int> QCronScheduler::QCronField::toList()
|
||||
return QList<int>();
|
||||
|
||||
QList<int> output;
|
||||
for (auto i = minValue; i <= maxValue; ++i) {
|
||||
for (auto &i = minValue; i <= maxValue; ++i) {
|
||||
if (i % div != 0)
|
||||
continue;
|
||||
output.append(i);
|
||||
|
@ -35,7 +35,7 @@ YahooWeatherProvider::~YahooWeatherProvider()
|
||||
}
|
||||
|
||||
|
||||
void YahooWeatherProvider::initUrl(const QString city, const QString country,
|
||||
void YahooWeatherProvider::initUrl(const QString &city, const QString &country,
|
||||
const int ts)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Init query for" << city << country << "with ts" << ts;
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
|
||||
explicit YahooWeatherProvider(QObject *parent, const int number);
|
||||
virtual ~YahooWeatherProvider();
|
||||
void initUrl(const QString city, const QString country, const int);
|
||||
void initUrl(const QString &city, const QString &country, const int);
|
||||
QVariantHash parse(const QVariantMap &json) const;
|
||||
QUrl url() const;
|
||||
|
||||
|
Reference in New Issue
Block a user