mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-25 19:49:55 +00:00
Replace yahoo finance to stooq (#131)
Old code is dropped to separated provider
This commit is contained in:
@ -63,8 +63,7 @@ ExtUpgrade *ExtUpgrade::copy(const QString &_fileName, const int _number)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "File" << _fileName << "with number" << _number;
|
||||
|
||||
ExtUpgrade *item
|
||||
= new ExtUpgrade(static_cast<QWidget *>(parent()), _fileName);
|
||||
ExtUpgrade *item = new ExtUpgrade(static_cast<QWidget *>(parent()), _fileName);
|
||||
copyDefaults(item);
|
||||
item->setExecutable(executable());
|
||||
item->setFilter(filter());
|
||||
@ -161,8 +160,7 @@ int ExtUpgrade::showConfiguration(const QVariant &_args)
|
||||
ui->label_numberValue->setText(QString("%1").arg(number()));
|
||||
ui->lineEdit_command->setText(executable());
|
||||
ui->lineEdit_filter->setText(filter());
|
||||
ui->checkBox_active->setCheckState(isActive() ? Qt::Checked
|
||||
: Qt::Unchecked);
|
||||
ui->checkBox_active->setCheckState(isActive() ? Qt::Checked : Qt::Unchecked);
|
||||
ui->spinBox_null->setValue(null());
|
||||
ui->lineEdit_schedule->setText(cron());
|
||||
ui->lineEdit_socket->setText(socket());
|
||||
@ -218,16 +216,12 @@ void ExtUpgrade::updateValue()
|
||||
qCInfo(LOG_LIB) << "Cmd returns" << m_process->exitCode();
|
||||
qCInfo(LOG_LIB) << "Error" << m_process->readAllStandardError();
|
||||
|
||||
QString qoutput = QTextCodec::codecForMib(106)
|
||||
->toUnicode(m_process->readAllStandardOutput())
|
||||
.trimmed();
|
||||
QString qoutput
|
||||
= QTextCodec::codecForMib(106)->toUnicode(m_process->readAllStandardOutput()).trimmed();
|
||||
m_values[tag("pkgcount")] = [this](QString output) {
|
||||
return filter().isEmpty()
|
||||
? output.split('\n', QString::SkipEmptyParts).count()
|
||||
- null()
|
||||
: output.split('\n', QString::SkipEmptyParts)
|
||||
.filter(QRegExp(filter()))
|
||||
.count();
|
||||
? output.split('\n', QString::SkipEmptyParts).count() - null()
|
||||
: output.split('\n', QString::SkipEmptyParts).filter(QRegExp(filter())).count();
|
||||
}(qoutput);
|
||||
|
||||
emit(dataReceived(m_values));
|
||||
|
Reference in New Issue
Block a user