some hash improvements
This commit is contained in:
arcan1s
2015-08-06 01:23:43 +03:00
parent e38863ebc2
commit 08cb7d9abe
13 changed files with 72 additions and 68 deletions

View File

@ -40,7 +40,7 @@ ExtUpgrade::ExtUpgrade(QWidget *parent, const QString upgradeName,
ui->setupUi(this);
translate();
value[QString("value")] = 0;
value[tag(QString("pkgcount"))] = 0;
process = new QProcess(this);
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 (!isActive()) return value;
@ -212,7 +212,7 @@ void ExtUpgrade::updateValue()
if (debug) qDebug() << PDEBUG << ":" << "Error" << process->readAllStandardError();
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;
}