improve update events

This commit is contained in:
arcan1s
2015-07-20 00:21:39 +03:00
parent c7d998eb12
commit 1110929b14
13 changed files with 96 additions and 65 deletions

View File

@ -151,12 +151,12 @@ void ExtQuotes::setApiVersion(const int _apiVersion)
}
void ExtQuotes::setActive(const bool state)
void ExtQuotes::setActive(const bool _state)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "State" << state;
if (debug) qDebug() << PDEBUG << ":" << "State" << _state;
m_active = state;
m_active = _state;
}

View File

@ -196,12 +196,12 @@ void ExtScript::setApiVersion(const int _apiVersion)
}
void ExtScript::setActive(const bool state)
void ExtScript::setActive(const bool _state)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "State" << state;
if (debug) qDebug() << PDEBUG << ":" << "State" << _state;
m_active = state;
m_active = _state;
}
@ -519,7 +519,7 @@ void ExtScript::updateValue()
if (debug) qDebug() << PDEBUG << ":" << "Output" << qoutput;
break;
case stderr2stdout:
value = QString("%1\t%2").arg(qdebug).arg(qoutput);
value = QString("%1\n%2").arg(qdebug).arg(qoutput);
break;
case nothing:
default:

View File

@ -333,14 +333,14 @@ QVariantMap ExtendedSysMon::getBattery(const QString acpiPath)
(fullLevelFile.open(QIODevice::ReadOnly))) {
float batCurrent = QString(currentLevelFile.readLine()).trimmed().toFloat();
float batFull = QString(fullLevelFile.readLine()).trimmed().toFloat();
battery[QString("bat%1").arg(i)] = 100 * batCurrent / batFull;
battery[QString("bat%1").arg(i)] = static_cast<int>(100 * batCurrent / batFull);
currentLevel += batCurrent;
fullLevel += batFull;
}
currentLevelFile.close();
fullLevelFile.close();
}
battery[QString("bat")] = 100 * currentLevel / fullLevel;
battery[QString("bat")] = static_cast<int>(100 * currentLevel / fullLevel);
return battery;
}

View File

@ -146,12 +146,12 @@ void ExtUpgrade::setApiVersion(const int _apiVersion)
}
void ExtUpgrade::setActive(const bool state)
void ExtUpgrade::setActive(const bool _state)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "State" << state;
if (debug) qDebug() << PDEBUG << ":" << "State" << _state;
m_active = state;
m_active = _state;
}
@ -251,7 +251,7 @@ int ExtUpgrade::run()
if (!m_active) return value;
if ((times == 1) && (process->state() == QProcess::NotRunning))
process->start(QString("bash -c \"%1\"").arg(m_executable));
process->start(QString("sh -c \"%1\"").arg(m_executable));
else if (times >= m_interval)
times = 0;
times++;