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:
2017-05-04 15:00:50 +03:00
parent 6e99e262d4
commit 6e62ceaac7
119 changed files with 645 additions and 634 deletions

View File

@ -26,7 +26,7 @@
GPUTemperatureSource::GPUTemperatureSource(QObject *parent,
const QStringList args)
const QStringList &args)
: AbstractExtSysMonSource(parent, args)
{
Q_ASSERT(args.count() == 1);
@ -75,7 +75,7 @@ QString GPUTemperatureSource::autoGpu()
}
QVariant GPUTemperatureSource::data(QString source)
QVariant GPUTemperatureSource::data(const QString &source)
{
qCDebug(LOG_ESS) << "Source" << source;
@ -86,7 +86,7 @@ QVariant GPUTemperatureSource::data(QString source)
}
QVariantMap GPUTemperatureSource::initialData(QString source) const
QVariantMap GPUTemperatureSource::initialData(const QString &source) const
{
qCDebug(LOG_ESS) << "Source" << source;
@ -139,7 +139,7 @@ void GPUTemperatureSource::updateValue()
qCInfo(LOG_ESS) << "Output" << qoutput;
if (m_device == QString("nvidia")) {
for (auto str : qoutput.split(QChar('\n'), QString::SkipEmptyParts)) {
for (auto &str : qoutput.split(QChar('\n'), QString::SkipEmptyParts)) {
if (!str.contains(QString("<gpu_temp>")))
continue;
QString temp = str.remove(QString("<gpu_temp>"))
@ -148,7 +148,7 @@ void GPUTemperatureSource::updateValue()
break;
}
} else if (m_device == QString("ati")) {
for (auto str : qoutput.split(QChar('\n'), QString::SkipEmptyParts)) {
for (auto &str : qoutput.split(QChar('\n'), QString::SkipEmptyParts)) {
if (!str.contains(QString("Temperature")))
continue;
QString temp = str.split(QChar(' '), QString::SkipEmptyParts).at(4);