mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
parent
e38863ebc2
commit
08cb7d9abe
@ -215,9 +215,11 @@ bool AbstractExtItem::tryDelete() const
|
|||||||
{
|
{
|
||||||
if (debug) qDebug() << PDEBUG;
|
if (debug) qDebug() << PDEBUG;
|
||||||
|
|
||||||
for (int i=0; i<m_dirs.count(); i++)
|
for (int i=0; i<m_dirs.count(); i++) {
|
||||||
if (debug) qDebug() << PDEBUG << ":" << "Remove file" << QString("%1/%2").arg(m_dirs[i]).arg(m_fileName) <<
|
bool status = QFile::remove(QString("%1/%2").arg(m_dirs[i]).arg(m_fileName));
|
||||||
QFile::remove(QString("%1/%2").arg(m_dirs[i]).arg(m_fileName));
|
if (debug) qDebug() << PDEBUG << ":" << "Remove file" << QString("%1/%2").arg(m_dirs[i]).arg(m_fileName) << status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// check if exists
|
// check if exists
|
||||||
for (int i=0; i<m_dirs.count(); i++)
|
for (int i=0; i<m_dirs.count(); i++)
|
||||||
|
@ -63,7 +63,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void readConfiguration();
|
virtual void readConfiguration();
|
||||||
virtual QVariantMap run() = 0;
|
virtual QVariantHash run() = 0;
|
||||||
virtual int showConfiguration(const QVariant args = QVariant()) = 0;
|
virtual int showConfiguration(const QVariant args = QVariant()) = 0;
|
||||||
bool tryDelete() const;
|
bool tryDelete() const;
|
||||||
virtual void writeConfiguration() const;
|
virtual void writeConfiguration() const;
|
||||||
|
@ -44,15 +44,15 @@ ExtQuotes::ExtQuotes(QWidget *parent, const QString quotesName,
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
|
|
||||||
values[QString("ask")] = 0.0;
|
values[tag(QString("ask"))] = 0.0;
|
||||||
values[QString("askchg")] = 0.0;
|
values[tag(QString("askchg"))] = 0.0;
|
||||||
values[QString("percaskchg")] = 0.0;
|
values[tag(QString("percaskchg"))] = 0.0;
|
||||||
values[QString("bid")] = 0.0;
|
values[tag(QString("bid"))] = 0.0;
|
||||||
values[QString("bidchg")] = 0.0;
|
values[tag(QString("bidchg"))] = 0.0;
|
||||||
values[QString("percbidchg")] = 0.0;
|
values[tag(QString("percbidchg"))] = 0.0;
|
||||||
values[QString("price")] = 0.0;
|
values[tag(QString("price"))] = 0.0;
|
||||||
values[QString("pricechg")] = 0.0;
|
values[tag(QString("pricechg"))] = 0.0;
|
||||||
values[QString("percpricechg")] = 0.0;
|
values[tag(QString("percpricechg"))] = 0.0;
|
||||||
|
|
||||||
manager = new QNetworkAccessManager(this);
|
manager = new QNetworkAccessManager(this);
|
||||||
connect(manager, SIGNAL(finished(QNetworkReply *)),
|
connect(manager, SIGNAL(finished(QNetworkReply *)),
|
||||||
@ -136,7 +136,7 @@ void ExtQuotes::readConfiguration()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariantMap ExtQuotes::run()
|
QVariantHash ExtQuotes::run()
|
||||||
{
|
{
|
||||||
if (debug) qDebug() << PDEBUG;
|
if (debug) qDebug() << PDEBUG;
|
||||||
if ((!isActive()) || (isRunning)) return values;
|
if ((!isActive()) || (isRunning)) return values;
|
||||||
@ -219,24 +219,24 @@ void ExtQuotes::quotesReplyReceived(QNetworkReply *reply)
|
|||||||
|
|
||||||
// ask
|
// ask
|
||||||
value = jsonQuotes[QString("Ask")].toString().toFloat();
|
value = jsonQuotes[QString("Ask")].toString().toFloat();
|
||||||
values[QString("askchg")] = values[QString("ask")].toFloat() == 0.0 ? 0.0 :
|
values[tag(QString("askchg"))] = values[QString("ask")].toFloat() == 0.0 ? 0.0 :
|
||||||
value - values[QString("ask")].toFloat();
|
value - values[QString("ask")].toFloat();
|
||||||
values[QString("percaskchg")] = 100.0 * values[QString("askchg")].toFloat() / values[QString("ask")].toFloat();
|
values[tag(QString("percaskchg"))] = 100.0 * values[QString("askchg")].toFloat() / values[QString("ask")].toFloat();
|
||||||
values[QString("ask")] = value;
|
values[tag(QString("ask"))] = value;
|
||||||
|
|
||||||
// bid
|
// bid
|
||||||
value = jsonQuotes[QString("Bid")].toString().toFloat();
|
value = jsonQuotes[QString("Bid")].toString().toFloat();
|
||||||
values[QString("bidchg")] = values[QString("bid")].toFloat() == 0.0 ? 0.0 :
|
values[tag(QString("bidchg"))] = values[QString("bid")].toFloat() == 0.0 ? 0.0 :
|
||||||
value - values[QString("bid")].toFloat();
|
value - values[QString("bid")].toFloat();
|
||||||
values[QString("percbidchg")] = 100.0 * values[QString("bidchg")].toFloat() / values[QString("bid")].toFloat();
|
values[tag(QString("percbidchg"))] = 100.0 * values[QString("bidchg")].toFloat() / values[QString("bid")].toFloat();
|
||||||
values[QString("bid")] = value;
|
values[tag(QString("bid"))] = value;
|
||||||
|
|
||||||
// last trade
|
// last trade
|
||||||
value = jsonQuotes[QString("LastTradePriceOnly")].toString().toFloat();
|
value = jsonQuotes[QString("LastTradePriceOnly")].toString().toFloat();
|
||||||
values[QString("pricechg")] = values[QString("price")].toFloat() == 0.0 ? 0.0 :
|
values[tag(QString("pricechg"))] = values[QString("price")].toFloat() == 0.0 ? 0.0 :
|
||||||
value - values[QString("price")].toFloat();
|
value - values[QString("price")].toFloat();
|
||||||
values[QString("percpricechg")] = 100.0 * values[QString("pricechg")].toFloat() / values[QString("price")].toFloat();
|
values[tag(QString("percpricechg"))] = 100.0 * values[QString("pricechg")].toFloat() / values[QString("price")].toFloat();
|
||||||
values[QString("price")] = value;
|
values[tag(QString("price"))] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void readConfiguration();
|
void readConfiguration();
|
||||||
QVariantMap run();
|
QVariantHash run();
|
||||||
int showConfiguration(const QVariant args = QVariant());
|
int showConfiguration(const QVariant args = QVariant());
|
||||||
void writeConfiguration() const;
|
void writeConfiguration() const;
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ private:
|
|||||||
QString m_ticker = QString("EURUSD=X");
|
QString m_ticker = QString("EURUSD=X");
|
||||||
// values
|
// values
|
||||||
int times = 0;
|
int times = 0;
|
||||||
QVariantMap values;
|
QVariantHash values;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ ExtScript::ExtScript(QWidget *parent, const QString scriptName,
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
|
|
||||||
value[QString("value")] = QString("");
|
value[tag(QString("custom"))] = QString("");
|
||||||
|
|
||||||
process = new QProcess(this);
|
process = new QProcess(this);
|
||||||
connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(updateValue()));
|
connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(updateValue()));
|
||||||
@ -295,15 +295,14 @@ void ExtScript::readJsonFilters()
|
|||||||
QJsonParseError error;
|
QJsonParseError error;
|
||||||
QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonText.toUtf8(), &error);
|
QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonText.toUtf8(), &error);
|
||||||
if (debug) qDebug() << PDEBUG << ":" << "Json parse error" << error.errorString();
|
if (debug) qDebug() << PDEBUG << ":" << "Json parse error" << error.errorString();
|
||||||
if (error.error != QJsonParseError::NoError)
|
if (error.error != QJsonParseError::NoError) return;
|
||||||
return;
|
|
||||||
jsonFilters = jsonDoc.toVariant().toMap();
|
jsonFilters = jsonDoc.toVariant().toMap();
|
||||||
|
|
||||||
if (debug) qDebug() << PDEBUG << ":" << "Filters" << jsonFilters;
|
if (debug) qDebug() << PDEBUG << ":" << "Filters" << jsonFilters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariantMap ExtScript::run()
|
QVariantHash ExtScript::run()
|
||||||
{
|
{
|
||||||
if (debug) qDebug() << PDEBUG;
|
if (debug) qDebug() << PDEBUG;
|
||||||
if (!isActive()) return value;
|
if (!isActive()) return value;
|
||||||
@ -391,6 +390,7 @@ void ExtScript::updateValue()
|
|||||||
QString qdebug = QTextCodec::codecForMib(106)->toUnicode(process->readAllStandardError()).trimmed();
|
QString qdebug = QTextCodec::codecForMib(106)->toUnicode(process->readAllStandardError()).trimmed();
|
||||||
if (debug) qDebug() << PDEBUG << ":" << "Error" << qdebug;
|
if (debug) qDebug() << PDEBUG << ":" << "Error" << qdebug;
|
||||||
QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process->readAllStandardOutput()).trimmed();
|
QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process->readAllStandardOutput()).trimmed();
|
||||||
|
QString strValue;
|
||||||
|
|
||||||
switch (m_redirect) {
|
switch (m_redirect) {
|
||||||
case stdout2stderr:
|
case stdout2stderr:
|
||||||
@ -398,17 +398,17 @@ void ExtScript::updateValue()
|
|||||||
if (debug) qDebug() << PDEBUG << ":" << "Output" << qoutput;
|
if (debug) qDebug() << PDEBUG << ":" << "Output" << qoutput;
|
||||||
break;
|
break;
|
||||||
case stderr2stdout:
|
case stderr2stdout:
|
||||||
value[QString("value")] = QString("%1\n%2").arg(qdebug).arg(qoutput);
|
strValue = QString("%1\n%2").arg(qdebug).arg(qoutput);
|
||||||
break;
|
break;
|
||||||
case nothing:
|
case nothing:
|
||||||
default:
|
default:
|
||||||
if (debug) qDebug() << PDEBUG << ":" << "Debug" << qdebug;
|
if (debug) qDebug() << PDEBUG << ":" << "Debug" << qdebug;
|
||||||
value[QString("value")] = qoutput;
|
strValue = qoutput;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// filters
|
// filters
|
||||||
value[QString("value")] = applyFilters(value[QString("value")].toString());
|
value[tag(QString("custom"))] = applyFilters(strValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
void readConfiguration();
|
void readConfiguration();
|
||||||
void readJsonFilters();
|
void readJsonFilters();
|
||||||
QVariantMap run();
|
QVariantHash run();
|
||||||
int showConfiguration(const QVariant args = QVariant());
|
int showConfiguration(const QVariant args = QVariant());
|
||||||
void writeConfiguration() const;
|
void writeConfiguration() const;
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ private:
|
|||||||
Q_PID childProcess = 0;
|
Q_PID childProcess = 0;
|
||||||
QVariantMap jsonFilters = QVariantMap();
|
QVariantMap jsonFilters = QVariantMap();
|
||||||
int times = 0;
|
int times = 0;
|
||||||
QVariantMap value;
|
QVariantHash value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ ExtUpgrade::ExtUpgrade(QWidget *parent, const QString upgradeName,
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
|
|
||||||
value[QString("value")] = 0;
|
value[tag(QString("pkgcount"))] = 0;
|
||||||
|
|
||||||
process = new QProcess(this);
|
process = new QProcess(this);
|
||||||
connect(process, SIGNAL(finished(int)), this, SLOT(updateValue()));
|
connect(process, SIGNAL(finished(int)), this, SLOT(updateValue()));
|
||||||
@ -143,7 +143,7 @@ void ExtUpgrade::readConfiguration()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariantMap ExtUpgrade::run()
|
QVariantHash ExtUpgrade::run()
|
||||||
{
|
{
|
||||||
if (debug) qDebug() << PDEBUG;
|
if (debug) qDebug() << PDEBUG;
|
||||||
if (!isActive()) return value;
|
if (!isActive()) return value;
|
||||||
@ -212,7 +212,7 @@ void ExtUpgrade::updateValue()
|
|||||||
if (debug) qDebug() << PDEBUG << ":" << "Error" << process->readAllStandardError();
|
if (debug) qDebug() << PDEBUG << ":" << "Error" << process->readAllStandardError();
|
||||||
|
|
||||||
QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process->readAllStandardOutput()).trimmed();
|
QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process->readAllStandardOutput()).trimmed();
|
||||||
value[QString("value")] = qoutput.split(QChar('\n'), QString::SkipEmptyParts).count() - m_null;
|
value[tag(QString("pkgcount"))] = qoutput.split(QChar('\n'), QString::SkipEmptyParts).count() - m_null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void readConfiguration();
|
void readConfiguration();
|
||||||
QVariantMap run();
|
QVariantHash run();
|
||||||
int showConfiguration(const QVariant args = QVariant());
|
int showConfiguration(const QVariant args = QVariant());
|
||||||
void writeConfiguration() const;
|
void writeConfiguration() const;
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ private:
|
|||||||
int m_null = 0;
|
int m_null = 0;
|
||||||
// internal properties
|
// internal properties
|
||||||
int times = 0;
|
int times = 0;
|
||||||
QVariantMap value;
|
QVariantHash value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,11 +44,11 @@ ExtWeather::ExtWeather(QWidget *parent, const QString weatherName,
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
|
|
||||||
values[QString("weatherId")] = 0;
|
values[tag(QString("weatherId"))] = 0;
|
||||||
values[QString("weather")] = QString("");
|
values[tag(QString("weather"))] = QString("");
|
||||||
values[QString("humidity")] = 0;
|
values[tag(QString("humidity"))] = 0;
|
||||||
values[QString("pressure")] = 0.0;
|
values[tag(QString("pressure"))] = 0.0;
|
||||||
values[QString("temperature")] = 0.0;
|
values[tag(QString("temperature"))] = 0.0;
|
||||||
|
|
||||||
manager = new QNetworkAccessManager(this);
|
manager = new QNetworkAccessManager(this);
|
||||||
connect(manager, SIGNAL(finished(QNetworkReply *)),
|
connect(manager, SIGNAL(finished(QNetworkReply *)),
|
||||||
@ -271,7 +271,7 @@ void ExtWeather::readConfiguration()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariantMap ExtWeather::run()
|
QVariantHash ExtWeather::run()
|
||||||
{
|
{
|
||||||
if (debug) qDebug() << PDEBUG;
|
if (debug) qDebug() << PDEBUG;
|
||||||
if ((!isActive()) || (isRunning)) return values;
|
if ((!isActive()) || (isRunning)) return values;
|
||||||
@ -363,7 +363,7 @@ void ExtWeather::weatherReplyReceived(QNetworkReply *reply)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantMap data;
|
QVariantHash data;
|
||||||
if (m_ts == 0)
|
if (m_ts == 0)
|
||||||
data = parseSingleJson(json);
|
data = parseSingleJson(json);
|
||||||
else {
|
else {
|
||||||
@ -371,15 +371,15 @@ void ExtWeather::weatherReplyReceived(QNetworkReply *reply)
|
|||||||
data = parseSingleJson(list.count() <= m_ts ? list[m_ts-1].toMap() : list.last().toMap());
|
data = parseSingleJson(list.count() <= m_ts ? list[m_ts-1].toMap() : list.last().toMap());
|
||||||
}
|
}
|
||||||
for (int i=0; i<data.keys().count(); i++)
|
for (int i=0; i<data.keys().count(); i++)
|
||||||
values[data.keys()[i]] = data[data.keys()[i]];
|
values[tag(data.keys()[i])] = data[data.keys()[i]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariantMap ExtWeather::parseSingleJson(const QVariantMap json) const
|
QVariantHash ExtWeather::parseSingleJson(const QVariantMap json) const
|
||||||
{
|
{
|
||||||
if (debug) qDebug() << PDEBUG;
|
if (debug) qDebug() << PDEBUG;
|
||||||
|
|
||||||
QVariantMap output;
|
QVariantHash output;
|
||||||
|
|
||||||
// weather status
|
// weather status
|
||||||
QVariantList weather = json[QString("weather")].toList();
|
QVariantList weather = json[QString("weather")].toList();
|
||||||
|
@ -57,7 +57,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void readConfiguration();
|
void readConfiguration();
|
||||||
QVariantMap run();
|
QVariantHash run();
|
||||||
int showConfiguration(const QVariant args = QVariant());
|
int showConfiguration(const QVariant args = QVariant());
|
||||||
void writeConfiguration() const;
|
void writeConfiguration() const;
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ private:
|
|||||||
QNetworkAccessManager *manager;
|
QNetworkAccessManager *manager;
|
||||||
bool isRunning = false;
|
bool isRunning = false;
|
||||||
Ui::ExtWeather *ui;
|
Ui::ExtWeather *ui;
|
||||||
QVariantMap parseSingleJson(const QVariantMap json) const;
|
QVariantHash parseSingleJson(const QVariantMap json) const;
|
||||||
void translate();
|
void translate();
|
||||||
QString url(const bool isForecast = false) const;
|
QString url(const bool isForecast = false) const;
|
||||||
// properties
|
// properties
|
||||||
@ -78,7 +78,7 @@ private:
|
|||||||
int m_ts = 0;
|
int m_ts = 0;
|
||||||
// values
|
// values
|
||||||
int times = 0;
|
int times = 0;
|
||||||
QVariantMap values;
|
QVariantHash values;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -393,12 +393,12 @@ void GraphicalItem::readConfiguration()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariantMap GraphicalItem::run()
|
QVariantHash GraphicalItem::run()
|
||||||
{
|
{
|
||||||
if (debug) qDebug() << PDEBUG;
|
if (debug) qDebug() << PDEBUG;
|
||||||
|
|
||||||
// required by abstract class
|
// required by abstract class
|
||||||
return QVariantMap();
|
return QVariantHash();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void readConfiguration();
|
void readConfiguration();
|
||||||
QVariantMap run();
|
QVariantHash run();
|
||||||
int showConfiguration(const QVariant args = QVariant());
|
int showConfiguration(const QVariant args = QVariant());
|
||||||
void writeConfiguration() const;
|
void writeConfiguration() const;
|
||||||
|
|
||||||
|
@ -590,9 +590,11 @@ bool ExtendedSysMon::updateSourceEvent(const QString &source)
|
|||||||
for (int i=0; i<battery.keys().count(); i++)
|
for (int i=0; i<battery.keys().count(); i++)
|
||||||
setData(source, battery.keys().at(i), battery[battery.keys().at(i)]);
|
setData(source, battery.keys().at(i), battery[battery.keys().at(i)]);
|
||||||
} else if (source == QString("custom")) {
|
} else if (source == QString("custom")) {
|
||||||
for (int i=0; i<externalScripts->items().count(); i++)
|
for (int i=0; i<externalScripts->items().count(); i++) {
|
||||||
setData(source, externalScripts->items().at(i)->tag(QString("custom")),
|
QVariantHash data = externalScripts->items().at(i)->run();
|
||||||
externalScripts->items().at(i)->run()[QString("value")]);
|
for (int j=0; j<data.keys().count(); j++)
|
||||||
|
setData(source, data.keys().at(j), data[data.keys().at(j)]);
|
||||||
|
}
|
||||||
} else if (source == QString("desktop")) {
|
} else if (source == QString("desktop")) {
|
||||||
QVariantHash desktop = getCurrentDesktop();
|
QVariantHash desktop = getCurrentDesktop();
|
||||||
for (int i=0; i<desktop.keys().count(); i++)
|
for (int i=0; i<desktop.keys().count(); i++)
|
||||||
@ -611,9 +613,11 @@ bool ExtendedSysMon::updateSourceEvent(const QString &source)
|
|||||||
} else if (source == QString("netdev")) {
|
} else if (source == QString("netdev")) {
|
||||||
setData(source, QString("value"), getNetworkDevice());
|
setData(source, QString("value"), getNetworkDevice());
|
||||||
} else if (source == QString("pkg")) {
|
} else if (source == QString("pkg")) {
|
||||||
for (int i=0; i<externalUpgrade->items().count(); i++)
|
for (int i=0; i<externalUpgrade->items().count(); i++) {
|
||||||
setData(source, externalUpgrade->items().at(i)->tag(QString("pkgcount")),
|
QVariantHash data = externalUpgrade->items().at(i)->run();
|
||||||
externalUpgrade->items().at(i)->run()[QString("value")]);
|
for (int j=0; j<data.keys().count(); j++)
|
||||||
|
setData(source, data.keys().at(j), data[data.keys().at(j)]);
|
||||||
|
}
|
||||||
} else if (source == QString("player")) {
|
} else if (source == QString("player")) {
|
||||||
QVariantHash player = getPlayerInfo(configuration[QString("PLAYER")],
|
QVariantHash player = getPlayerInfo(configuration[QString("PLAYER")],
|
||||||
configuration[QString("MPDADDRESS")],
|
configuration[QString("MPDADDRESS")],
|
||||||
@ -627,19 +631,17 @@ bool ExtendedSysMon::updateSourceEvent(const QString &source)
|
|||||||
setData(source, ps.keys().at(i), ps[ps.keys().at(i)]);
|
setData(source, ps.keys().at(i), ps[ps.keys().at(i)]);
|
||||||
} else if (source == QString("quotes")) {
|
} else if (source == QString("quotes")) {
|
||||||
for (int i=0; i<externalQuotes->items().count(); i++) {
|
for (int i=0; i<externalQuotes->items().count(); i++) {
|
||||||
QVariantMap data = externalQuotes->items().at(i)->run();
|
QVariantHash data = externalQuotes->items().at(i)->run();
|
||||||
for (int j=0; j<data.keys().count(); j++)
|
for (int j=0; j<data.keys().count(); j++)
|
||||||
setData(source, externalQuotes->items().at(i)->tag(data.keys()[j]),
|
setData(source, data.keys().at(j), data[data.keys().at(j)]);
|
||||||
data[data.keys()[j]]);
|
|
||||||
}
|
}
|
||||||
} else if (source == QString("update")) {
|
} else if (source == QString("update")) {
|
||||||
setData(source, QString("value"), true);
|
setData(source, QString("value"), true);
|
||||||
} else if (source == QString("weather")) {
|
} else if (source == QString("weather")) {
|
||||||
for (int i=0; i<externalWeather->items().count(); i++) {
|
for (int i=0; i<externalWeather->items().count(); i++) {
|
||||||
QVariantMap data = externalWeather->items().at(i)->run();
|
QVariantHash data = externalWeather->items().at(i)->run();
|
||||||
for (int j=0; j<data.keys().count(); j++)
|
for (int j=0; j<data.keys().count(); j++)
|
||||||
setData(source, externalWeather->items().at(i)->tag(data.keys()[j]),
|
setData(source, data.keys().at(j), data[data.keys().at(j)]);
|
||||||
data[data.keys()[j]]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user