mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-14 22:35:49 +00:00
improve update events
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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++;
|
||||
|
Reference in New Issue
Block a user