mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-23 02:29:56 +00:00
* logging changes
* add configuration export status message * prepare to release
This commit is contained in:
@ -40,19 +40,18 @@
|
||||
AWActions::AWActions(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||
}
|
||||
|
||||
|
||||
AWActions::~AWActions()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||
}
|
||||
|
||||
|
||||
void AWActions::checkUpdates(const bool showAnyway)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Show anyway" << showAnyway;
|
||||
|
||||
// showAnyway options requires to show message if no updates found on direct
|
||||
@ -70,15 +69,12 @@ void AWActions::checkUpdates(const bool showAnyway)
|
||||
// HACK: since QML could not use QLoggingCategory I need this hack
|
||||
bool AWActions::isDebugEnabled() const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
return LOG_AW().isDebugEnabled();
|
||||
}
|
||||
|
||||
|
||||
bool AWActions::runCmd(const QString cmd) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Cmd" << cmd;
|
||||
|
||||
sendNotification(QString("Info"), i18n("Run %1", cmd));
|
||||
@ -90,8 +86,6 @@ bool AWActions::runCmd(const QString cmd) const
|
||||
// HACK: this method uses variable from version.h
|
||||
void AWActions::showReadme() const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
QDesktopServices::openUrl(QString(HOMEPAGE));
|
||||
}
|
||||
|
||||
@ -99,7 +93,6 @@ void AWActions::showReadme() const
|
||||
// HACK: this method uses variables from version.h
|
||||
QString AWActions::getAboutText(const QString type) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Type" << type;
|
||||
|
||||
QString text;
|
||||
@ -159,7 +152,6 @@ QString AWActions::getAboutText(const QString type) const
|
||||
|
||||
QVariantMap AWActions::getFont(const QVariantMap defaultFont) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Default font is" << defaultFont;
|
||||
|
||||
QVariantMap fontMap;
|
||||
@ -179,7 +171,6 @@ QVariantMap AWActions::getFont(const QVariantMap defaultFont) const
|
||||
// to avoid additional object definition this method is static
|
||||
void AWActions::sendNotification(const QString eventId, const QString message)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Event" << eventId;
|
||||
qCDebug(LOG_AW) << "Message" << message;
|
||||
|
||||
@ -192,7 +183,6 @@ void AWActions::sendNotification(const QString eventId, const QString message)
|
||||
|
||||
void AWActions::showInfo(const QString version) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Version" << version;
|
||||
|
||||
QString text = i18n("You are using the actual version %1", version);
|
||||
@ -204,7 +194,6 @@ void AWActions::showInfo(const QString version) const
|
||||
|
||||
void AWActions::showUpdates(const QString version) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Version" << version;
|
||||
|
||||
QString text;
|
||||
@ -232,7 +221,6 @@ void AWActions::showUpdates(const QString version) const
|
||||
void AWActions::versionReplyRecieved(QNetworkReply *reply,
|
||||
const bool showAnyway) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Return code" << reply->error();
|
||||
qCDebug(LOG_AW) << "Reply error message" << reply->errorString();
|
||||
qCDebug(LOG_AW) << "Show anyway" << showAnyway;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <QDialogButtonBox>
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QQmlPropertyMap>
|
||||
#include <QSettings>
|
||||
#include <QTextCodec>
|
||||
@ -34,20 +35,18 @@
|
||||
AWConfigHelper::AWConfigHelper(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||
}
|
||||
|
||||
|
||||
AWConfigHelper::~AWConfigHelper()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||
}
|
||||
|
||||
|
||||
bool AWConfigHelper::dropCache() const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
QString fileName = QString("%1/awesomewidgets.ndx")
|
||||
.arg(QStandardPaths::writableLocation(
|
||||
QStandardPaths::GenericCacheLocation));
|
||||
@ -58,8 +57,6 @@ bool AWConfigHelper::dropCache() const
|
||||
|
||||
void AWConfigHelper::exportConfiguration(QObject *nativeConfig) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
// get file path and init settings object
|
||||
QString fileName = QFileDialog::getSaveFileName(nullptr, i18n("Export"));
|
||||
if (fileName.isEmpty())
|
||||
@ -105,13 +102,23 @@ void AWConfigHelper::exportConfiguration(QObject *nativeConfig) const
|
||||
|
||||
// sync settings
|
||||
settings.sync();
|
||||
// show additional message
|
||||
switch (settings.status()) {
|
||||
case QSettings::NoError:
|
||||
QMessageBox::information(
|
||||
nullptr, i18n("Success"),
|
||||
i18n("Please note that binary files were not copied"));
|
||||
break;
|
||||
default:
|
||||
QMessageBox::critical(nullptr, i18n("Ooops..."),
|
||||
i18n("Could not save configuration file"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QVariantMap AWConfigHelper::importConfiguration() const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
QVariantMap configuration;
|
||||
// get file path and init settings object
|
||||
QString fileName = QFileDialog::getOpenFileName(nullptr, i18n("Import"));
|
||||
@ -159,8 +166,6 @@ QVariantMap AWConfigHelper::importConfiguration() const
|
||||
|
||||
QVariantMap AWConfigHelper::readDataEngineConfiguration() const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
QString fileName
|
||||
= QStandardPaths::locate(QStandardPaths::ConfigLocation,
|
||||
QString("plasma-dataengine-extsysmon.conf"));
|
||||
@ -198,7 +203,7 @@ QVariantMap AWConfigHelper::readDataEngineConfiguration() const
|
||||
void AWConfigHelper::writeDataEngineConfiguration(
|
||||
const QVariantMap configuration) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Configuration" << configuration;
|
||||
|
||||
QString fileName
|
||||
= QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)
|
||||
@ -229,7 +234,6 @@ void AWConfigHelper::copyExtensions(const QString item, const QString type,
|
||||
QSettings &settings,
|
||||
const bool inverse) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Extension" << item;
|
||||
qCDebug(LOG_AW) << "Type" << type;
|
||||
qCDebug(LOG_AW) << "Inverse" << inverse;
|
||||
@ -253,8 +257,6 @@ void AWConfigHelper::copyExtensions(const QString item, const QString type,
|
||||
|
||||
void AWConfigHelper::copySettings(QSettings &from, QSettings &to) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
foreach (QString key, from.childKeys())
|
||||
to.setValue(key, from.value(key));
|
||||
}
|
||||
@ -263,7 +265,6 @@ void AWConfigHelper::copySettings(QSettings &from, QSettings &to) const
|
||||
void AWConfigHelper::readFile(QSettings &settings, const QString key,
|
||||
const QString fileName) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Key" << key;
|
||||
qCDebug(LOG_AW) << "File" << fileName;
|
||||
|
||||
@ -280,8 +281,6 @@ void AWConfigHelper::readFile(QSettings &settings, const QString key,
|
||||
|
||||
QHash<QString, bool> AWConfigHelper::selectImport() const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
QDialog *dialog = new QDialog(nullptr);
|
||||
QCheckBox *importPlasmoidSettings
|
||||
= new QCheckBox(i18n("Import plasmoid settings"), dialog);
|
||||
@ -308,7 +307,7 @@ QHash<QString, bool> AWConfigHelper::selectImport() const
|
||||
import[QString("plasmoid")] = false;
|
||||
import[QString("extensions")] = false;
|
||||
import[QString("adds")] = false;
|
||||
switch (int ret = dialog->exec()) {
|
||||
switch (dialog->exec()) {
|
||||
case QDialog::Accepted:
|
||||
import[QString("plasmoid")] = importPlasmoidSettings->isChecked();
|
||||
import[QString("extensions")] = importExtensionsSettings->isChecked();
|
||||
@ -327,7 +326,6 @@ QHash<QString, bool> AWConfigHelper::selectImport() const
|
||||
void AWConfigHelper::writeFile(QSettings &settings, const QString key,
|
||||
const QString fileName) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Key" << key;
|
||||
qCDebug(LOG_AW) << "File" << fileName;
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
AWDataAggregator::AWDataAggregator(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||
// required by signals
|
||||
qRegisterMetaType<QHash<QString, QString>>("QHash<QString, QString>");
|
||||
|
||||
@ -46,7 +46,7 @@ AWDataAggregator::AWDataAggregator(QObject *parent)
|
||||
|
||||
AWDataAggregator::~AWDataAggregator()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||
|
||||
delete toolTipScene;
|
||||
}
|
||||
@ -54,7 +54,6 @@ AWDataAggregator::~AWDataAggregator()
|
||||
|
||||
QList<float> AWDataAggregator::getData(const QString key) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Key" << key;
|
||||
|
||||
return data[QString("%1Tooltip").arg(key)];
|
||||
@ -63,8 +62,6 @@ QList<float> AWDataAggregator::getData(const QString key) const
|
||||
|
||||
QString AWDataAggregator::htmlImage(const QPixmap &source) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
QByteArray byteArray;
|
||||
QBuffer buffer(&byteArray);
|
||||
source.save(&buffer, "PNG");
|
||||
@ -78,7 +75,6 @@ QString AWDataAggregator::htmlImage(const QPixmap &source) const
|
||||
|
||||
void AWDataAggregator::setParameters(QVariantMap settings)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Settings" << settings;
|
||||
|
||||
// cast from QVariantMap to QVariantHash without data lost
|
||||
@ -131,8 +127,6 @@ void AWDataAggregator::setParameters(QVariantMap settings)
|
||||
|
||||
QPixmap AWDataAggregator::tooltipImage()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
// create image
|
||||
toolTipScene->clear();
|
||||
QPen pen;
|
||||
@ -176,8 +170,7 @@ QPixmap AWDataAggregator::tooltipImage()
|
||||
|
||||
void AWDataAggregator::dataUpdate(const QHash<QString, QString> &values)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
// do not log these arguments
|
||||
setData(values);
|
||||
emit(toolTipPainted(htmlImage(tooltipImage())));
|
||||
}
|
||||
@ -186,7 +179,6 @@ void AWDataAggregator::dataUpdate(const QHash<QString, QString> &values)
|
||||
void AWDataAggregator::checkValue(const QString source, const float value,
|
||||
const float extremum) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Notification source" << source;
|
||||
qCDebug(LOG_AW) << "Value" << value;
|
||||
qCDebug(LOG_AW) << "Called with extremum" << extremum;
|
||||
@ -208,7 +200,6 @@ void AWDataAggregator::checkValue(const QString source, const float value,
|
||||
void AWDataAggregator::checkValue(const QString source, const QString current,
|
||||
const QString received) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Notification source" << source;
|
||||
qCDebug(LOG_AW) << "Current value" << current;
|
||||
qCDebug(LOG_AW) << "Received value" << received;
|
||||
@ -221,8 +212,6 @@ void AWDataAggregator::checkValue(const QString source, const QString current,
|
||||
|
||||
void AWDataAggregator::initScene()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
toolTipScene = new QGraphicsScene(nullptr);
|
||||
toolTipView = new QGraphicsView(toolTipScene);
|
||||
toolTipView->setStyleSheet(QString("background: transparent"));
|
||||
@ -236,7 +225,6 @@ void AWDataAggregator::initScene()
|
||||
QString AWDataAggregator::notificationText(const QString source,
|
||||
const float value) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Notification source" << source;
|
||||
qCDebug(LOG_AW) << "Value" << value;
|
||||
|
||||
@ -259,7 +247,6 @@ QString AWDataAggregator::notificationText(const QString source,
|
||||
QString AWDataAggregator::notificationText(const QString source,
|
||||
const QString value) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Notification source" << source;
|
||||
qCDebug(LOG_AW) << "Value" << value;
|
||||
|
||||
@ -273,8 +260,7 @@ QString AWDataAggregator::notificationText(const QString source,
|
||||
|
||||
void AWDataAggregator::setData(const QHash<QString, QString> &values)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
// do not log these arguments
|
||||
// battery update requires info is AC online or not
|
||||
setData(values[QString("ac")] == configuration[QString("acOnline")],
|
||||
QString("batTooltip"), values[QString("bat")].toFloat());
|
||||
@ -301,7 +287,6 @@ void AWDataAggregator::setData(const QHash<QString, QString> &values)
|
||||
void AWDataAggregator::setData(const QString &source, float value,
|
||||
const float extremum)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Source" << source;
|
||||
qCDebug(LOG_AW) << "Value" << value;
|
||||
qCDebug(LOG_AW) << "Called with extremum" << extremum;
|
||||
@ -331,8 +316,9 @@ void AWDataAggregator::setData(const QString &source, float value,
|
||||
void AWDataAggregator::setData(const bool dontInvert, const QString &source,
|
||||
float value)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Do not invert value" << dontInvert;
|
||||
qCDebug(LOG_AW) << "Source" << source;
|
||||
qCDebug(LOG_AW) << "Value" << value;
|
||||
|
||||
// invert values for different battery colours
|
||||
value = dontInvert ? value : -value;
|
||||
|
@ -27,7 +27,7 @@ AWDataEngineAggregator::AWDataEngineAggregator(QObject *parent,
|
||||
const int interval)
|
||||
: QObject(parent)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||
|
||||
setInterval(interval);
|
||||
initDataEngines();
|
||||
@ -36,7 +36,7 @@ AWDataEngineAggregator::AWDataEngineAggregator(QObject *parent,
|
||||
|
||||
AWDataEngineAggregator::~AWDataEngineAggregator()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||
|
||||
// disconnect sources first
|
||||
disconnectSources();
|
||||
@ -46,8 +46,6 @@ AWDataEngineAggregator::~AWDataEngineAggregator()
|
||||
|
||||
void AWDataEngineAggregator::disconnectSources()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
foreach (QString dataengine, m_dataEngines.keys())
|
||||
foreach (QString source, m_dataEngines[dataengine]->sources())
|
||||
m_dataEngines[dataengine]->disconnectSource(source, parent());
|
||||
@ -56,7 +54,6 @@ void AWDataEngineAggregator::disconnectSources()
|
||||
|
||||
void AWDataEngineAggregator::setInterval(const int _interval)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Interval" << _interval;
|
||||
|
||||
m_interval = _interval;
|
||||
@ -65,7 +62,6 @@ void AWDataEngineAggregator::setInterval(const int _interval)
|
||||
|
||||
void AWDataEngineAggregator::dropSource(const QString source)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Source" << source;
|
||||
|
||||
// FIXME there is no possibility to check to which dataengine source
|
||||
@ -77,8 +73,6 @@ void AWDataEngineAggregator::dropSource(const QString source)
|
||||
|
||||
void AWDataEngineAggregator::reconnectSources()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
m_dataEngines[QString("systemmonitor")]->connectAllSources(parent(),
|
||||
m_interval);
|
||||
m_dataEngines[QString("extsysmon")]->connectAllSources(parent(),
|
||||
@ -90,8 +84,6 @@ void AWDataEngineAggregator::reconnectSources()
|
||||
|
||||
void AWDataEngineAggregator::initDataEngines()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
Plasma::DataEngineConsumer *deConsumer = new Plasma::DataEngineConsumer();
|
||||
m_dataEngines[QString("systemmonitor")]
|
||||
= deConsumer->dataEngine(QString("systemmonitor"));
|
||||
|
@ -20,6 +20,7 @@
|
||||
#define AWDATAENGINEAGGREGATOR_H
|
||||
|
||||
#include <Plasma/DataEngine>
|
||||
|
||||
#include <QObject>
|
||||
|
||||
|
||||
|
@ -42,10 +42,10 @@
|
||||
AWKeys::AWKeys(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
// logging
|
||||
qSetMessagePattern(LOG_FORMAT);
|
||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||
foreach (const QString metadata, getBuildData())
|
||||
qCDebug(LOG_AW) << metadata;
|
||||
|
||||
#ifdef BUILD_FUTURE
|
||||
// thread pool
|
||||
@ -63,7 +63,7 @@ AWKeys::AWKeys(QObject *parent)
|
||||
|
||||
AWKeys::~AWKeys()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||
|
||||
// extensions
|
||||
if (graphicalItems != nullptr)
|
||||
@ -89,7 +89,6 @@ AWKeys::~AWKeys()
|
||||
|
||||
void AWKeys::initDataAggregator(const QVariantMap tooltipParams)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Tooltip parameters" << tooltipParams;
|
||||
|
||||
dataAggregator->setParameters(tooltipParams);
|
||||
@ -99,7 +98,6 @@ void AWKeys::initDataAggregator(const QVariantMap tooltipParams)
|
||||
void AWKeys::initKeys(const QString currentPattern, const int interval,
|
||||
const int limit)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Pattern" << currentPattern;
|
||||
qCDebug(LOG_AW) << "Interval" << interval;
|
||||
qCDebug(LOG_AW) << "Queue limit" << limit;
|
||||
@ -124,7 +122,8 @@ void AWKeys::initKeys(const QString currentPattern, const int interval,
|
||||
|
||||
void AWKeys::setAggregatorProperty(const QString key, const QVariant value)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Key" << key;
|
||||
qCDebug(LOG_AW) << "Value" << value;
|
||||
|
||||
aggregator->setProperty(key.toUtf8().constData(), value);
|
||||
}
|
||||
@ -132,7 +131,6 @@ void AWKeys::setAggregatorProperty(const QString key, const QVariant value)
|
||||
|
||||
void AWKeys::setWrapNewLines(const bool wrap)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Is wrapping enabled" << wrap;
|
||||
|
||||
m_wrapNewLines = wrap;
|
||||
@ -141,8 +139,6 @@ void AWKeys::setWrapNewLines(const bool wrap)
|
||||
|
||||
void AWKeys::updateCache()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
// update network and hdd list
|
||||
addKeyToCache(QString("hdd"));
|
||||
addKeyToCache(QString("net"));
|
||||
@ -151,7 +147,6 @@ void AWKeys::updateCache()
|
||||
|
||||
QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Should be sorted" << sorted;
|
||||
qCDebug(LOG_AW) << "Filter" << regexp;
|
||||
|
||||
@ -320,8 +315,6 @@ QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const
|
||||
|
||||
QStringList AWKeys::getHddDevices() const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
QStringList devices = m_devices[QString("hdd")];
|
||||
// required by selector in the UI
|
||||
devices.insert(0, QString("disable"));
|
||||
@ -333,7 +326,6 @@ QStringList AWKeys::getHddDevices() const
|
||||
|
||||
QString AWKeys::infoByKey(QString key) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Requested key" << key;
|
||||
|
||||
key.remove(QRegExp(QString("^bar[0-9]{1,}")));
|
||||
@ -387,7 +379,6 @@ QString AWKeys::infoByKey(QString key) const
|
||||
// HACK this method requires to define tag value from bar from UI interface
|
||||
QString AWKeys::valueByKey(QString key) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Requested key" << key;
|
||||
|
||||
return values.value(key.remove(QRegExp(QString("^bar[0-9]{1,}"))),
|
||||
@ -397,7 +388,6 @@ QString AWKeys::valueByKey(QString key) const
|
||||
|
||||
void AWKeys::editItem(const QString type)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Item type" << type;
|
||||
|
||||
if (type == QString("graphicalitem")) {
|
||||
@ -418,7 +408,6 @@ void AWKeys::editItem(const QString type)
|
||||
|
||||
void AWKeys::addDevice(const QString source)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Source" << source;
|
||||
|
||||
QRegExp diskRegexp
|
||||
@ -442,12 +431,11 @@ void AWKeys::addDevice(const QString source)
|
||||
void AWKeys::dataUpdated(const QString &sourceName,
|
||||
const Plasma::DataEngine::Data &data)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Source" << sourceName;
|
||||
qCDebug(LOG_AW) << "Data" << data;
|
||||
|
||||
if (sourceName == QString("update"))
|
||||
// do not log these parameters
|
||||
if (sourceName == QString("update")) {
|
||||
qCInfo(LOG_AW) << "Update data";
|
||||
return emit(needToBeUpdated());
|
||||
}
|
||||
|
||||
#ifdef BUILD_FUTURE
|
||||
// run concurrent data update
|
||||
@ -461,8 +449,6 @@ void AWKeys::dataUpdated(const QString &sourceName,
|
||||
|
||||
void AWKeys::loadKeysFromCache()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
QString fileName = QString("%1/awesomewidgets.ndx")
|
||||
.arg(QStandardPaths::writableLocation(
|
||||
QStandardPaths::GenericCacheLocation));
|
||||
@ -483,8 +469,6 @@ void AWKeys::loadKeysFromCache()
|
||||
|
||||
void AWKeys::reinitKeys()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
// renew extensions
|
||||
// delete them if any
|
||||
if (graphicalItems != nullptr)
|
||||
@ -579,8 +563,6 @@ void AWKeys::reinitKeys()
|
||||
|
||||
void AWKeys::updateTextData()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
calculateValues();
|
||||
emit(needTextToBeUpdated(parsePattern(m_pattern)));
|
||||
emit(dataAggregator->updateData(values));
|
||||
@ -589,7 +571,6 @@ void AWKeys::updateTextData()
|
||||
|
||||
void AWKeys::addKeyToCache(const QString type, const QString key)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Key type" << type;
|
||||
qCDebug(LOG_AW) << "Key" << key;
|
||||
|
||||
@ -648,8 +629,6 @@ void AWKeys::addKeyToCache(const QString type, const QString key)
|
||||
// specified pattern. Usually they are values which depend on several others
|
||||
void AWKeys::calculateValues()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
// hddtot*
|
||||
foreach (QString device, m_devices[QString("mount")]) {
|
||||
int index = m_devices[QString("mount")].indexOf(device);
|
||||
@ -726,8 +705,6 @@ void AWKeys::calculateValues()
|
||||
|
||||
QString AWKeys::parsePattern(QString pattern) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
|
||||
// screen sign
|
||||
pattern.replace(QString("$$"), QString("$\\$\\"));
|
||||
|
||||
@ -770,7 +747,6 @@ QString AWKeys::parsePattern(QString pattern) const
|
||||
|
||||
void AWKeys::setDataBySource(const QString &sourceName, const QVariantMap &data)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Source" << sourceName;
|
||||
qCDebug(LOG_AW) << "Data" << data;
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#define AWKEYS_H
|
||||
|
||||
#include <Plasma/DataEngine>
|
||||
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
|
||||
|
@ -29,20 +29,19 @@
|
||||
AWKeysAggregator::AWKeysAggregator(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||
}
|
||||
|
||||
|
||||
AWKeysAggregator::~AWKeysAggregator()
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||
}
|
||||
|
||||
|
||||
QString AWKeysAggregator::formater(const QVariant &data,
|
||||
const QString &key) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Data" << data;
|
||||
qCDebug(LOG_AW) << "Key" << key;
|
||||
|
||||
@ -150,7 +149,6 @@ QString AWKeysAggregator::formater(const QVariant &data,
|
||||
|
||||
QStringList AWKeysAggregator::keysFromSource(const QString &source) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Search for source" << source;
|
||||
|
||||
return m_map.values(source);
|
||||
@ -159,7 +157,6 @@ QStringList AWKeysAggregator::keysFromSource(const QString &source) const
|
||||
|
||||
void AWKeysAggregator::setAcOffline(const QString inactive)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Inactive AC string" << inactive;
|
||||
|
||||
m_acOffline = inactive;
|
||||
@ -168,7 +165,6 @@ void AWKeysAggregator::setAcOffline(const QString inactive)
|
||||
|
||||
void AWKeysAggregator::setAcOnline(const QString active)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Active AC string" << active;
|
||||
|
||||
m_acOnline = active;
|
||||
@ -177,7 +173,6 @@ void AWKeysAggregator::setAcOnline(const QString active)
|
||||
|
||||
void AWKeysAggregator::setCustomTime(const QString customTime)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Format" << customTime;
|
||||
|
||||
m_customTime = customTime;
|
||||
@ -186,7 +181,6 @@ void AWKeysAggregator::setCustomTime(const QString customTime)
|
||||
|
||||
void AWKeysAggregator::setCustomUptime(const QString customUptime)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Format" << customUptime;
|
||||
|
||||
m_customUptime = customUptime;
|
||||
@ -195,7 +189,6 @@ void AWKeysAggregator::setCustomUptime(const QString customUptime)
|
||||
|
||||
void AWKeysAggregator::setDevices(const QHash<QString, QStringList> devices)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Devices" << devices;
|
||||
|
||||
m_devices = devices;
|
||||
@ -204,7 +197,6 @@ void AWKeysAggregator::setDevices(const QHash<QString, QStringList> devices)
|
||||
|
||||
void AWKeysAggregator::setTempUnits(const QString units)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Units" << units;
|
||||
|
||||
m_tempUnits = units;
|
||||
@ -213,7 +205,6 @@ void AWKeysAggregator::setTempUnits(const QString units)
|
||||
|
||||
void AWKeysAggregator::setTranslate(const bool translate)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Translate" << translate;
|
||||
|
||||
m_translate = translate;
|
||||
@ -225,7 +216,6 @@ void AWKeysAggregator::setTranslate(const bool translate)
|
||||
QStringList AWKeysAggregator::registerSource(const QString &source,
|
||||
const QString &units)
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Source" << source;
|
||||
qCDebug(LOG_AW) << "Units" << units;
|
||||
|
||||
@ -528,7 +518,6 @@ QStringList AWKeysAggregator::registerSource(const QString &source,
|
||||
|
||||
float AWKeysAggregator::temperature(const float temp) const
|
||||
{
|
||||
qCDebug(LOG_AW);
|
||||
qCDebug(LOG_AW) << "Temperature value" << temp;
|
||||
|
||||
float converted = temp;
|
||||
|
Reference in New Issue
Block a user