* logging changes

* add configuration export status message
* prepare to release
This commit is contained in:
arcan1s 2015-10-20 00:34:29 +03:00
parent c161004640
commit 75ab84e993
39 changed files with 208 additions and 528 deletions

View File

@ -2,15 +2,18 @@ Code style
---------- ----------
The recommended code style is Qt one. See [this document](https://wiki.qt.io/Qt_Coding_Style) The recommended code style is Qt one. See [this document](https://wiki.qt.io/Qt_Coding_Style)
for more details. Some additional detail see below. for more details. To avoid manual labor there is automatic cmake target named
`clangformat` (see below). Some additional detail see below.
* Indent is only spaces. 4 spaces. * Indent is only spaces. 4 spaces.
* It is highly recommended to name private variables with `m_` prefix (`m_foo`). * It is highly recommended to name private variables with `m_` prefix (`m_foo`).
There is no exceptions for properties.
* Avoid to create a large methods. Exception: if method contains lambda functions. * Avoid to create a large methods. Exception: if method contains lambda functions.
* If some method is called only once, it is recommended to use lambda functions. * If some method is called only once, it is recommended to use lambda functions.
Exception is `Q_INVOKABLE` methods. Exception is `Q_INVOKABLE` methods.
* STL containers are not recommended, use Qt one instead. * STL containers are not recommended, use Qt ones instead.
* In other hand Qt specific variables (`qint`, `qfloat`, etc) are not recommended. * In other hand Qt specific variables types (`qint`, `qfloat`, etc) are not
recommended.
* Do not repeat yourself ([DRY](https://en.wikipedia.org/wiki/Don't_repeat_yourself)). * Do not repeat yourself ([DRY](https://en.wikipedia.org/wiki/Don't_repeat_yourself)).
* Headers declaration: * Headers declaration:
* Include only those headers which are strictly necessary inside headers. Use * Include only those headers which are strictly necessary inside headers. Use
@ -51,22 +54,22 @@ for more details. Some additional detail see below.
* C-like `NULL`, use `nullptr` instead. * C-like `NULL`, use `nullptr` instead.
* It is highly recommended to avoid implicit casts. * It is highly recommended to avoid implicit casts.
* Abstract classes (which has at least one pure virtual method) are allowed. * Abstract classes (which have at least one pure virtual method) are allowed.
* Templates are allowed and recommended. Templates usually should be desribed * Templates are allowed and recommended. Templates usually should be described
inside header not source code file. inside header not source code file.
* Hardcode is not recommended. But it is possible to use cmake variables to * Hardcode is not recommended. But it is possible to use cmake variables to
configure some items during build time. configure some items during build time.
* Build should not require any addition system variable declaration/changing. * Build should not require any additional system variable declaration/changing.
* Any line should not end with space. * Any line should not end with space.
* Do not hesitate move public methods to private one if possible. * Do not hesitate move public methods to private one if possible.
* Do not hesitate use `const` modifier. In other hand `volatile` modifier is not * Do not hesitate use `const` modifier. In other hand `volatile` modifier is not
recommended. recommended.
* New lines rules: * New lines rules:
* One line after license header. * One line after license header.
* One line between header group declaration (see above) (only for source files). * One line between header group declaration (see above).
* Two lines after header declaration and before declaration at the end of a * Two lines after header declaration and before declaration at the end of a
file. file.
* One line after class and types forward declaration in headers. * One line after class and types forward declarations in headers.
* One line before each method modifiers (`public`, `public slots`, etc). * One line before each method modifiers (`public`, `public slots`, etc).
* Two lines between methods inside source code (`*.cpp`). * Two lines between methods inside source code (`*.cpp`).
* One line after `qCDebug()` information (see below). * One line after `qCDebug()` information (see below).
@ -91,7 +94,7 @@ blocks). Comments also may use the following keywords:
* **HACK** - hacks inside code which requires to avoid some restrictions and/or * **HACK** - hacks inside code which requires to avoid some restrictions and/or
which adds additional non-obvious optimizations. which adds additional non-obvious optimizations.
Do not use dots at the end of the commend line. Do not use dots at the end of the comment line.
Development Development
----------- -----------
@ -137,9 +140,9 @@ Logging
For logging please use [QLoggingCategory](http://doc.qt.io/qt-5/qloggingcategory.html). For logging please use [QLoggingCategory](http://doc.qt.io/qt-5/qloggingcategory.html).
Available categories should be declared in `awdebug.*` files. The following log Available categories should be declared in `awdebug.*` files. The following log
level should be used: levels should be used:
* **debug** (`qCDebug()`) - method arguments information, method calls notifications. * **debug** (`qCDebug()`) - method arguments information.
* **info** (`qCInfo()`) - additional information inside methods. * **info** (`qCInfo()`) - additional information inside methods.
* **warning** (`qCWarning()`) - not critical information, which may be caused by * **warning** (`qCWarning()`) - not critical information, which may be caused by
mistakes in configuration for example. mistakes in configuration for example.
@ -148,6 +151,10 @@ level should be used:
* **critical** (`qCCritical()`) - a critical error. After this error program will * **critical** (`qCCritical()`) - a critical error. After this error program will
be terminated. be terminated.
The empty log string (e.g. `qCDebug();`) is not allowed because the method names
will be stripped by compiler with `Release` build type. To log class constructor
and destructor use `__PRETTY_FUNCTION__` macro.
Testing Testing
------- -------
@ -157,8 +164,7 @@ Testing
* Test builds should be: * Test builds should be:
1. `-DCMAKE_BUILD_TYPE=Debug`. 1. `-DCMAKE_BUILD_TYPE=Debug`.
2. `-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON`. 2. `-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON`.
3. `-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON`. 3. `-DCMAKE_BUILD_TYPE=Release`.
4. `-DCMAKE_BUILD_TYPE=Release`.
* It is recommended to create addition test if possible. * It is recommended to create addition test if possible.
* Addition test functions should be declated and used only inside `BUILD_TESTING` * Addition test functions should be declated and used only inside `BUILD_TESTING`
definition. definition.
@ -192,10 +198,10 @@ Tools
``` ```
FooClass::FooClass(QObject *parent, const QVariant var) FooClass::FooClass(QObject *parent, const QVariant var)
: QObject(parent), : QObject(parent)
m_var(var) , m_var(var)
{ {
qCDebug(LOG_AW); qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
// some code below if any // some code below if any
} }
``` ```

View File

@ -36,40 +36,41 @@ option(BUILD_RPM_PACKAGE "Build rpm package" OFF)
option(BUILD_FUTURE "Build with the features which will be marked as stable later" OFF) option(BUILD_FUTURE "Build with the features which will be marked as stable later" OFF)
option(BUILD_TESTING "Build with additional test abilities" OFF) option(BUILD_TESTING "Build with additional test abilities" OFF)
# some additional targets # some additional targets
set(CPPCHECK_EXECUTABLE "/usr/bin/cppcheck" CACHE STRING "Path to cppcheck executable")
set(CLANGFORMAT_EXECUTABLE "/usr/bin/clang-format" CACHE STRING "Path to clang-format executable") set(CLANGFORMAT_EXECUTABLE "/usr/bin/clang-format" CACHE STRING "Path to clang-format executable")
set(CPPCHECK_EXECUTABLE "/usr/bin/cppcheck" CACHE STRING "Path to cppcheck executable")
# flags # flags
if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-Wall -Wno-cpp -std=c++11") set(CMAKE_CXX_FLAGS "-Wall -Wno-cpp -std=c++11")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_OPTIMIZATION "-O3 -DNDEBUG") set(CMAKE_CXX_FLAGS_OPTIMIZATION "-Ofast -DNDEBUG")
# avoid newer gcc warnings # avoid newer gcc warnings
add_definitions(-D_DEFAULT_SOURCE) add_definitions(-D_DEFAULT_SOURCE)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "-Wall -std=c++11 -stdlib=libc++") set(CMAKE_CXX_FLAGS "-Wall -std=c++11 -stdlib=libc++")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_OPTIMIZATION "-O3 -DNDEBUG") set(CMAKE_CXX_FLAGS_OPTIMIZATION "-Ofast -DNDEBUG")
# linker flags # linker flags
set(CMAKE_EXE_LINKER_FLAGS "-lc++abi") set(CMAKE_EXE_LINKER_FLAGS "-lc++abi")
set(CMAKE_MODULE_LINKER_FLAGS "-lc++abi") set(CMAKE_MODULE_LINKER_FLAGS "-lc++abi")
set(CMAKE_SHARED_LINKER_FLAGS "-lc++abi") set(CMAKE_SHARED_LINKER_FLAGS "-lc++abi")
else() else ()
message(FATAL_ERROR "Unknown compiler") message(FATAL_ERROR "Unknown compiler")
endif () endif ()
if (CMAKE_BUILD_TYPE MATCHES Debug) if (CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_VERBOSE_MAKEFILE ON)
endif () endif ()
configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
set(PROJECT_TRDPARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty) set(PROJECT_TRDPARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty)
set(PROJECT_LIBRARY awesomewidgets) set(PROJECT_LIBRARY awesomewidgets)
include(libraries.cmake) include(libraries.cmake)
include(clang-format.cmake) include(clang-format.cmake)
include(cppcheck.cmake) include(cppcheck.cmake)
get_directory_property(CMAKE_DEFINITIONS COMPILE_DEFINITIONS)
configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
add_subdirectory(awesomewidgets) add_subdirectory(awesomewidgets)
add_subdirectory(extsysmon) add_subdirectory(extsysmon)
if (BUILD_PLASMOIDS) if (BUILD_PLASMOIDS)

View File

@ -17,6 +17,7 @@
#include "awdebug.h" #include "awdebug.h"
#include "version.h"
Q_LOGGING_CATEGORY(LOG_AW, "org.kde.plasma.awesomewidget", Q_LOGGING_CATEGORY(LOG_AW, "org.kde.plasma.awesomewidget",
@ -26,3 +27,58 @@ Q_LOGGING_CATEGORY(LOG_DP, "org.kde.plasma.desktoppanel",
Q_LOGGING_CATEGORY(LOG_ESM, "org.kde.plasma.extsysmon", QtMsgType::QtWarningMsg) Q_LOGGING_CATEGORY(LOG_ESM, "org.kde.plasma.extsysmon", QtMsgType::QtWarningMsg)
Q_LOGGING_CATEGORY(LOG_LIB, "org.kde.plasma.awesomewidgets", Q_LOGGING_CATEGORY(LOG_LIB, "org.kde.plasma.awesomewidgets",
QtMsgType::QtWarningMsg) QtMsgType::QtWarningMsg)
const QStringList getBuildData()
{
QStringList metadata;
metadata.append(QString("=== Awesome Widgets configuration details ==="));
// build information
metadata.append(QString("Build details:"));
metadata.append(QString(" VERSION: %1").arg(VERSION));
metadata.append(QString(" COMMIT_SHA: %1").arg(COMMIT_SHA));
metadata.append(QString(" BUILD_DATE: %1").arg(BUILD_DATE));
// configuration
metadata.append(QString("API details:"));
metadata.append(QString(" AWGIAPI: %1").arg(AWGIAPI));
metadata.append(QString(" AWEQAPI: %1").arg(AWEQAPI));
metadata.append(QString(" AWESAPI: %1").arg(AWESAPI));
metadata.append(QString(" AWEUAPI: %1").arg(AWEUAPI));
metadata.append(QString(" AWEWAPI: %1").arg(AWEWAPI));
metadata.append(QString(" TIME_KEYS: %1").arg(TIME_KEYS));
// cmake properties
metadata.append(QString("cmake properties:"));
metadata.append(QString(" CMAKE_BUILD_TYPE: %1").arg(CMAKE_BUILD_TYPE));
metadata.append(
QString(" CMAKE_CXX_COMPILER: %1").arg(CMAKE_CXX_COMPILER));
metadata.append(QString(" CMAKE_CXX_FLAGS: %1").arg(CMAKE_CXX_FLAGS));
metadata.append(
QString(" CMAKE_CXX_FLAGS_DEBUG: %1").arg(CMAKE_CXX_FLAGS_DEBUG));
metadata.append(QString(" CMAKE_CXX_FLAGS_RELEASE: %1")
.arg(CMAKE_CXX_FLAGS_RELEASE));
metadata.append(QString(" CMAKE_CXX_FLAGS_OPTIMIZATION: %1")
.arg(CMAKE_CXX_FLAGS_OPTIMIZATION));
metadata.append(
QString(" CMAKE_DEFINITIONS: %1").arg(CMAKE_DEFINITIONS));
metadata.append(
QString(" CMAKE_INSTALL_PREFIX: %1").arg(CMAKE_INSTALL_PREFIX));
metadata.append(QString(" CMAKE_MODULE_LINKER_FLAGS: %1")
.arg(CMAKE_MODULE_LINKER_FLAGS));
metadata.append(QString(" CMAKE_SHARED_LINKER_FLAGS: %1")
.arg(CMAKE_SHARED_LINKER_FLAGS));
// components
metadata.append(QString("Components data:"));
metadata.append(QString(" BUILD_PLASMOIDS: %1").arg(BUILD_PLASMOIDS));
metadata.append(
QString(" BUILD_DEB_PACKAGE: %1").arg(BUILD_DEB_PACKAGE));
metadata.append(
QString(" BUILD_RPM_PACKAGE: %1").arg(BUILD_RPM_PACKAGE));
metadata.append(
QString(" CLANGFORMAT_EXECUTABLE: %1").arg(CLANGFORMAT_EXECUTABLE));
metadata.append(
QString(" CPPCHECK_EXECUTABLE: %1").arg(CPPCHECK_EXECUTABLE));
metadata.append(QString(" PROP_FUTURE: %1").arg(PROP_FUTURE));
metadata.append(QString(" PROP_FUTURE: %1").arg(PROP_FUTURE));
return metadata;
}

View File

@ -23,8 +23,7 @@
#ifndef LOG_FORMAT #ifndef LOG_FORMAT
#define LOG_FORMAT \ #define LOG_FORMAT \
"[%{time " \ "[%{time process}][%{if-debug}DD%{endif}%{if-info}II%{endif}%{if-" \
"yyyy-MM-ddTHH:mm:ss.zzz}][%{if-debug}DD%{endif}%{if-info}II%{endif}%{if-" \
"warning}WW%{endif}%{if-critical}CC%{endif}%{if-fatal}FF%{endif}][%{" \ "warning}WW%{endif}%{if-critical}CC%{endif}%{if-fatal}FF%{endif}][%{" \
"category}][%{function}] %{message}" "category}][%{function}] %{message}"
#endif /* LOG_FORMAT */ #endif /* LOG_FORMAT */
@ -45,5 +44,7 @@ Q_DECLARE_LOGGING_CATEGORY(LOG_DP)
Q_DECLARE_LOGGING_CATEGORY(LOG_ESM) Q_DECLARE_LOGGING_CATEGORY(LOG_ESM)
Q_DECLARE_LOGGING_CATEGORY(LOG_LIB) Q_DECLARE_LOGGING_CATEGORY(LOG_LIB)
const QStringList getBuildData();
#endif /* AWDEBUG_H */ #endif /* AWDEBUG_H */

View File

@ -40,19 +40,18 @@
AWActions::AWActions(QObject *parent) AWActions::AWActions(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
qCDebug(LOG_AW); qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
} }
AWActions::~AWActions() AWActions::~AWActions()
{ {
qCDebug(LOG_AW); qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
} }
void AWActions::checkUpdates(const bool showAnyway) void AWActions::checkUpdates(const bool showAnyway)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Show anyway" << showAnyway; qCDebug(LOG_AW) << "Show anyway" << showAnyway;
// showAnyway options requires to show message if no updates found on direct // 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 // HACK: since QML could not use QLoggingCategory I need this hack
bool AWActions::isDebugEnabled() const bool AWActions::isDebugEnabled() const
{ {
qCDebug(LOG_AW);
return LOG_AW().isDebugEnabled(); return LOG_AW().isDebugEnabled();
} }
bool AWActions::runCmd(const QString cmd) const bool AWActions::runCmd(const QString cmd) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Cmd" << cmd; qCDebug(LOG_AW) << "Cmd" << cmd;
sendNotification(QString("Info"), i18n("Run %1", 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 // HACK: this method uses variable from version.h
void AWActions::showReadme() const void AWActions::showReadme() const
{ {
qCDebug(LOG_AW);
QDesktopServices::openUrl(QString(HOMEPAGE)); QDesktopServices::openUrl(QString(HOMEPAGE));
} }
@ -99,7 +93,6 @@ void AWActions::showReadme() const
// HACK: this method uses variables from version.h // HACK: this method uses variables from version.h
QString AWActions::getAboutText(const QString type) const QString AWActions::getAboutText(const QString type) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Type" << type; qCDebug(LOG_AW) << "Type" << type;
QString text; QString text;
@ -159,7 +152,6 @@ QString AWActions::getAboutText(const QString type) const
QVariantMap AWActions::getFont(const QVariantMap defaultFont) const QVariantMap AWActions::getFont(const QVariantMap defaultFont) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Default font is" << defaultFont; qCDebug(LOG_AW) << "Default font is" << defaultFont;
QVariantMap fontMap; QVariantMap fontMap;
@ -179,7 +171,6 @@ QVariantMap AWActions::getFont(const QVariantMap defaultFont) const
// to avoid additional object definition this method is static // to avoid additional object definition this method is static
void AWActions::sendNotification(const QString eventId, const QString message) void AWActions::sendNotification(const QString eventId, const QString message)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Event" << eventId; qCDebug(LOG_AW) << "Event" << eventId;
qCDebug(LOG_AW) << "Message" << message; 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 void AWActions::showInfo(const QString version) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Version" << version; qCDebug(LOG_AW) << "Version" << version;
QString text = i18n("You are using the actual version %1", 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 void AWActions::showUpdates(const QString version) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Version" << version; qCDebug(LOG_AW) << "Version" << version;
QString text; QString text;
@ -232,7 +221,6 @@ void AWActions::showUpdates(const QString version) const
void AWActions::versionReplyRecieved(QNetworkReply *reply, void AWActions::versionReplyRecieved(QNetworkReply *reply,
const bool showAnyway) const const bool showAnyway) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Return code" << reply->error(); qCDebug(LOG_AW) << "Return code" << reply->error();
qCDebug(LOG_AW) << "Reply error message" << reply->errorString(); qCDebug(LOG_AW) << "Reply error message" << reply->errorString();
qCDebug(LOG_AW) << "Show anyway" << showAnyway; qCDebug(LOG_AW) << "Show anyway" << showAnyway;

View File

@ -23,6 +23,7 @@
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QDir> #include <QDir>
#include <QFileDialog> #include <QFileDialog>
#include <QMessageBox>
#include <QQmlPropertyMap> #include <QQmlPropertyMap>
#include <QSettings> #include <QSettings>
#include <QTextCodec> #include <QTextCodec>
@ -34,20 +35,18 @@
AWConfigHelper::AWConfigHelper(QObject *parent) AWConfigHelper::AWConfigHelper(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
qCDebug(LOG_AW); qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
} }
AWConfigHelper::~AWConfigHelper() AWConfigHelper::~AWConfigHelper()
{ {
qCDebug(LOG_AW); qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
} }
bool AWConfigHelper::dropCache() const bool AWConfigHelper::dropCache() const
{ {
qCDebug(LOG_AW);
QString fileName = QString("%1/awesomewidgets.ndx") QString fileName = QString("%1/awesomewidgets.ndx")
.arg(QStandardPaths::writableLocation( .arg(QStandardPaths::writableLocation(
QStandardPaths::GenericCacheLocation)); QStandardPaths::GenericCacheLocation));
@ -58,8 +57,6 @@ bool AWConfigHelper::dropCache() const
void AWConfigHelper::exportConfiguration(QObject *nativeConfig) const void AWConfigHelper::exportConfiguration(QObject *nativeConfig) const
{ {
qCDebug(LOG_AW);
// get file path and init settings object // get file path and init settings object
QString fileName = QFileDialog::getSaveFileName(nullptr, i18n("Export")); QString fileName = QFileDialog::getSaveFileName(nullptr, i18n("Export"));
if (fileName.isEmpty()) if (fileName.isEmpty())
@ -105,13 +102,23 @@ void AWConfigHelper::exportConfiguration(QObject *nativeConfig) const
// sync settings // sync settings
settings.sync(); 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 QVariantMap AWConfigHelper::importConfiguration() const
{ {
qCDebug(LOG_AW);
QVariantMap configuration; QVariantMap configuration;
// get file path and init settings object // get file path and init settings object
QString fileName = QFileDialog::getOpenFileName(nullptr, i18n("Import")); QString fileName = QFileDialog::getOpenFileName(nullptr, i18n("Import"));
@ -159,8 +166,6 @@ QVariantMap AWConfigHelper::importConfiguration() const
QVariantMap AWConfigHelper::readDataEngineConfiguration() const QVariantMap AWConfigHelper::readDataEngineConfiguration() const
{ {
qCDebug(LOG_AW);
QString fileName QString fileName
= QStandardPaths::locate(QStandardPaths::ConfigLocation, = QStandardPaths::locate(QStandardPaths::ConfigLocation,
QString("plasma-dataengine-extsysmon.conf")); QString("plasma-dataengine-extsysmon.conf"));
@ -198,7 +203,7 @@ QVariantMap AWConfigHelper::readDataEngineConfiguration() const
void AWConfigHelper::writeDataEngineConfiguration( void AWConfigHelper::writeDataEngineConfiguration(
const QVariantMap configuration) const const QVariantMap configuration) const
{ {
qCDebug(LOG_AW); qCDebug(LOG_AW) << "Configuration" << configuration;
QString fileName QString fileName
= QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)
@ -229,7 +234,6 @@ void AWConfigHelper::copyExtensions(const QString item, const QString type,
QSettings &settings, QSettings &settings,
const bool inverse) const const bool inverse) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Extension" << item; qCDebug(LOG_AW) << "Extension" << item;
qCDebug(LOG_AW) << "Type" << type; qCDebug(LOG_AW) << "Type" << type;
qCDebug(LOG_AW) << "Inverse" << inverse; 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 void AWConfigHelper::copySettings(QSettings &from, QSettings &to) const
{ {
qCDebug(LOG_AW);
foreach (QString key, from.childKeys()) foreach (QString key, from.childKeys())
to.setValue(key, from.value(key)); 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, void AWConfigHelper::readFile(QSettings &settings, const QString key,
const QString fileName) const const QString fileName) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Key" << key; qCDebug(LOG_AW) << "Key" << key;
qCDebug(LOG_AW) << "File" << fileName; qCDebug(LOG_AW) << "File" << fileName;
@ -280,8 +281,6 @@ void AWConfigHelper::readFile(QSettings &settings, const QString key,
QHash<QString, bool> AWConfigHelper::selectImport() const QHash<QString, bool> AWConfigHelper::selectImport() const
{ {
qCDebug(LOG_AW);
QDialog *dialog = new QDialog(nullptr); QDialog *dialog = new QDialog(nullptr);
QCheckBox *importPlasmoidSettings QCheckBox *importPlasmoidSettings
= new QCheckBox(i18n("Import plasmoid settings"), dialog); = new QCheckBox(i18n("Import plasmoid settings"), dialog);
@ -308,7 +307,7 @@ QHash<QString, bool> AWConfigHelper::selectImport() const
import[QString("plasmoid")] = false; import[QString("plasmoid")] = false;
import[QString("extensions")] = false; import[QString("extensions")] = false;
import[QString("adds")] = false; import[QString("adds")] = false;
switch (int ret = dialog->exec()) { switch (dialog->exec()) {
case QDialog::Accepted: case QDialog::Accepted:
import[QString("plasmoid")] = importPlasmoidSettings->isChecked(); import[QString("plasmoid")] = importPlasmoidSettings->isChecked();
import[QString("extensions")] = importExtensionsSettings->isChecked(); import[QString("extensions")] = importExtensionsSettings->isChecked();
@ -327,7 +326,6 @@ QHash<QString, bool> AWConfigHelper::selectImport() const
void AWConfigHelper::writeFile(QSettings &settings, const QString key, void AWConfigHelper::writeFile(QSettings &settings, const QString key,
const QString fileName) const const QString fileName) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Key" << key; qCDebug(LOG_AW) << "Key" << key;
qCDebug(LOG_AW) << "File" << fileName; qCDebug(LOG_AW) << "File" << fileName;

View File

@ -34,7 +34,7 @@
AWDataAggregator::AWDataAggregator(QObject *parent) AWDataAggregator::AWDataAggregator(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
qCDebug(LOG_AW); qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
// required by signals // required by signals
qRegisterMetaType<QHash<QString, QString>>("QHash<QString, QString>"); qRegisterMetaType<QHash<QString, QString>>("QHash<QString, QString>");
@ -46,7 +46,7 @@ AWDataAggregator::AWDataAggregator(QObject *parent)
AWDataAggregator::~AWDataAggregator() AWDataAggregator::~AWDataAggregator()
{ {
qCDebug(LOG_AW); qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
delete toolTipScene; delete toolTipScene;
} }
@ -54,7 +54,6 @@ AWDataAggregator::~AWDataAggregator()
QList<float> AWDataAggregator::getData(const QString key) const QList<float> AWDataAggregator::getData(const QString key) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Key" << key; qCDebug(LOG_AW) << "Key" << key;
return data[QString("%1Tooltip").arg(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 QString AWDataAggregator::htmlImage(const QPixmap &source) const
{ {
qCDebug(LOG_AW);
QByteArray byteArray; QByteArray byteArray;
QBuffer buffer(&byteArray); QBuffer buffer(&byteArray);
source.save(&buffer, "PNG"); source.save(&buffer, "PNG");
@ -78,7 +75,6 @@ QString AWDataAggregator::htmlImage(const QPixmap &source) const
void AWDataAggregator::setParameters(QVariantMap settings) void AWDataAggregator::setParameters(QVariantMap settings)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Settings" << settings; qCDebug(LOG_AW) << "Settings" << settings;
// cast from QVariantMap to QVariantHash without data lost // cast from QVariantMap to QVariantHash without data lost
@ -131,8 +127,6 @@ void AWDataAggregator::setParameters(QVariantMap settings)
QPixmap AWDataAggregator::tooltipImage() QPixmap AWDataAggregator::tooltipImage()
{ {
qCDebug(LOG_AW);
// create image // create image
toolTipScene->clear(); toolTipScene->clear();
QPen pen; QPen pen;
@ -176,8 +170,7 @@ QPixmap AWDataAggregator::tooltipImage()
void AWDataAggregator::dataUpdate(const QHash<QString, QString> &values) void AWDataAggregator::dataUpdate(const QHash<QString, QString> &values)
{ {
qCDebug(LOG_AW); // do not log these arguments
setData(values); setData(values);
emit(toolTipPainted(htmlImage(tooltipImage()))); 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, void AWDataAggregator::checkValue(const QString source, const float value,
const float extremum) const const float extremum) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Notification source" << source; qCDebug(LOG_AW) << "Notification source" << source;
qCDebug(LOG_AW) << "Value" << value; qCDebug(LOG_AW) << "Value" << value;
qCDebug(LOG_AW) << "Called with extremum" << extremum; 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, void AWDataAggregator::checkValue(const QString source, const QString current,
const QString received) const const QString received) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Notification source" << source; qCDebug(LOG_AW) << "Notification source" << source;
qCDebug(LOG_AW) << "Current value" << current; qCDebug(LOG_AW) << "Current value" << current;
qCDebug(LOG_AW) << "Received value" << received; qCDebug(LOG_AW) << "Received value" << received;
@ -221,8 +212,6 @@ void AWDataAggregator::checkValue(const QString source, const QString current,
void AWDataAggregator::initScene() void AWDataAggregator::initScene()
{ {
qCDebug(LOG_AW);
toolTipScene = new QGraphicsScene(nullptr); toolTipScene = new QGraphicsScene(nullptr);
toolTipView = new QGraphicsView(toolTipScene); toolTipView = new QGraphicsView(toolTipScene);
toolTipView->setStyleSheet(QString("background: transparent")); toolTipView->setStyleSheet(QString("background: transparent"));
@ -236,7 +225,6 @@ void AWDataAggregator::initScene()
QString AWDataAggregator::notificationText(const QString source, QString AWDataAggregator::notificationText(const QString source,
const float value) const const float value) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Notification source" << source; qCDebug(LOG_AW) << "Notification source" << source;
qCDebug(LOG_AW) << "Value" << value; qCDebug(LOG_AW) << "Value" << value;
@ -259,7 +247,6 @@ QString AWDataAggregator::notificationText(const QString source,
QString AWDataAggregator::notificationText(const QString source, QString AWDataAggregator::notificationText(const QString source,
const QString value) const const QString value) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Notification source" << source; qCDebug(LOG_AW) << "Notification source" << source;
qCDebug(LOG_AW) << "Value" << value; qCDebug(LOG_AW) << "Value" << value;
@ -273,8 +260,7 @@ QString AWDataAggregator::notificationText(const QString source,
void AWDataAggregator::setData(const QHash<QString, QString> &values) 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 // battery update requires info is AC online or not
setData(values[QString("ac")] == configuration[QString("acOnline")], setData(values[QString("ac")] == configuration[QString("acOnline")],
QString("batTooltip"), values[QString("bat")].toFloat()); 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, void AWDataAggregator::setData(const QString &source, float value,
const float extremum) const float extremum)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Source" << source; qCDebug(LOG_AW) << "Source" << source;
qCDebug(LOG_AW) << "Value" << value; qCDebug(LOG_AW) << "Value" << value;
qCDebug(LOG_AW) << "Called with extremum" << extremum; 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, void AWDataAggregator::setData(const bool dontInvert, const QString &source,
float value) float value)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Do not invert value" << dontInvert; qCDebug(LOG_AW) << "Do not invert value" << dontInvert;
qCDebug(LOG_AW) << "Source" << source;
qCDebug(LOG_AW) << "Value" << value;
// invert values for different battery colours // invert values for different battery colours
value = dontInvert ? value : -value; value = dontInvert ? value : -value;

View File

@ -27,7 +27,7 @@ AWDataEngineAggregator::AWDataEngineAggregator(QObject *parent,
const int interval) const int interval)
: QObject(parent) : QObject(parent)
{ {
qCDebug(LOG_AW); qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
setInterval(interval); setInterval(interval);
initDataEngines(); initDataEngines();
@ -36,7 +36,7 @@ AWDataEngineAggregator::AWDataEngineAggregator(QObject *parent,
AWDataEngineAggregator::~AWDataEngineAggregator() AWDataEngineAggregator::~AWDataEngineAggregator()
{ {
qCDebug(LOG_AW); qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
// disconnect sources first // disconnect sources first
disconnectSources(); disconnectSources();
@ -46,8 +46,6 @@ AWDataEngineAggregator::~AWDataEngineAggregator()
void AWDataEngineAggregator::disconnectSources() void AWDataEngineAggregator::disconnectSources()
{ {
qCDebug(LOG_AW);
foreach (QString dataengine, m_dataEngines.keys()) foreach (QString dataengine, m_dataEngines.keys())
foreach (QString source, m_dataEngines[dataengine]->sources()) foreach (QString source, m_dataEngines[dataengine]->sources())
m_dataEngines[dataengine]->disconnectSource(source, parent()); m_dataEngines[dataengine]->disconnectSource(source, parent());
@ -56,7 +54,6 @@ void AWDataEngineAggregator::disconnectSources()
void AWDataEngineAggregator::setInterval(const int _interval) void AWDataEngineAggregator::setInterval(const int _interval)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Interval" << _interval; qCDebug(LOG_AW) << "Interval" << _interval;
m_interval = _interval; m_interval = _interval;
@ -65,7 +62,6 @@ void AWDataEngineAggregator::setInterval(const int _interval)
void AWDataEngineAggregator::dropSource(const QString source) void AWDataEngineAggregator::dropSource(const QString source)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Source" << source; qCDebug(LOG_AW) << "Source" << source;
// FIXME there is no possibility to check to which dataengine 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() void AWDataEngineAggregator::reconnectSources()
{ {
qCDebug(LOG_AW);
m_dataEngines[QString("systemmonitor")]->connectAllSources(parent(), m_dataEngines[QString("systemmonitor")]->connectAllSources(parent(),
m_interval); m_interval);
m_dataEngines[QString("extsysmon")]->connectAllSources(parent(), m_dataEngines[QString("extsysmon")]->connectAllSources(parent(),
@ -90,8 +84,6 @@ void AWDataEngineAggregator::reconnectSources()
void AWDataEngineAggregator::initDataEngines() void AWDataEngineAggregator::initDataEngines()
{ {
qCDebug(LOG_AW);
Plasma::DataEngineConsumer *deConsumer = new Plasma::DataEngineConsumer(); Plasma::DataEngineConsumer *deConsumer = new Plasma::DataEngineConsumer();
m_dataEngines[QString("systemmonitor")] m_dataEngines[QString("systemmonitor")]
= deConsumer->dataEngine(QString("systemmonitor")); = deConsumer->dataEngine(QString("systemmonitor"));

View File

@ -20,6 +20,7 @@
#define AWDATAENGINEAGGREGATOR_H #define AWDATAENGINEAGGREGATOR_H
#include <Plasma/DataEngine> #include <Plasma/DataEngine>
#include <QObject> #include <QObject>

View File

@ -42,10 +42,10 @@
AWKeys::AWKeys(QObject *parent) AWKeys::AWKeys(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
qCDebug(LOG_AW);
// logging
qSetMessagePattern(LOG_FORMAT); qSetMessagePattern(LOG_FORMAT);
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
foreach (const QString metadata, getBuildData())
qCDebug(LOG_AW) << metadata;
#ifdef BUILD_FUTURE #ifdef BUILD_FUTURE
// thread pool // thread pool
@ -63,7 +63,7 @@ AWKeys::AWKeys(QObject *parent)
AWKeys::~AWKeys() AWKeys::~AWKeys()
{ {
qCDebug(LOG_AW); qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
// extensions // extensions
if (graphicalItems != nullptr) if (graphicalItems != nullptr)
@ -89,7 +89,6 @@ AWKeys::~AWKeys()
void AWKeys::initDataAggregator(const QVariantMap tooltipParams) void AWKeys::initDataAggregator(const QVariantMap tooltipParams)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Tooltip parameters" << tooltipParams; qCDebug(LOG_AW) << "Tooltip parameters" << tooltipParams;
dataAggregator->setParameters(tooltipParams); dataAggregator->setParameters(tooltipParams);
@ -99,7 +98,6 @@ void AWKeys::initDataAggregator(const QVariantMap tooltipParams)
void AWKeys::initKeys(const QString currentPattern, const int interval, void AWKeys::initKeys(const QString currentPattern, const int interval,
const int limit) const int limit)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Pattern" << currentPattern; qCDebug(LOG_AW) << "Pattern" << currentPattern;
qCDebug(LOG_AW) << "Interval" << interval; qCDebug(LOG_AW) << "Interval" << interval;
qCDebug(LOG_AW) << "Queue limit" << limit; 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) 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); 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) void AWKeys::setWrapNewLines(const bool wrap)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Is wrapping enabled" << wrap; qCDebug(LOG_AW) << "Is wrapping enabled" << wrap;
m_wrapNewLines = wrap; m_wrapNewLines = wrap;
@ -141,8 +139,6 @@ void AWKeys::setWrapNewLines(const bool wrap)
void AWKeys::updateCache() void AWKeys::updateCache()
{ {
qCDebug(LOG_AW);
// update network and hdd list // update network and hdd list
addKeyToCache(QString("hdd")); addKeyToCache(QString("hdd"));
addKeyToCache(QString("net")); addKeyToCache(QString("net"));
@ -151,7 +147,6 @@ void AWKeys::updateCache()
QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Should be sorted" << sorted; qCDebug(LOG_AW) << "Should be sorted" << sorted;
qCDebug(LOG_AW) << "Filter" << regexp; qCDebug(LOG_AW) << "Filter" << regexp;
@ -320,8 +315,6 @@ QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const
QStringList AWKeys::getHddDevices() const QStringList AWKeys::getHddDevices() const
{ {
qCDebug(LOG_AW);
QStringList devices = m_devices[QString("hdd")]; QStringList devices = m_devices[QString("hdd")];
// required by selector in the UI // required by selector in the UI
devices.insert(0, QString("disable")); devices.insert(0, QString("disable"));
@ -333,7 +326,6 @@ QStringList AWKeys::getHddDevices() const
QString AWKeys::infoByKey(QString key) const QString AWKeys::infoByKey(QString key) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Requested key" << key; qCDebug(LOG_AW) << "Requested key" << key;
key.remove(QRegExp(QString("^bar[0-9]{1,}"))); 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 // HACK this method requires to define tag value from bar from UI interface
QString AWKeys::valueByKey(QString key) const QString AWKeys::valueByKey(QString key) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Requested key" << key; qCDebug(LOG_AW) << "Requested key" << key;
return values.value(key.remove(QRegExp(QString("^bar[0-9]{1,}"))), 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) void AWKeys::editItem(const QString type)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Item type" << type; qCDebug(LOG_AW) << "Item type" << type;
if (type == QString("graphicalitem")) { if (type == QString("graphicalitem")) {
@ -418,7 +408,6 @@ void AWKeys::editItem(const QString type)
void AWKeys::addDevice(const QString source) void AWKeys::addDevice(const QString source)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Source" << source; qCDebug(LOG_AW) << "Source" << source;
QRegExp diskRegexp QRegExp diskRegexp
@ -442,12 +431,11 @@ void AWKeys::addDevice(const QString source)
void AWKeys::dataUpdated(const QString &sourceName, void AWKeys::dataUpdated(const QString &sourceName,
const Plasma::DataEngine::Data &data) const Plasma::DataEngine::Data &data)
{ {
qCDebug(LOG_AW); // do not log these parameters
qCDebug(LOG_AW) << "Source" << sourceName; if (sourceName == QString("update")) {
qCDebug(LOG_AW) << "Data" << data; qCInfo(LOG_AW) << "Update data";
if (sourceName == QString("update"))
return emit(needToBeUpdated()); return emit(needToBeUpdated());
}
#ifdef BUILD_FUTURE #ifdef BUILD_FUTURE
// run concurrent data update // run concurrent data update
@ -461,8 +449,6 @@ void AWKeys::dataUpdated(const QString &sourceName,
void AWKeys::loadKeysFromCache() void AWKeys::loadKeysFromCache()
{ {
qCDebug(LOG_AW);
QString fileName = QString("%1/awesomewidgets.ndx") QString fileName = QString("%1/awesomewidgets.ndx")
.arg(QStandardPaths::writableLocation( .arg(QStandardPaths::writableLocation(
QStandardPaths::GenericCacheLocation)); QStandardPaths::GenericCacheLocation));
@ -483,8 +469,6 @@ void AWKeys::loadKeysFromCache()
void AWKeys::reinitKeys() void AWKeys::reinitKeys()
{ {
qCDebug(LOG_AW);
// renew extensions // renew extensions
// delete them if any // delete them if any
if (graphicalItems != nullptr) if (graphicalItems != nullptr)
@ -579,8 +563,6 @@ void AWKeys::reinitKeys()
void AWKeys::updateTextData() void AWKeys::updateTextData()
{ {
qCDebug(LOG_AW);
calculateValues(); calculateValues();
emit(needTextToBeUpdated(parsePattern(m_pattern))); emit(needTextToBeUpdated(parsePattern(m_pattern)));
emit(dataAggregator->updateData(values)); emit(dataAggregator->updateData(values));
@ -589,7 +571,6 @@ void AWKeys::updateTextData()
void AWKeys::addKeyToCache(const QString type, const QString key) void AWKeys::addKeyToCache(const QString type, const QString key)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Key type" << type; qCDebug(LOG_AW) << "Key type" << type;
qCDebug(LOG_AW) << "Key" << key; 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 // specified pattern. Usually they are values which depend on several others
void AWKeys::calculateValues() void AWKeys::calculateValues()
{ {
qCDebug(LOG_AW);
// hddtot* // hddtot*
foreach (QString device, m_devices[QString("mount")]) { foreach (QString device, m_devices[QString("mount")]) {
int index = m_devices[QString("mount")].indexOf(device); int index = m_devices[QString("mount")].indexOf(device);
@ -726,8 +705,6 @@ void AWKeys::calculateValues()
QString AWKeys::parsePattern(QString pattern) const QString AWKeys::parsePattern(QString pattern) const
{ {
qCDebug(LOG_AW);
// screen sign // screen sign
pattern.replace(QString("$$"), QString("$\\$\\")); pattern.replace(QString("$$"), QString("$\\$\\"));
@ -770,7 +747,6 @@ QString AWKeys::parsePattern(QString pattern) const
void AWKeys::setDataBySource(const QString &sourceName, const QVariantMap &data) void AWKeys::setDataBySource(const QString &sourceName, const QVariantMap &data)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Source" << sourceName; qCDebug(LOG_AW) << "Source" << sourceName;
qCDebug(LOG_AW) << "Data" << data; qCDebug(LOG_AW) << "Data" << data;

View File

@ -20,6 +20,7 @@
#define AWKEYS_H #define AWKEYS_H
#include <Plasma/DataEngine> #include <Plasma/DataEngine>
#include <QMutex> #include <QMutex>
#include <QObject> #include <QObject>

View File

@ -29,20 +29,19 @@
AWKeysAggregator::AWKeysAggregator(QObject *parent) AWKeysAggregator::AWKeysAggregator(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
qCDebug(LOG_AW); qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
} }
AWKeysAggregator::~AWKeysAggregator() AWKeysAggregator::~AWKeysAggregator()
{ {
qCDebug(LOG_AW); qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
} }
QString AWKeysAggregator::formater(const QVariant &data, QString AWKeysAggregator::formater(const QVariant &data,
const QString &key) const const QString &key) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Data" << data; qCDebug(LOG_AW) << "Data" << data;
qCDebug(LOG_AW) << "Key" << key; qCDebug(LOG_AW) << "Key" << key;
@ -150,7 +149,6 @@ QString AWKeysAggregator::formater(const QVariant &data,
QStringList AWKeysAggregator::keysFromSource(const QString &source) const QStringList AWKeysAggregator::keysFromSource(const QString &source) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Search for source" << source; qCDebug(LOG_AW) << "Search for source" << source;
return m_map.values(source); return m_map.values(source);
@ -159,7 +157,6 @@ QStringList AWKeysAggregator::keysFromSource(const QString &source) const
void AWKeysAggregator::setAcOffline(const QString inactive) void AWKeysAggregator::setAcOffline(const QString inactive)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Inactive AC string" << inactive; qCDebug(LOG_AW) << "Inactive AC string" << inactive;
m_acOffline = inactive; m_acOffline = inactive;
@ -168,7 +165,6 @@ void AWKeysAggregator::setAcOffline(const QString inactive)
void AWKeysAggregator::setAcOnline(const QString active) void AWKeysAggregator::setAcOnline(const QString active)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Active AC string" << active; qCDebug(LOG_AW) << "Active AC string" << active;
m_acOnline = active; m_acOnline = active;
@ -177,7 +173,6 @@ void AWKeysAggregator::setAcOnline(const QString active)
void AWKeysAggregator::setCustomTime(const QString customTime) void AWKeysAggregator::setCustomTime(const QString customTime)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Format" << customTime; qCDebug(LOG_AW) << "Format" << customTime;
m_customTime = customTime; m_customTime = customTime;
@ -186,7 +181,6 @@ void AWKeysAggregator::setCustomTime(const QString customTime)
void AWKeysAggregator::setCustomUptime(const QString customUptime) void AWKeysAggregator::setCustomUptime(const QString customUptime)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Format" << customUptime; qCDebug(LOG_AW) << "Format" << customUptime;
m_customUptime = customUptime; m_customUptime = customUptime;
@ -195,7 +189,6 @@ void AWKeysAggregator::setCustomUptime(const QString customUptime)
void AWKeysAggregator::setDevices(const QHash<QString, QStringList> devices) void AWKeysAggregator::setDevices(const QHash<QString, QStringList> devices)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Devices" << devices; qCDebug(LOG_AW) << "Devices" << devices;
m_devices = devices; m_devices = devices;
@ -204,7 +197,6 @@ void AWKeysAggregator::setDevices(const QHash<QString, QStringList> devices)
void AWKeysAggregator::setTempUnits(const QString units) void AWKeysAggregator::setTempUnits(const QString units)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Units" << units; qCDebug(LOG_AW) << "Units" << units;
m_tempUnits = units; m_tempUnits = units;
@ -213,7 +205,6 @@ void AWKeysAggregator::setTempUnits(const QString units)
void AWKeysAggregator::setTranslate(const bool translate) void AWKeysAggregator::setTranslate(const bool translate)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Translate" << translate; qCDebug(LOG_AW) << "Translate" << translate;
m_translate = translate; m_translate = translate;
@ -225,7 +216,6 @@ void AWKeysAggregator::setTranslate(const bool translate)
QStringList AWKeysAggregator::registerSource(const QString &source, QStringList AWKeysAggregator::registerSource(const QString &source,
const QString &units) const QString &units)
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Source" << source; qCDebug(LOG_AW) << "Source" << source;
qCDebug(LOG_AW) << "Units" << units; qCDebug(LOG_AW) << "Units" << units;
@ -528,7 +518,6 @@ QStringList AWKeysAggregator::registerSource(const QString &source,
float AWKeysAggregator::temperature(const float temp) const float AWKeysAggregator::temperature(const float temp) const
{ {
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Temperature value" << temp; qCDebug(LOG_AW) << "Temperature value" << temp;
float converted = temp; float converted = temp;

View File

@ -32,7 +32,7 @@ AbstractExtItem::AbstractExtItem(QWidget *parent, const QString desktopName,
, m_fileName(desktopName) , m_fileName(desktopName)
, m_dirs(directories) , m_dirs(directories)
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
qCDebug(LOG_LIB) << "Desktop name" << desktopName; qCDebug(LOG_LIB) << "Desktop name" << desktopName;
qCDebug(LOG_LIB) << "Directories" << directories; qCDebug(LOG_LIB) << "Directories" << directories;
@ -42,14 +42,12 @@ AbstractExtItem::AbstractExtItem(QWidget *parent, const QString desktopName,
AbstractExtItem::~AbstractExtItem() AbstractExtItem::~AbstractExtItem()
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
} }
template <class T> T *AbstractExtItem::copy(const QString, const int) template <class T> T *AbstractExtItem::copy(const QString, const int)
{ {
qCDebug(LOG_LIB);
// an analog of pure virtual method // an analog of pure virtual method
return new T(); return new T();
} }
@ -57,71 +55,54 @@ template <class T> T *AbstractExtItem::copy(const QString, const int)
int AbstractExtItem::apiVersion() const int AbstractExtItem::apiVersion() const
{ {
qCDebug(LOG_LIB);
return m_apiVersion; return m_apiVersion;
} }
QString AbstractExtItem::comment() const QString AbstractExtItem::comment() const
{ {
qCDebug(LOG_LIB);
return m_comment; return m_comment;
} }
QStringList AbstractExtItem::directories() const QStringList AbstractExtItem::directories() const
{ {
qCDebug(LOG_LIB);
return m_dirs; return m_dirs;
} }
QString AbstractExtItem::fileName() const QString AbstractExtItem::fileName() const
{ {
qCDebug(LOG_LIB);
return m_fileName; return m_fileName;
} }
int AbstractExtItem::interval() const int AbstractExtItem::interval() const
{ {
qCDebug(LOG_LIB);
return m_interval; return m_interval;
} }
bool AbstractExtItem::isActive() const bool AbstractExtItem::isActive() const
{ {
qCDebug(LOG_LIB);
return m_active; return m_active;
} }
QString AbstractExtItem::name() const QString AbstractExtItem::name() const
{ {
qCDebug(LOG_LIB);
return m_name; return m_name;
} }
int AbstractExtItem::number() const int AbstractExtItem::number() const
{ {
qCDebug(LOG_LIB);
return m_number; return m_number;
} }
QString AbstractExtItem::tag(const QString _type) const QString AbstractExtItem::tag(const QString _type) const
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Tag type" << _type; qCDebug(LOG_LIB) << "Tag type" << _type;
return QString("%1%2").arg(_type).arg(m_number); return QString("%1%2").arg(_type).arg(m_number);
@ -130,7 +111,6 @@ QString AbstractExtItem::tag(const QString _type) const
void AbstractExtItem::setApiVersion(const int _apiVersion) void AbstractExtItem::setApiVersion(const int _apiVersion)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Version" << _apiVersion; qCDebug(LOG_LIB) << "Version" << _apiVersion;
m_apiVersion = _apiVersion; m_apiVersion = _apiVersion;
@ -139,7 +119,6 @@ void AbstractExtItem::setApiVersion(const int _apiVersion)
void AbstractExtItem::setActive(const bool _state) void AbstractExtItem::setActive(const bool _state)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "State" << _state; qCDebug(LOG_LIB) << "State" << _state;
m_active = _state; m_active = _state;
@ -148,7 +127,6 @@ void AbstractExtItem::setActive(const bool _state)
void AbstractExtItem::setComment(const QString _comment) void AbstractExtItem::setComment(const QString _comment)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Comment" << _comment; qCDebug(LOG_LIB) << "Comment" << _comment;
m_comment = _comment; m_comment = _comment;
@ -157,7 +135,6 @@ void AbstractExtItem::setComment(const QString _comment)
void AbstractExtItem::setInterval(const int _interval) void AbstractExtItem::setInterval(const int _interval)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Interval" << _interval; qCDebug(LOG_LIB) << "Interval" << _interval;
if (_interval <= 0) if (_interval <= 0)
return; return;
@ -168,7 +145,6 @@ void AbstractExtItem::setInterval(const int _interval)
void AbstractExtItem::setName(const QString _name) void AbstractExtItem::setName(const QString _name)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Name" << _name; qCDebug(LOG_LIB) << "Name" << _name;
m_name = _name; m_name = _name;
@ -177,7 +153,6 @@ void AbstractExtItem::setName(const QString _name)
void AbstractExtItem::setNumber(int _number) void AbstractExtItem::setNumber(int _number)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Number" << _number; qCDebug(LOG_LIB) << "Number" << _number;
if (_number == -1) if (_number == -1)
_number = []() { _number = []() {
@ -194,8 +169,6 @@ void AbstractExtItem::setNumber(int _number)
void AbstractExtItem::readConfiguration() void AbstractExtItem::readConfiguration()
{ {
qCDebug(LOG_LIB);
for (int i = m_dirs.count() - 1; i >= 0; i--) { for (int i = m_dirs.count() - 1; i >= 0; i--) {
if (!QDir(m_dirs.at(i)).entryList(QDir::Files).contains(m_fileName)) if (!QDir(m_dirs.at(i)).entryList(QDir::Files).contains(m_fileName))
continue; continue;
@ -220,8 +193,6 @@ void AbstractExtItem::readConfiguration()
bool AbstractExtItem::tryDelete() const bool AbstractExtItem::tryDelete() const
{ {
qCDebug(LOG_LIB);
foreach (QString dir, m_dirs) { foreach (QString dir, m_dirs) {
bool status = QFile::remove(QString("%1/%2").arg(dir).arg(m_fileName)); bool status = QFile::remove(QString("%1/%2").arg(dir).arg(m_fileName));
qCInfo(LOG_LIB) << "Remove file" qCInfo(LOG_LIB) << "Remove file"
@ -238,8 +209,6 @@ bool AbstractExtItem::tryDelete() const
void AbstractExtItem::writeConfiguration() const void AbstractExtItem::writeConfiguration() const
{ {
qCDebug(LOG_LIB);
QSettings settings(QString("%1/%2").arg(m_dirs.first()).arg(m_fileName), QSettings settings(QString("%1/%2").arg(m_dirs.first()).arg(m_fileName),
QSettings::IniFormat); QSettings::IniFormat);
qCInfo(LOG_LIB) << "Configuration file" << settings.fileName(); qCInfo(LOG_LIB) << "Configuration file" << settings.fileName();

View File

@ -29,7 +29,7 @@
AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *parent) AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *parent)
: QWidget(parent) : QWidget(parent)
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
dialog = new QDialog(this); dialog = new QDialog(this);
widgetDialog = new QListWidget(dialog); widgetDialog = new QListWidget(dialog);
@ -56,7 +56,7 @@ AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *parent)
AbstractExtItemAggregator::~AbstractExtItemAggregator() AbstractExtItemAggregator::~AbstractExtItemAggregator()
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
delete dialog; delete dialog;
} }
@ -64,8 +64,6 @@ AbstractExtItemAggregator::~AbstractExtItemAggregator()
QString AbstractExtItemAggregator::getName() QString AbstractExtItemAggregator::getName()
{ {
qCDebug(LOG_LIB);
bool ok; bool ok;
QString name = QInputDialog::getText(this, i18n("Enter file name"), QString name = QInputDialog::getText(this, i18n("Enter file name"),
i18n("File name"), QLineEdit::Normal, i18n("File name"), QLineEdit::Normal,
@ -81,15 +79,12 @@ QString AbstractExtItemAggregator::getName()
QVariant AbstractExtItemAggregator::configArgs() const QVariant AbstractExtItemAggregator::configArgs() const
{ {
qCDebug(LOG_LIB);
return m_configArgs; return m_configArgs;
} }
void AbstractExtItemAggregator::setConfigArgs(const QVariant _configArgs) void AbstractExtItemAggregator::setConfigArgs(const QVariant _configArgs)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Configuration arguments" << _configArgs; qCDebug(LOG_LIB) << "Configuration arguments" << _configArgs;
m_configArgs = _configArgs; m_configArgs = _configArgs;
@ -99,7 +94,6 @@ void AbstractExtItemAggregator::setConfigArgs(const QVariant _configArgs)
void AbstractExtItemAggregator::editItemActivated(QListWidgetItem *item) void AbstractExtItemAggregator::editItemActivated(QListWidgetItem *item)
{ {
Q_UNUSED(item) Q_UNUSED(item)
qCDebug(LOG_LIB);
return editItem(); return editItem();
} }
@ -107,8 +101,6 @@ void AbstractExtItemAggregator::editItemActivated(QListWidgetItem *item)
void AbstractExtItemAggregator::editItemButtonPressed(QAbstractButton *button) void AbstractExtItemAggregator::editItemButtonPressed(QAbstractButton *button)
{ {
qCDebug(LOG_LIB);
if (static_cast<QPushButton *>(button) == copyButton) if (static_cast<QPushButton *>(button) == copyButton)
return copyItem(); return copyItem();
else if (static_cast<QPushButton *>(button) == createButton) else if (static_cast<QPushButton *>(button) == createButton)

View File

@ -25,7 +25,7 @@
#include <QWidget> #include <QWidget>
// additinal class since QObject macro does not allow class templates // additional class since QObject macro does not allow class templates
class AbstractExtItemAggregator : public QWidget class AbstractExtItemAggregator : public QWidget
{ {
Q_OBJECT Q_OBJECT

View File

@ -24,9 +24,8 @@
#include <QSettings> #include <QSettings>
#include <QStandardPaths> #include <QStandardPaths>
#include "awdebug.h"
#include "abstractextitemaggregator.h" #include "abstractextitemaggregator.h"
#include "awdebug.h"
template <class T> class ExtItemAggregator : public AbstractExtItemAggregator template <class T> class ExtItemAggregator : public AbstractExtItemAggregator
@ -36,33 +35,27 @@ public:
: AbstractExtItemAggregator(parent) : AbstractExtItemAggregator(parent)
, m_type(type) , m_type(type)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Type" << type;
qSetMessagePattern(LOG_FORMAT); qSetMessagePattern(LOG_FORMAT);
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
foreach (const QString metadata, getBuildData())
qCDebug(LOG_LIB) << metadata;
qCDebug(LOG_LIB) << "Type" << type;
initItems(); initItems();
}; };
virtual ~ExtItemAggregator() virtual ~ExtItemAggregator()
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
m_items.clear(); m_items.clear();
m_activeItems.clear(); m_activeItems.clear();
}; };
QList<T *> activeItems() QList<T *> activeItems() { return m_activeItems; };
{
qCDebug(LOG_LIB);
return m_activeItems;
};
void editItems() void editItems()
{ {
qCDebug(LOG_LIB);
repaint(); repaint();
int ret = dialog->exec(); int ret = dialog->exec();
qCInfo(LOG_LIB) << "Dialog returns" << ret; qCInfo(LOG_LIB) << "Dialog returns" << ret;
@ -70,7 +63,6 @@ public:
T *itemByTag(const QString _tag) const T *itemByTag(const QString _tag) const
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Tag" << _tag; qCDebug(LOG_LIB) << "Tag" << _tag;
T *found = nullptr; T *found = nullptr;
@ -88,7 +80,6 @@ public:
T *itemByTagNumber(const int _number) const T *itemByTagNumber(const int _number) const
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Number" << _number; qCDebug(LOG_LIB) << "Number" << _number;
T *found = nullptr; T *found = nullptr;
@ -106,8 +97,6 @@ public:
T *itemFromWidget() const T *itemFromWidget() const
{ {
qCDebug(LOG_LIB);
QListWidgetItem *widgetItem = widgetDialog->currentItem(); QListWidgetItem *widgetItem = widgetDialog->currentItem();
if (widgetItem == nullptr) if (widgetItem == nullptr)
return nullptr; return nullptr;
@ -126,17 +115,10 @@ public:
return found; return found;
}; };
QList<T *> items() const QList<T *> items() const { return m_items; };
{
qCDebug(LOG_LIB);
return m_items;
};
int uniqNumber() const int uniqNumber() const
{ {
qCDebug(LOG_LIB);
QList<int> tagList; QList<int> tagList;
foreach (T *item, m_items) foreach (T *item, m_items)
tagList.append(item->number()); tagList.append(item->number());
@ -155,8 +137,6 @@ private:
// init method // init method
QList<T *> getItems() QList<T *> getItems()
{ {
qCDebug(LOG_LIB);
// create directory at $HOME // create directory at $HOME
QString localDir = QString("%1/awesomewidgets/%2") QString localDir = QString("%1/awesomewidgets/%2")
.arg(QStandardPaths::writableLocation( .arg(QStandardPaths::writableLocation(
@ -193,8 +173,6 @@ private:
void initItems() void initItems()
{ {
qCDebug(LOG_LIB);
m_items.clear(); m_items.clear();
m_activeItems.clear(); m_activeItems.clear();
@ -208,8 +186,6 @@ private:
void repaint() void repaint()
{ {
qCDebug(LOG_LIB);
widgetDialog->clear(); widgetDialog->clear();
foreach (T *_item, m_items) { foreach (T *_item, m_items) {
QListWidgetItem *item QListWidgetItem *item
@ -226,8 +202,6 @@ private:
// methods // methods
void copyItem() void copyItem()
{ {
qCDebug(LOG_LIB);
T *source = itemFromWidget(); T *source = itemFromWidget();
QString fileName = getName(); QString fileName = getName();
int number = uniqNumber(); int number = uniqNumber();
@ -245,8 +219,6 @@ private:
void createItem() void createItem()
{ {
qCDebug(LOG_LIB);
QString fileName = getName(); QString fileName = getName();
int number = uniqNumber(); int number = uniqNumber();
QStringList dirs = QStandardPaths::locateAll( QStringList dirs = QStandardPaths::locateAll(
@ -268,8 +240,6 @@ private:
void deleteItem() void deleteItem()
{ {
qCDebug(LOG_LIB);
T *source = itemFromWidget(); T *source = itemFromWidget();
if (source == nullptr) { if (source == nullptr) {
qCWarning(LOG_LIB) << "Nothing to delete"; qCWarning(LOG_LIB) << "Nothing to delete";
@ -284,8 +254,6 @@ private:
void editItem() void editItem()
{ {
qCDebug(LOG_LIB);
T *source = itemFromWidget(); T *source = itemFromWidget();
if (source == nullptr) { if (source == nullptr) {
qCWarning(LOG_LIB) << "Nothing to edit"; qCWarning(LOG_LIB) << "Nothing to edit";

View File

@ -38,7 +38,7 @@ ExtQuotes::ExtQuotes(QWidget *parent, const QString quotesName,
: AbstractExtItem(parent, quotesName, directories) : AbstractExtItem(parent, quotesName, directories)
, ui(new Ui::ExtQuotes) , ui(new Ui::ExtQuotes)
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
readConfiguration(); readConfiguration();
ui->setupUi(this); ui->setupUi(this);
@ -64,7 +64,7 @@ ExtQuotes::ExtQuotes(QWidget *parent, const QString quotesName,
ExtQuotes::~ExtQuotes() ExtQuotes::~ExtQuotes()
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
disconnect(manager, SIGNAL(finished(QNetworkReply *)), this, disconnect(manager, SIGNAL(finished(QNetworkReply *)), this,
SLOT(quotesReplyReceived(QNetworkReply *))); SLOT(quotesReplyReceived(QNetworkReply *)));
@ -76,7 +76,6 @@ ExtQuotes::~ExtQuotes()
ExtQuotes *ExtQuotes::copy(const QString _fileName, const int _number) ExtQuotes *ExtQuotes::copy(const QString _fileName, const int _number)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "File" << _fileName; qCDebug(LOG_LIB) << "File" << _fileName;
qCDebug(LOG_LIB) << "Number" << _number; qCDebug(LOG_LIB) << "Number" << _number;
@ -96,23 +95,18 @@ ExtQuotes *ExtQuotes::copy(const QString _fileName, const int _number)
QString ExtQuotes::ticker() const QString ExtQuotes::ticker() const
{ {
qCDebug(LOG_LIB);
return m_ticker; return m_ticker;
} }
QString ExtQuotes::uniq() const QString ExtQuotes::uniq() const
{ {
qCDebug(LOG_LIB);
return m_ticker; return m_ticker;
} }
void ExtQuotes::setTicker(const QString _ticker) void ExtQuotes::setTicker(const QString _ticker)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Ticker" << _ticker; qCDebug(LOG_LIB) << "Ticker" << _ticker;
m_ticker = _ticker; m_ticker = _ticker;
@ -121,7 +115,6 @@ void ExtQuotes::setTicker(const QString _ticker)
void ExtQuotes::readConfiguration() void ExtQuotes::readConfiguration()
{ {
qCDebug(LOG_LIB);
AbstractExtItem::readConfiguration(); AbstractExtItem::readConfiguration();
for (int i = directories().count() - 1; i >= 0; i--) { for (int i = directories().count() - 1; i >= 0; i--) {
@ -150,7 +143,6 @@ void ExtQuotes::readConfiguration()
QVariantHash ExtQuotes::run() QVariantHash ExtQuotes::run()
{ {
qCDebug(LOG_LIB);
if ((!isActive()) || (isRunning)) if ((!isActive()) || (isRunning))
return values; return values;
@ -173,7 +165,6 @@ QVariantHash ExtQuotes::run()
int ExtQuotes::showConfiguration(const QVariant args) int ExtQuotes::showConfiguration(const QVariant args)
{ {
Q_UNUSED(args) Q_UNUSED(args)
qCDebug(LOG_LIB);
ui->lineEdit_name->setText(name()); ui->lineEdit_name->setText(name());
ui->lineEdit_comment->setText(comment()); ui->lineEdit_comment->setText(comment());
@ -201,7 +192,6 @@ int ExtQuotes::showConfiguration(const QVariant args)
void ExtQuotes::writeConfiguration() const void ExtQuotes::writeConfiguration() const
{ {
qCDebug(LOG_LIB);
AbstractExtItem::writeConfiguration(); AbstractExtItem::writeConfiguration();
QSettings settings( QSettings settings(
@ -218,7 +208,6 @@ void ExtQuotes::writeConfiguration() const
void ExtQuotes::quotesReplyReceived(QNetworkReply *reply) void ExtQuotes::quotesReplyReceived(QNetworkReply *reply)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Return code" << reply->error(); qCDebug(LOG_LIB) << "Return code" << reply->error();
qCDebug(LOG_LIB) << "Reply error message" << reply->errorString(); qCDebug(LOG_LIB) << "Reply error message" << reply->errorString();
@ -274,8 +263,6 @@ void ExtQuotes::quotesReplyReceived(QNetworkReply *reply)
void ExtQuotes::translate() void ExtQuotes::translate()
{ {
qCDebug(LOG_LIB);
ui->label_name->setText(i18n("Name")); ui->label_name->setText(i18n("Name"));
ui->label_comment->setText(i18n("Comment")); ui->label_comment->setText(i18n("Comment"));
ui->label_number->setText(i18n("Tag")); ui->label_number->setText(i18n("Tag"));
@ -292,8 +279,6 @@ get quotes for the instrument. Refer to <a href=\"http://finance.yahoo.com/\">\
QString ExtQuotes::url() const QString ExtQuotes::url() const
{ {
qCDebug(LOG_LIB);
QString apiUrl = QString(YAHOO_URL); QString apiUrl = QString(YAHOO_URL);
apiUrl.replace(QString("$TICKER"), m_ticker); apiUrl.replace(QString("$TICKER"), m_ticker);
qCInfo(LOG_LIB) << "API url" << apiUrl; qCInfo(LOG_LIB) << "API url" << apiUrl;

View File

@ -36,7 +36,7 @@ ExtScript::ExtScript(QWidget *parent, const QString scriptName,
: AbstractExtItem(parent, scriptName, directories) : AbstractExtItem(parent, scriptName, directories)
, ui(new Ui::ExtScript) , ui(new Ui::ExtScript)
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
readConfiguration(); readConfiguration();
readJsonFilters(); readJsonFilters();
@ -45,7 +45,7 @@ ExtScript::ExtScript(QWidget *parent, const QString scriptName,
value[tag(QString("custom"))] = QString(""); value[tag(QString("custom"))] = QString("");
process = new QProcess(this); process = new QProcess(nullptr);
connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), this, connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), this,
SLOT(updateValue())); SLOT(updateValue()));
process->waitForFinished(0); process->waitForFinished(0);
@ -54,17 +54,16 @@ ExtScript::ExtScript(QWidget *parent, const QString scriptName,
ExtScript::~ExtScript() ExtScript::~ExtScript()
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
process->kill(); process->kill();
delete process; process->deleteLater();
delete ui; delete ui;
} }
ExtScript *ExtScript::copy(const QString _fileName, const int _number) ExtScript *ExtScript::copy(const QString _fileName, const int _number)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "File" << _fileName; qCDebug(LOG_LIB) << "File" << _fileName;
qCDebug(LOG_LIB) << "Number" << _number; qCDebug(LOG_LIB) << "Number" << _number;
@ -86,48 +85,36 @@ ExtScript *ExtScript::copy(const QString _fileName, const int _number)
QString ExtScript::executable() const QString ExtScript::executable() const
{ {
qCDebug(LOG_LIB);
return m_executable; return m_executable;
} }
QStringList ExtScript::filters() const QStringList ExtScript::filters() const
{ {
qCDebug(LOG_LIB);
return m_filters; return m_filters;
} }
QString ExtScript::prefix() const QString ExtScript::prefix() const
{ {
qCDebug(LOG_LIB);
return m_prefix; return m_prefix;
} }
ExtScript::Redirect ExtScript::redirect() const ExtScript::Redirect ExtScript::redirect() const
{ {
qCDebug(LOG_LIB);
return m_redirect; return m_redirect;
} }
QString ExtScript::uniq() const QString ExtScript::uniq() const
{ {
qCDebug(LOG_LIB);
return m_executable; return m_executable;
} }
QString ExtScript::strRedirect() const QString ExtScript::strRedirect() const
{ {
qCDebug(LOG_LIB);
QString value; QString value;
switch (m_redirect) { switch (m_redirect) {
case stdout2stderr: case stdout2stderr:
@ -151,7 +138,6 @@ QString ExtScript::strRedirect() const
void ExtScript::setExecutable(const QString _executable) void ExtScript::setExecutable(const QString _executable)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Executable" << _executable; qCDebug(LOG_LIB) << "Executable" << _executable;
m_executable = _executable; m_executable = _executable;
@ -160,7 +146,6 @@ void ExtScript::setExecutable(const QString _executable)
void ExtScript::setFilters(const QStringList _filters) void ExtScript::setFilters(const QStringList _filters)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Filters" << _filters; qCDebug(LOG_LIB) << "Filters" << _filters;
std::for_each(_filters.cbegin(), _filters.cend(), std::for_each(_filters.cbegin(), _filters.cend(),
@ -170,7 +155,6 @@ void ExtScript::setFilters(const QStringList _filters)
void ExtScript::setPrefix(const QString _prefix) void ExtScript::setPrefix(const QString _prefix)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Prefix" << _prefix; qCDebug(LOG_LIB) << "Prefix" << _prefix;
m_prefix = _prefix; m_prefix = _prefix;
@ -179,7 +163,6 @@ void ExtScript::setPrefix(const QString _prefix)
void ExtScript::setRedirect(const Redirect _redirect) void ExtScript::setRedirect(const Redirect _redirect)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Redirect" << _redirect; qCDebug(LOG_LIB) << "Redirect" << _redirect;
m_redirect = _redirect; m_redirect = _redirect;
@ -188,7 +171,6 @@ void ExtScript::setRedirect(const Redirect _redirect)
void ExtScript::setStrRedirect(const QString _redirect) void ExtScript::setStrRedirect(const QString _redirect)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Redirect" << _redirect; qCDebug(LOG_LIB) << "Redirect" << _redirect;
if (_redirect == QString("stdout2sdterr")) if (_redirect == QString("stdout2sdterr"))
@ -204,7 +186,6 @@ void ExtScript::setStrRedirect(const QString _redirect)
QString ExtScript::applyFilters(QString _value) const QString ExtScript::applyFilters(QString _value) const
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Value" << _value; qCDebug(LOG_LIB) << "Value" << _value;
foreach (QString filt, m_filters) { foreach (QString filt, m_filters) {
@ -225,7 +206,6 @@ QString ExtScript::applyFilters(QString _value) const
void ExtScript::updateFilter(const QString _filter, const bool _add) void ExtScript::updateFilter(const QString _filter, const bool _add)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Filter" << _filter; qCDebug(LOG_LIB) << "Filter" << _filter;
qCDebug(LOG_LIB) << "Should be added" << _add; qCDebug(LOG_LIB) << "Should be added" << _add;
@ -241,7 +221,6 @@ void ExtScript::updateFilter(const QString _filter, const bool _add)
void ExtScript::readConfiguration() void ExtScript::readConfiguration()
{ {
qCDebug(LOG_LIB);
AbstractExtItem::readConfiguration(); AbstractExtItem::readConfiguration();
for (int i = directories().count() - 1; i >= 0; i--) { for (int i = directories().count() - 1; i >= 0; i--) {
@ -277,8 +256,6 @@ void ExtScript::readConfiguration()
void ExtScript::readJsonFilters() void ExtScript::readJsonFilters()
{ {
qCDebug(LOG_LIB);
QString fileName = QStandardPaths::locate( QString fileName = QStandardPaths::locate(
QStandardPaths::GenericDataLocation, QStandardPaths::GenericDataLocation,
QString( QString(
@ -306,7 +283,6 @@ void ExtScript::readJsonFilters()
QVariantHash ExtScript::run() QVariantHash ExtScript::run()
{ {
qCDebug(LOG_LIB);
if (!isActive()) if (!isActive())
return value; return value;
@ -329,7 +305,6 @@ QVariantHash ExtScript::run()
int ExtScript::showConfiguration(const QVariant args) int ExtScript::showConfiguration(const QVariant args)
{ {
Q_UNUSED(args) Q_UNUSED(args)
qCDebug(LOG_LIB);
ui->lineEdit_name->setText(name()); ui->lineEdit_name->setText(name());
ui->lineEdit_comment->setText(comment()); ui->lineEdit_comment->setText(comment());
@ -375,7 +350,6 @@ int ExtScript::showConfiguration(const QVariant args)
void ExtScript::writeConfiguration() const void ExtScript::writeConfiguration() const
{ {
qCDebug(LOG_LIB);
AbstractExtItem::writeConfiguration(); AbstractExtItem::writeConfiguration();
QSettings settings( QSettings settings(
@ -396,8 +370,6 @@ void ExtScript::writeConfiguration() const
void ExtScript::updateValue() void ExtScript::updateValue()
{ {
qCDebug(LOG_LIB);
qCInfo(LOG_LIB) << "Cmd returns" << process->exitCode(); qCInfo(LOG_LIB) << "Cmd returns" << process->exitCode();
QString qdebug = QTextCodec::codecForMib(106) QString qdebug = QTextCodec::codecForMib(106)
->toUnicode(process->readAllStandardError()) ->toUnicode(process->readAllStandardError())
@ -431,8 +403,6 @@ void ExtScript::updateValue()
void ExtScript::translate() void ExtScript::translate()
{ {
qCDebug(LOG_LIB);
ui->label_name->setText(i18n("Name")); ui->label_name->setText(i18n("Name"));
ui->label_comment->setText(i18n("Comment")); ui->label_comment->setText(i18n("Comment"));
ui->label_number->setText(i18n("Tag")); ui->label_number->setText(i18n("Tag"));

View File

@ -34,7 +34,7 @@ ExtUpgrade::ExtUpgrade(QWidget *parent, const QString upgradeName,
: AbstractExtItem(parent, upgradeName, directories) : AbstractExtItem(parent, upgradeName, directories)
, ui(new Ui::ExtUpgrade) , ui(new Ui::ExtUpgrade)
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
readConfiguration(); readConfiguration();
ui->setupUi(this); ui->setupUi(this);
@ -42,7 +42,7 @@ ExtUpgrade::ExtUpgrade(QWidget *parent, const QString upgradeName,
value[tag(QString("pkgcount"))] = 0; value[tag(QString("pkgcount"))] = 0;
process = new QProcess(this); process = new QProcess(nullptr);
connect(process, SIGNAL(finished(int)), this, SLOT(updateValue())); connect(process, SIGNAL(finished(int)), this, SLOT(updateValue()));
process->waitForFinished(0); process->waitForFinished(0);
} }
@ -50,17 +50,16 @@ ExtUpgrade::ExtUpgrade(QWidget *parent, const QString upgradeName,
ExtUpgrade::~ExtUpgrade() ExtUpgrade::~ExtUpgrade()
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
process->kill(); process->kill();
delete process; process->deleteLater();
delete ui; delete ui;
} }
ExtUpgrade *ExtUpgrade::copy(const QString _fileName, const int _number) ExtUpgrade *ExtUpgrade::copy(const QString _fileName, const int _number)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "File" << _fileName; qCDebug(LOG_LIB) << "File" << _fileName;
qCDebug(LOG_LIB) << "Number" << _number; qCDebug(LOG_LIB) << "Number" << _number;
@ -82,39 +81,30 @@ ExtUpgrade *ExtUpgrade::copy(const QString _fileName, const int _number)
QString ExtUpgrade::executable() const QString ExtUpgrade::executable() const
{ {
qCDebug(LOG_LIB);
return m_executable; return m_executable;
} }
QString ExtUpgrade::filter() const QString ExtUpgrade::filter() const
{ {
qCDebug(LOG_LIB);
return m_filter; return m_filter;
} }
int ExtUpgrade::null() const int ExtUpgrade::null() const
{ {
qCDebug(LOG_LIB);
return m_null; return m_null;
} }
QString ExtUpgrade::uniq() const QString ExtUpgrade::uniq() const
{ {
qCDebug(LOG_LIB);
return m_executable; return m_executable;
} }
void ExtUpgrade::setExecutable(const QString _executable) void ExtUpgrade::setExecutable(const QString _executable)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Executable" << _executable; qCDebug(LOG_LIB) << "Executable" << _executable;
m_executable = _executable; m_executable = _executable;
@ -123,7 +113,6 @@ void ExtUpgrade::setExecutable(const QString _executable)
void ExtUpgrade::setFilter(const QString _filter) void ExtUpgrade::setFilter(const QString _filter)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Filter" << _filter; qCDebug(LOG_LIB) << "Filter" << _filter;
m_filter = _filter; m_filter = _filter;
@ -132,7 +121,6 @@ void ExtUpgrade::setFilter(const QString _filter)
void ExtUpgrade::setNull(const int _null) void ExtUpgrade::setNull(const int _null)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Null lines" << _null; qCDebug(LOG_LIB) << "Null lines" << _null;
if (_null < 0) if (_null < 0)
return; return;
@ -143,7 +131,6 @@ void ExtUpgrade::setNull(const int _null)
void ExtUpgrade::readConfiguration() void ExtUpgrade::readConfiguration()
{ {
qCDebug(LOG_LIB);
AbstractExtItem::readConfiguration(); AbstractExtItem::readConfiguration();
for (int i = directories().count() - 1; i >= 0; i--) { for (int i = directories().count() - 1; i >= 0; i--) {
@ -175,7 +162,6 @@ void ExtUpgrade::readConfiguration()
QVariantHash ExtUpgrade::run() QVariantHash ExtUpgrade::run()
{ {
qCDebug(LOG_LIB);
if (!isActive()) if (!isActive())
return value; return value;
@ -195,7 +181,6 @@ QVariantHash ExtUpgrade::run()
int ExtUpgrade::showConfiguration(const QVariant args) int ExtUpgrade::showConfiguration(const QVariant args)
{ {
Q_UNUSED(args) Q_UNUSED(args)
qCDebug(LOG_LIB);
ui->lineEdit_name->setText(name()); ui->lineEdit_name->setText(name());
ui->lineEdit_comment->setText(comment()); ui->lineEdit_comment->setText(comment());
@ -227,7 +212,6 @@ int ExtUpgrade::showConfiguration(const QVariant args)
void ExtUpgrade::writeConfiguration() const void ExtUpgrade::writeConfiguration() const
{ {
qCDebug(LOG_LIB);
AbstractExtItem::writeConfiguration(); AbstractExtItem::writeConfiguration();
QSettings settings( QSettings settings(
@ -247,8 +231,6 @@ void ExtUpgrade::writeConfiguration() const
void ExtUpgrade::updateValue() void ExtUpgrade::updateValue()
{ {
qCDebug(LOG_LIB);
qCInfo(LOG_LIB) << "Cmd returns" << process->exitCode(); qCInfo(LOG_LIB) << "Cmd returns" << process->exitCode();
qCInfo(LOG_LIB) << "Error" << process->readAllStandardError(); qCInfo(LOG_LIB) << "Error" << process->readAllStandardError();
@ -268,8 +250,6 @@ void ExtUpgrade::updateValue()
void ExtUpgrade::translate() void ExtUpgrade::translate()
{ {
qCDebug(LOG_LIB);
ui->label_name->setText(i18n("Name")); ui->label_name->setText(i18n("Name"));
ui->label_comment->setText(i18n("Comment")); ui->label_comment->setText(i18n("Comment"));
ui->label_number->setText(i18n("Tag")); ui->label_number->setText(i18n("Tag"));

View File

@ -39,7 +39,7 @@ ExtWeather::ExtWeather(QWidget *parent, const QString weatherName,
: AbstractExtItem(parent, weatherName, directories) : AbstractExtItem(parent, weatherName, directories)
, ui(new Ui::ExtWeather) , ui(new Ui::ExtWeather)
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
readConfiguration(); readConfiguration();
readJsonMap(); readJsonMap();
@ -62,7 +62,7 @@ ExtWeather::ExtWeather(QWidget *parent, const QString weatherName,
ExtWeather::~ExtWeather() ExtWeather::~ExtWeather()
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
disconnect(manager, SIGNAL(finished(QNetworkReply *)), this, disconnect(manager, SIGNAL(finished(QNetworkReply *)), this,
SLOT(weatherReplyReceived(QNetworkReply *))); SLOT(weatherReplyReceived(QNetworkReply *)));
@ -74,7 +74,6 @@ ExtWeather::~ExtWeather()
ExtWeather *ExtWeather::copy(const QString _fileName, const int _number) ExtWeather *ExtWeather::copy(const QString _fileName, const int _number)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "File" << _fileName; qCDebug(LOG_LIB) << "File" << _fileName;
qCDebug(LOG_LIB) << "Number" << _number; qCDebug(LOG_LIB) << "Number" << _number;
@ -97,7 +96,6 @@ ExtWeather *ExtWeather::copy(const QString _fileName, const int _number)
QString ExtWeather::weatherFromInt(const int _id) const QString ExtWeather::weatherFromInt(const int _id) const
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Weather ID" << _id; qCDebug(LOG_LIB) << "Weather ID" << _id;
QVariantMap map QVariantMap map
@ -108,47 +106,36 @@ QString ExtWeather::weatherFromInt(const int _id) const
QString ExtWeather::city() const QString ExtWeather::city() const
{ {
qCDebug(LOG_LIB);
return m_city; return m_city;
} }
QString ExtWeather::country() const QString ExtWeather::country() const
{ {
qCDebug(LOG_LIB);
return m_country; return m_country;
} }
bool ExtWeather::image() const bool ExtWeather::image() const
{ {
qCDebug(LOG_LIB);
return m_image; return m_image;
} }
int ExtWeather::ts() const int ExtWeather::ts() const
{ {
qCDebug(LOG_LIB);
return m_ts; return m_ts;
} }
QString ExtWeather::uniq() const QString ExtWeather::uniq() const
{ {
qCDebug(LOG_LIB);
return QString("%1 (%2) at %3").arg(m_city).arg(m_country).arg(m_ts); return QString("%1 (%2) at %3").arg(m_city).arg(m_country).arg(m_ts);
} }
void ExtWeather::setCity(const QString _city) void ExtWeather::setCity(const QString _city)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "City" << _city; qCDebug(LOG_LIB) << "City" << _city;
m_city = _city; m_city = _city;
@ -157,7 +144,6 @@ void ExtWeather::setCity(const QString _city)
void ExtWeather::setCountry(const QString _country) void ExtWeather::setCountry(const QString _country)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Country" << _country; qCDebug(LOG_LIB) << "Country" << _country;
m_country = _country; m_country = _country;
@ -166,7 +152,6 @@ void ExtWeather::setCountry(const QString _country)
void ExtWeather::setImage(const bool _image) void ExtWeather::setImage(const bool _image)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Use image" << _image; qCDebug(LOG_LIB) << "Use image" << _image;
m_image = _image; m_image = _image;
@ -175,7 +160,6 @@ void ExtWeather::setImage(const bool _image)
void ExtWeather::setTs(const int _ts) void ExtWeather::setTs(const int _ts)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Timestamp" << _ts; qCDebug(LOG_LIB) << "Timestamp" << _ts;
m_ts = _ts; m_ts = _ts;
@ -184,7 +168,6 @@ void ExtWeather::setTs(const int _ts)
void ExtWeather::readConfiguration() void ExtWeather::readConfiguration()
{ {
qCDebug(LOG_LIB);
AbstractExtItem::readConfiguration(); AbstractExtItem::readConfiguration();
for (int i = directories().count() - 1; i >= 0; i--) { for (int i = directories().count() - 1; i >= 0; i--) {
@ -220,8 +203,6 @@ void ExtWeather::readConfiguration()
void ExtWeather::readJsonMap() void ExtWeather::readJsonMap()
{ {
qCDebug(LOG_LIB);
QString fileName = QStandardPaths::locate( QString fileName = QStandardPaths::locate(
QStandardPaths::GenericDataLocation, QStandardPaths::GenericDataLocation,
QString("awesomewidgets/weather/awesomewidgets-extweather-ids.json")); QString("awesomewidgets/weather/awesomewidgets-extweather-ids.json"));
@ -248,7 +229,6 @@ void ExtWeather::readJsonMap()
QVariantHash ExtWeather::run() QVariantHash ExtWeather::run()
{ {
qCDebug(LOG_LIB);
if ((!isActive()) || (isRunning)) if ((!isActive()) || (isRunning))
return values; return values;
@ -272,7 +252,6 @@ QVariantHash ExtWeather::run()
int ExtWeather::showConfiguration(const QVariant args) int ExtWeather::showConfiguration(const QVariant args)
{ {
Q_UNUSED(args) Q_UNUSED(args)
qCDebug(LOG_LIB);
ui->lineEdit_name->setText(name()); ui->lineEdit_name->setText(name());
ui->lineEdit_comment->setText(comment()); ui->lineEdit_comment->setText(comment());
@ -306,7 +285,6 @@ int ExtWeather::showConfiguration(const QVariant args)
void ExtWeather::writeConfiguration() const void ExtWeather::writeConfiguration() const
{ {
qCDebug(LOG_LIB);
AbstractExtItem::writeConfiguration(); AbstractExtItem::writeConfiguration();
QSettings settings( QSettings settings(
@ -327,7 +305,6 @@ void ExtWeather::writeConfiguration() const
void ExtWeather::weatherReplyReceived(QNetworkReply *reply) void ExtWeather::weatherReplyReceived(QNetworkReply *reply)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Return code" << reply->error(); qCDebug(LOG_LIB) << "Return code" << reply->error();
qCDebug(LOG_LIB) << "Reply error message" << reply->errorString(); qCDebug(LOG_LIB) << "Reply error message" << reply->errorString();
@ -364,7 +341,6 @@ void ExtWeather::weatherReplyReceived(QNetworkReply *reply)
QVariantHash ExtWeather::parseSingleJson(const QVariantMap json) const QVariantHash ExtWeather::parseSingleJson(const QVariantMap json) const
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Single json data" << json; qCDebug(LOG_LIB) << "Single json data" << json;
QVariantHash output; QVariantHash output;
@ -393,8 +369,6 @@ QVariantHash ExtWeather::parseSingleJson(const QVariantMap json) const
void ExtWeather::translate() void ExtWeather::translate()
{ {
qCDebug(LOG_LIB);
ui->label_name->setText(i18n("Name")); ui->label_name->setText(i18n("Name"));
ui->label_comment->setText(i18n("Comment")); ui->label_comment->setText(i18n("Comment"));
ui->label_number->setText(i18n("Tag")); ui->label_number->setText(i18n("Tag"));
@ -409,7 +383,6 @@ void ExtWeather::translate()
QString ExtWeather::url(const bool isForecast) const QString ExtWeather::url(const bool isForecast) const
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Is forecast" << isForecast; qCDebug(LOG_LIB) << "Is forecast" << isForecast;
QString apiUrl = isForecast ? QString(OWM_FORECAST_URL) : QString(OWM_URL); QString apiUrl = isForecast ? QString(OWM_FORECAST_URL) : QString(OWM_URL);

View File

@ -39,7 +39,7 @@ GraphicalItem::GraphicalItem(QWidget *parent, const QString desktopName,
: AbstractExtItem(parent, desktopName, directories) : AbstractExtItem(parent, desktopName, directories)
, ui(new Ui::GraphicalItem) , ui(new Ui::GraphicalItem)
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
readConfiguration(); readConfiguration();
ui->setupUi(this); ui->setupUi(this);
@ -56,7 +56,7 @@ GraphicalItem::GraphicalItem(QWidget *parent, const QString desktopName,
GraphicalItem::~GraphicalItem() GraphicalItem::~GraphicalItem()
{ {
qCDebug(LOG_LIB); qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
delete m_scene; delete m_scene;
delete ui; delete ui;
@ -65,7 +65,6 @@ GraphicalItem::~GraphicalItem()
GraphicalItem *GraphicalItem::copy(const QString _fileName, const int _number) GraphicalItem *GraphicalItem::copy(const QString _fileName, const int _number)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "File" << _fileName; qCDebug(LOG_LIB) << "File" << _fileName;
qCDebug(LOG_LIB) << "Number" << _number; qCDebug(LOG_LIB) << "Number" << _number;
@ -91,7 +90,6 @@ GraphicalItem *GraphicalItem::copy(const QString _fileName, const int _number)
QString GraphicalItem::image(const QVariant value) QString GraphicalItem::image(const QVariant value)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Value" << value; qCDebug(LOG_LIB) << "Value" << value;
if (m_bar == QString("none")) if (m_bar == QString("none"))
return QString(""); return QString("");
@ -138,48 +136,36 @@ QString GraphicalItem::image(const QVariant value)
QString GraphicalItem::bar() const QString GraphicalItem::bar() const
{ {
qCDebug(LOG_LIB);
return m_bar; return m_bar;
} }
QString GraphicalItem::activeColor() const QString GraphicalItem::activeColor() const
{ {
qCDebug(LOG_LIB);
return m_activeColor; return m_activeColor;
} }
QString GraphicalItem::inactiveColor() const QString GraphicalItem::inactiveColor() const
{ {
qCDebug(LOG_LIB);
return m_inactiveColor; return m_inactiveColor;
} }
QString GraphicalItem::tag() const QString GraphicalItem::tag() const
{ {
qCDebug(LOG_LIB);
return QString("bar%1%2").arg(number()).arg(m_bar); return QString("bar%1%2").arg(number()).arg(m_bar);
} }
GraphicalItem::Type GraphicalItem::type() const GraphicalItem::Type GraphicalItem::type() const
{ {
qCDebug(LOG_LIB);
return m_type; return m_type;
} }
QString GraphicalItem::strType() const QString GraphicalItem::strType() const
{ {
qCDebug(LOG_LIB);
QString value; QString value;
switch (m_type) { switch (m_type) {
case Vertical: case Vertical:
@ -203,16 +189,12 @@ QString GraphicalItem::strType() const
GraphicalItem::Direction GraphicalItem::direction() const GraphicalItem::Direction GraphicalItem::direction() const
{ {
qCDebug(LOG_LIB);
return m_direction; return m_direction;
} }
QString GraphicalItem::strDirection() const QString GraphicalItem::strDirection() const
{ {
qCDebug(LOG_LIB);
QString value; QString value;
switch (m_direction) { switch (m_direction) {
case RightToLeft: case RightToLeft:
@ -230,31 +212,24 @@ QString GraphicalItem::strDirection() const
int GraphicalItem::height() const int GraphicalItem::height() const
{ {
qCDebug(LOG_LIB);
return m_height; return m_height;
} }
int GraphicalItem::width() const int GraphicalItem::width() const
{ {
qCDebug(LOG_LIB);
return m_width; return m_width;
} }
QString GraphicalItem::uniq() const QString GraphicalItem::uniq() const
{ {
qCDebug(LOG_LIB);
return m_bar; return m_bar;
} }
void GraphicalItem::setBar(const QString _bar) void GraphicalItem::setBar(const QString _bar)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Bar" << _bar; qCDebug(LOG_LIB) << "Bar" << _bar;
if (!_bar.contains(QRegExp( if (!_bar.contains(QRegExp(
@ -269,7 +244,6 @@ void GraphicalItem::setBar(const QString _bar)
void GraphicalItem::setActiveColor(const QString _color) void GraphicalItem::setActiveColor(const QString _color)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Color" << _color; qCDebug(LOG_LIB) << "Color" << _color;
m_activeColor = _color; m_activeColor = _color;
@ -278,7 +252,6 @@ void GraphicalItem::setActiveColor(const QString _color)
void GraphicalItem::setInactiveColor(const QString _color) void GraphicalItem::setInactiveColor(const QString _color)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Color" << _color; qCDebug(LOG_LIB) << "Color" << _color;
m_inactiveColor = _color; m_inactiveColor = _color;
@ -287,7 +260,6 @@ void GraphicalItem::setInactiveColor(const QString _color)
void GraphicalItem::setType(const Type _type) void GraphicalItem::setType(const Type _type)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Type" << _type; qCDebug(LOG_LIB) << "Type" << _type;
m_type = _type; m_type = _type;
@ -296,7 +268,6 @@ void GraphicalItem::setType(const Type _type)
void GraphicalItem::setStrType(const QString _type) void GraphicalItem::setStrType(const QString _type)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Type" << _type; qCDebug(LOG_LIB) << "Type" << _type;
if (_type == QString("Vertical")) if (_type == QString("Vertical"))
@ -312,7 +283,6 @@ void GraphicalItem::setStrType(const QString _type)
void GraphicalItem::setDirection(const Direction _direction) void GraphicalItem::setDirection(const Direction _direction)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Direction" << _direction; qCDebug(LOG_LIB) << "Direction" << _direction;
m_direction = _direction; m_direction = _direction;
@ -321,7 +291,6 @@ void GraphicalItem::setDirection(const Direction _direction)
void GraphicalItem::setStrDirection(const QString _direction) void GraphicalItem::setStrDirection(const QString _direction)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Direction" << _direction; qCDebug(LOG_LIB) << "Direction" << _direction;
if (_direction == QString("RightToLeft")) if (_direction == QString("RightToLeft"))
@ -333,7 +302,6 @@ void GraphicalItem::setStrDirection(const QString _direction)
void GraphicalItem::setHeight(const int _height) void GraphicalItem::setHeight(const int _height)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Height" << _height; qCDebug(LOG_LIB) << "Height" << _height;
if (_height <= 0) if (_height <= 0)
return; return;
@ -344,7 +312,6 @@ void GraphicalItem::setHeight(const int _height)
void GraphicalItem::setWidth(const int _width) void GraphicalItem::setWidth(const int _width)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Width" << _width; qCDebug(LOG_LIB) << "Width" << _width;
if (_width <= 0) if (_width <= 0)
return; return;
@ -355,7 +322,6 @@ void GraphicalItem::setWidth(const int _width)
void GraphicalItem::readConfiguration() void GraphicalItem::readConfiguration()
{ {
qCDebug(LOG_LIB);
AbstractExtItem::readConfiguration(); AbstractExtItem::readConfiguration();
for (int i = directories().count() - 1; i >= 0; i--) { for (int i = directories().count() - 1; i >= 0; i--) {
@ -399,8 +365,6 @@ void GraphicalItem::readConfiguration()
QVariantHash GraphicalItem::run() QVariantHash GraphicalItem::run()
{ {
qCDebug(LOG_LIB);
// required by abstract class // required by abstract class
return QVariantHash(); return QVariantHash();
} }
@ -408,7 +372,6 @@ QVariantHash GraphicalItem::run()
int GraphicalItem::showConfiguration(const QVariant args) int GraphicalItem::showConfiguration(const QVariant args)
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Combobox arguments" << args; qCDebug(LOG_LIB) << "Combobox arguments" << args;
QStringList tags = args.toStringList(); QStringList tags = args.toStringList();
@ -445,7 +408,6 @@ int GraphicalItem::showConfiguration(const QVariant args)
void GraphicalItem::writeConfiguration() const void GraphicalItem::writeConfiguration() const
{ {
qCDebug(LOG_LIB);
AbstractExtItem::writeConfiguration(); AbstractExtItem::writeConfiguration();
QSettings settings( QSettings settings(
@ -469,8 +431,6 @@ void GraphicalItem::writeConfiguration() const
void GraphicalItem::changeColor() void GraphicalItem::changeColor()
{ {
qCDebug(LOG_LIB);
QColor color QColor color
= stringToColor((static_cast<QPushButton *>(sender()))->text()); = stringToColor((static_cast<QPushButton *>(sender()))->text());
QColor newColor = QColorDialog::getColor(color, this, tr("Select color"), QColor newColor = QColorDialog::getColor(color, this, tr("Select color"),
@ -492,8 +452,6 @@ void GraphicalItem::changeColor()
void GraphicalItem::initScene() void GraphicalItem::initScene()
{ {
qCDebug(LOG_LIB);
// init scene // init scene
m_scene = new QGraphicsScene(); m_scene = new QGraphicsScene();
if (m_type == Graph) if (m_type == Graph)
@ -513,8 +471,6 @@ void GraphicalItem::initScene()
void GraphicalItem::paintCircle(const float value) void GraphicalItem::paintCircle(const float value)
{ {
qCDebug(LOG_LIB);
QPen pen; QPen pen;
pen.setWidth(1.0); pen.setWidth(1.0);
float percent = value / 100.0; float percent = value / 100.0;
@ -540,8 +496,6 @@ void GraphicalItem::paintCircle(const float value)
void GraphicalItem::paintGraph(const QList<float> value) void GraphicalItem::paintGraph(const QList<float> value)
{ {
qCDebug(LOG_LIB);
QPen pen; QPen pen;
pen.setColor(stringToColor(m_activeColor)); pen.setColor(stringToColor(m_activeColor));
@ -563,8 +517,6 @@ void GraphicalItem::paintGraph(const QList<float> value)
void GraphicalItem::paintHorizontal(const float value) void GraphicalItem::paintHorizontal(const float value)
{ {
qCDebug(LOG_LIB);
QPen pen; QPen pen;
float percent = value / 100.0; float percent = value / 100.0;
@ -582,8 +534,6 @@ void GraphicalItem::paintHorizontal(const float value)
void GraphicalItem::paintVertical(const float value) void GraphicalItem::paintVertical(const float value)
{ {
qCDebug(LOG_LIB);
QPen pen; QPen pen;
float percent = value / 100.0; float percent = value / 100.0;
@ -601,7 +551,6 @@ void GraphicalItem::paintVertical(const float value)
QColor GraphicalItem::stringToColor(const QString _color) const QColor GraphicalItem::stringToColor(const QString _color) const
{ {
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Color" << _color; qCDebug(LOG_LIB) << "Color" << _color;
QColor qcolor; QColor qcolor;
@ -619,8 +568,6 @@ QColor GraphicalItem::stringToColor(const QString _color) const
void GraphicalItem::translate() void GraphicalItem::translate()
{ {
qCDebug(LOG_LIB);
ui->label_name->setText(i18n("Name")); ui->label_name->setText(i18n("Name"));
ui->label_comment->setText(i18n("Comment")); ui->label_comment->setText(i18n("Comment"));
ui->label_value->setText(i18n("Value")); ui->label_value->setText(i18n("Value"));

View File

@ -40,10 +40,10 @@
DPAdds::DPAdds(QObject *parent) DPAdds::DPAdds(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
qCDebug(LOG_DP);
// logging
qSetMessagePattern(LOG_FORMAT); qSetMessagePattern(LOG_FORMAT);
qCDebug(LOG_DP) << __PRETTY_FUNCTION__;
foreach (const QString metadata, getBuildData())
qCDebug(LOG_DP) << metadata;
connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this, connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this,
SIGNAL(desktopChanged())); SIGNAL(desktopChanged()));
@ -56,31 +56,25 @@ DPAdds::DPAdds(QObject *parent)
DPAdds::~DPAdds() DPAdds::~DPAdds()
{ {
qCDebug(LOG_DP); qCDebug(LOG_DP) << __PRETTY_FUNCTION__;
} }
// HACK: since QML could not use QLoggingCategory I need this hack // HACK: since QML could not use QLoggingCategory I need this hack
bool DPAdds::isDebugEnabled() const bool DPAdds::isDebugEnabled() const
{ {
qCDebug(LOG_DP);
return LOG_DP().isDebugEnabled(); return LOG_DP().isDebugEnabled();
} }
int DPAdds::currentDesktop() const int DPAdds::currentDesktop() const
{ {
qCDebug(LOG_DP);
return KWindowSystem::currentDesktop(); return KWindowSystem::currentDesktop();
} }
QStringList DPAdds::dictKeys() const QStringList DPAdds::dictKeys() const
{ {
qCDebug(LOG_DP);
QStringList allKeys; QStringList allKeys;
allKeys.append(QString("mark")); allKeys.append(QString("mark"));
allKeys.append(QString("name")); allKeys.append(QString("name"));
@ -93,15 +87,12 @@ QStringList DPAdds::dictKeys() const
int DPAdds::numberOfDesktops() const int DPAdds::numberOfDesktops() const
{ {
qCDebug(LOG_DP);
return KWindowSystem::numberOfDesktops(); return KWindowSystem::numberOfDesktops();
} }
QString DPAdds::toolTipImage(const int desktop) const QString DPAdds::toolTipImage(const int desktop) const
{ {
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Desktop" << desktop; qCDebug(LOG_DP) << "Desktop" << desktop;
// drop if no tooltip required // drop if no tooltip required
if (m_tooltipType == QString("none")) if (m_tooltipType == QString("none"))
@ -200,7 +191,6 @@ QString DPAdds::toolTipImage(const int desktop) const
QString DPAdds::parsePattern(const QString pattern, const int desktop) const QString DPAdds::parsePattern(const QString pattern, const int desktop) const
{ {
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Pattern" << pattern; qCDebug(LOG_DP) << "Pattern" << pattern;
qCDebug(LOG_DP) << "Desktop number" << desktop; qCDebug(LOG_DP) << "Desktop number" << desktop;
@ -216,7 +206,6 @@ QString DPAdds::parsePattern(const QString pattern, const int desktop) const
void DPAdds::setMark(const QString newMark) void DPAdds::setMark(const QString newMark)
{ {
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Mark" << newMark; qCDebug(LOG_DP) << "Mark" << newMark;
m_mark = newMark; m_mark = newMark;
@ -225,7 +214,6 @@ void DPAdds::setMark(const QString newMark)
void DPAdds::setToolTipData(const QVariantMap tooltipData) void DPAdds::setToolTipData(const QVariantMap tooltipData)
{ {
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Data" << tooltipData; qCDebug(LOG_DP) << "Data" << tooltipData;
m_tooltipColor = tooltipData[QString("tooltipColor")].toString(); m_tooltipColor = tooltipData[QString("tooltipColor")].toString();
@ -236,7 +224,6 @@ void DPAdds::setToolTipData(const QVariantMap tooltipData)
QString DPAdds::valueByKey(const QString key, int desktop) const QString DPAdds::valueByKey(const QString key, int desktop) const
{ {
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Requested key" << key; qCDebug(LOG_DP) << "Requested key" << key;
qCDebug(LOG_DP) << "Desktop number" << desktop; qCDebug(LOG_DP) << "Desktop number" << desktop;
if (desktop == -1) if (desktop == -1)
@ -262,7 +249,6 @@ QString DPAdds::valueByKey(const QString key, int desktop) const
// HACK: this method uses variables from version.h // HACK: this method uses variables from version.h
QString DPAdds::getAboutText(const QString type) const QString DPAdds::getAboutText(const QString type) const
{ {
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Type" << type; qCDebug(LOG_DP) << "Type" << type;
QString text; QString text;
@ -323,7 +309,6 @@ QString DPAdds::getAboutText(const QString type) const
QVariantMap DPAdds::getFont(const QVariantMap defaultFont) const QVariantMap DPAdds::getFont(const QVariantMap defaultFont) const
{ {
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Default font is" << defaultFont; qCDebug(LOG_DP) << "Default font is" << defaultFont;
QVariantMap fontMap; QVariantMap fontMap;
@ -343,7 +328,6 @@ QVariantMap DPAdds::getFont(const QVariantMap defaultFont) const
// to avoid additional object definition this method is static // to avoid additional object definition this method is static
void DPAdds::sendNotification(const QString eventId, const QString message) void DPAdds::sendNotification(const QString eventId, const QString message)
{ {
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Event" << eventId; qCDebug(LOG_DP) << "Event" << eventId;
qCDebug(LOG_DP) << "Message" << message; qCDebug(LOG_DP) << "Message" << message;
@ -357,7 +341,6 @@ void DPAdds::sendNotification(const QString eventId, const QString message)
// slot for mouse click // slot for mouse click
void DPAdds::setCurrentDesktop(const int desktop) const void DPAdds::setCurrentDesktop(const int desktop) const
{ {
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Desktop" << desktop; qCDebug(LOG_DP) << "Desktop" << desktop;
KWindowSystem::setCurrentDesktop(desktop); KWindowSystem::setCurrentDesktop(desktop);
@ -366,7 +349,6 @@ void DPAdds::setCurrentDesktop(const int desktop) const
DPAdds::DesktopWindowsInfo DPAdds::getInfoByDesktop(const int desktop) const DPAdds::DesktopWindowsInfo DPAdds::getInfoByDesktop(const int desktop) const
{ {
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Desktop" << desktop; qCDebug(LOG_DP) << "Desktop" << desktop;

View File

@ -32,10 +32,10 @@ ExtendedSysMon::ExtendedSysMon(QObject *parent, const QVariantList &args)
: Plasma::DataEngine(parent, args) : Plasma::DataEngine(parent, args)
{ {
Q_UNUSED(args) Q_UNUSED(args)
qCDebug(LOG_ESM);
// logging
qSetMessagePattern(LOG_FORMAT); qSetMessagePattern(LOG_FORMAT);
qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
foreach (const QString metadata, getBuildData())
qCDebug(LOG_ESM) << metadata;
setMinimumPollingInterval(333); setMinimumPollingInterval(333);
readConfiguration(); readConfiguration();
@ -49,7 +49,7 @@ ExtendedSysMon::ExtendedSysMon(QObject *parent, const QVariantList &args)
ExtendedSysMon::~ExtendedSysMon() ExtendedSysMon::~ExtendedSysMon()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
delete aggregator; delete aggregator;
} }
@ -57,15 +57,12 @@ ExtendedSysMon::~ExtendedSysMon()
QStringList ExtendedSysMon::sources() const QStringList ExtendedSysMon::sources() const
{ {
qCDebug(LOG_ESM);
return aggregator->sources(); return aggregator->sources();
} }
bool ExtendedSysMon::sourceRequestEvent(const QString &source) bool ExtendedSysMon::sourceRequestEvent(const QString &source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
return updateSourceEvent(source); return updateSourceEvent(source);
@ -74,7 +71,6 @@ bool ExtendedSysMon::sourceRequestEvent(const QString &source)
bool ExtendedSysMon::updateSourceEvent(const QString &source) bool ExtendedSysMon::updateSourceEvent(const QString &source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
if (aggregator->hasSource(source)) { if (aggregator->hasSource(source)) {
@ -90,8 +86,6 @@ bool ExtendedSysMon::updateSourceEvent(const QString &source)
QStringList ExtendedSysMon::getAllHdd() const QStringList ExtendedSysMon::getAllHdd() const
{ {
qCDebug(LOG_ESM);
QStringList allDevices QStringList allDevices
= QDir(QString("/dev")).entryList(QDir::System, QDir::Name); = QDir(QString("/dev")).entryList(QDir::System, QDir::Name);
QStringList devices = allDevices.filter(QRegExp(QString("^[hms]d[a-z]$"))); QStringList devices = allDevices.filter(QRegExp(QString("^[hms]d[a-z]$")));
@ -105,8 +99,6 @@ QStringList ExtendedSysMon::getAllHdd() const
QString ExtendedSysMon::getAutoGpu() const QString ExtendedSysMon::getAutoGpu() const
{ {
qCDebug(LOG_ESM);
QString gpu = QString("disable"); QString gpu = QString("disable");
QFile moduleFile(QString("/proc/modules")); QFile moduleFile(QString("/proc/modules"));
if (!moduleFile.open(QIODevice::ReadOnly)) if (!moduleFile.open(QIODevice::ReadOnly))
@ -125,8 +117,6 @@ QString ExtendedSysMon::getAutoGpu() const
void ExtendedSysMon::readConfiguration() void ExtendedSysMon::readConfiguration()
{ {
qCDebug(LOG_ESM);
QString fileName QString fileName
= QStandardPaths::locate(QStandardPaths::ConfigLocation, = QStandardPaths::locate(QStandardPaths::ConfigLocation,
QString("plasma-dataengine-extsysmon.conf")); QString("plasma-dataengine-extsysmon.conf"));
@ -166,7 +156,6 @@ void ExtendedSysMon::readConfiguration()
QHash<QString, QString> QHash<QString, QString>
ExtendedSysMon::updateConfiguration(QHash<QString, QString> rawConfig) const ExtendedSysMon::updateConfiguration(QHash<QString, QString> rawConfig) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Raw configuration" << rawConfig; qCDebug(LOG_ESM) << "Raw configuration" << rawConfig;
// gpudev // gpudev

View File

@ -18,7 +18,6 @@
#include "extsysmonaggregator.h" #include "extsysmonaggregator.h"
#include "awdebug.h" #include "awdebug.h"
#include "version.h"
#include "sources/batterysource.h" #include "sources/batterysource.h"
#include "sources/customsource.h" #include "sources/customsource.h"
#include "sources/desktopsource.h" #include "sources/desktopsource.h"
@ -33,13 +32,14 @@
#include "sources/updatesource.h" #include "sources/updatesource.h"
#include "sources/upgradesource.h" #include "sources/upgradesource.h"
#include "sources/weathersource.h" #include "sources/weathersource.h"
#include "version.h"
ExtSysMonAggregator::ExtSysMonAggregator(QObject *parent, ExtSysMonAggregator::ExtSysMonAggregator(QObject *parent,
const QHash<QString, QString> config) const QHash<QString, QString> config)
: QObject(parent) : QObject(parent)
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
init(config); init(config);
} }
@ -47,7 +47,7 @@ ExtSysMonAggregator::ExtSysMonAggregator(QObject *parent,
ExtSysMonAggregator::~ExtSysMonAggregator() ExtSysMonAggregator::~ExtSysMonAggregator()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
m_map.clear(); m_map.clear();
} }
@ -55,7 +55,6 @@ ExtSysMonAggregator::~ExtSysMonAggregator()
QVariant ExtSysMonAggregator::data(const QString source) const QVariant ExtSysMonAggregator::data(const QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
return hasSource(source) ? m_map[source]->data(source) : QVariant(); return hasSource(source) ? m_map[source]->data(source) : QVariant();
@ -70,7 +69,6 @@ bool ExtSysMonAggregator::hasSource(const QString source) const
QVariantMap ExtSysMonAggregator::initialData(const QString source) const QVariantMap ExtSysMonAggregator::initialData(const QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
return hasSource(source) ? m_map[source]->initialData(source) return hasSource(source) ? m_map[source]->initialData(source)
@ -80,8 +78,6 @@ QVariantMap ExtSysMonAggregator::initialData(const QString source) const
QStringList ExtSysMonAggregator::sources() const QStringList ExtSysMonAggregator::sources() const
{ {
qCDebug(LOG_ESM);
QStringList sorted = m_map.keys(); QStringList sorted = m_map.keys();
sorted.sort(); sorted.sort();
return sorted; return sorted;
@ -90,7 +86,7 @@ QStringList ExtSysMonAggregator::sources() const
void ExtSysMonAggregator::init(const QHash<QString, QString> config) void ExtSysMonAggregator::init(const QHash<QString, QString> config)
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Configuration" << config;
// battery // battery
AbstractExtSysMonSource *batteryItem AbstractExtSysMonSource *batteryItem

View File

@ -27,7 +27,7 @@ BatterySource::BatterySource(QObject *parent, const QStringList args)
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 1); Q_ASSERT(args.count() == 1);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
m_acpiPath = args.at(0); m_acpiPath = args.at(0);
m_sources = getSources(); m_sources = getSources();
@ -36,13 +36,12 @@ BatterySource::BatterySource(QObject *parent, const QStringList args)
BatterySource::~BatterySource() BatterySource::~BatterySource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
QVariant BatterySource::data(QString source) QVariant BatterySource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
if (source == QString("battery/ac")) if (source == QString("battery/ac"))
@ -53,7 +52,6 @@ QVariant BatterySource::data(QString source)
QVariantMap BatterySource::initialData(QString source) const QVariantMap BatterySource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
QVariantMap data; QVariantMap data;
@ -83,8 +81,6 @@ QVariantMap BatterySource::initialData(QString source) const
void BatterySource::run() void BatterySource::run()
{ {
qCDebug(LOG_ESM);
// adaptor // adaptor
QFile acFile(QString("%1/AC/online").arg(m_acpiPath)); QFile acFile(QString("%1/AC/online").arg(m_acpiPath));
if (acFile.open(QIODevice::ReadOnly)) if (acFile.open(QIODevice::ReadOnly))
@ -121,16 +117,12 @@ void BatterySource::run()
QStringList BatterySource::sources() const QStringList BatterySource::sources() const
{ {
qCDebug(LOG_ESM);
return m_sources; return m_sources;
} }
QStringList BatterySource::getSources() QStringList BatterySource::getSources()
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
sources.append(QString("battery/ac")); sources.append(QString("battery/ac"));
sources.append(QString("battery/bat")); sources.append(QString("battery/bat"));

View File

@ -26,7 +26,7 @@ CustomSource::CustomSource(QObject *parent, const QStringList args)
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 0); Q_ASSERT(args.count() == 0);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
extScripts = new ExtItemAggregator<ExtScript>(nullptr, QString("scripts")); extScripts = new ExtItemAggregator<ExtScript>(nullptr, QString("scripts"));
m_sources = getSources(); m_sources = getSources();
@ -35,7 +35,7 @@ CustomSource::CustomSource(QObject *parent, const QStringList args)
CustomSource::~CustomSource() CustomSource::~CustomSource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
delete extScripts; delete extScripts;
} }
@ -43,7 +43,6 @@ CustomSource::~CustomSource()
QVariant CustomSource::data(QString source) QVariant CustomSource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
// there are only one value // there are only one value
@ -53,7 +52,6 @@ QVariant CustomSource::data(QString source)
QVariantMap CustomSource::initialData(QString source) const QVariantMap CustomSource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
QVariantMap data; QVariantMap data;
@ -71,16 +69,12 @@ QVariantMap CustomSource::initialData(QString source) const
QStringList CustomSource::sources() const QStringList CustomSource::sources() const
{ {
qCDebug(LOG_ESM);
return m_sources; return m_sources;
} }
QStringList CustomSource::getSources() QStringList CustomSource::getSources()
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
foreach (ExtScript *item, extScripts->activeItems()) foreach (ExtScript *item, extScripts->activeItems())
sources.append(QString("custom/%1").arg(item->tag(QString("custom")))); sources.append(QString("custom/%1").arg(item->tag(QString("custom"))));

View File

@ -27,19 +27,18 @@ DesktopSource::DesktopSource(QObject *parent, const QStringList args)
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 0); Q_ASSERT(args.count() == 0);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
DesktopSource::~DesktopSource() DesktopSource::~DesktopSource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
QVariant DesktopSource::data(QString source) QVariant DesktopSource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
int current = KWindowSystem::currentDesktop(); int current = KWindowSystem::currentDesktop();
@ -64,7 +63,6 @@ QVariant DesktopSource::data(QString source)
QVariantMap DesktopSource::initialData(QString source) const QVariantMap DesktopSource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
QVariantMap data; QVariantMap data;
@ -100,8 +98,6 @@ QVariantMap DesktopSource::initialData(QString source) const
QStringList DesktopSource::sources() const QStringList DesktopSource::sources() const
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
sources.append(QString("desktop/current/name")); sources.append(QString("desktop/current/name"));
sources.append(QString("desktop/current/number")); sources.append(QString("desktop/current/number"));

View File

@ -29,7 +29,7 @@ GPULoadSource::GPULoadSource(QObject *parent, const QStringList args)
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 1); Q_ASSERT(args.count() == 1);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
m_device = args.at(0); m_device = args.at(0);
} }
@ -37,13 +37,12 @@ GPULoadSource::GPULoadSource(QObject *parent, const QStringList args)
GPULoadSource::~GPULoadSource() GPULoadSource::~GPULoadSource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
QVariant GPULoadSource::data(QString source) QVariant GPULoadSource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
if (source == QString("gpu/load")) { if (source == QString("gpu/load")) {
@ -94,7 +93,6 @@ QVariant GPULoadSource::data(QString source)
QVariantMap GPULoadSource::initialData(QString source) const QVariantMap GPULoadSource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
QVariantMap data; QVariantMap data;
@ -112,8 +110,6 @@ QVariantMap GPULoadSource::initialData(QString source) const
QStringList GPULoadSource::sources() const QStringList GPULoadSource::sources() const
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
sources.append(QString("gpu/load")); sources.append(QString("gpu/load"));

View File

@ -30,7 +30,7 @@ GPUTemperatureSource::GPUTemperatureSource(QObject *parent,
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 1); Q_ASSERT(args.count() == 1);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
m_device = args.at(0); m_device = args.at(0);
} }
@ -38,13 +38,12 @@ GPUTemperatureSource::GPUTemperatureSource(QObject *parent,
GPUTemperatureSource::~GPUTemperatureSource() GPUTemperatureSource::~GPUTemperatureSource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
QVariant GPUTemperatureSource::data(QString source) QVariant GPUTemperatureSource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
if (source == QString("gpu/temperature")) { if (source == QString("gpu/temperature")) {
@ -93,7 +92,6 @@ QVariant GPUTemperatureSource::data(QString source)
QVariantMap GPUTemperatureSource::initialData(QString source) const QVariantMap GPUTemperatureSource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
QVariantMap data; QVariantMap data;
@ -111,8 +109,6 @@ QVariantMap GPUTemperatureSource::initialData(QString source) const
QStringList GPUTemperatureSource::sources() const QStringList GPUTemperatureSource::sources() const
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
sources.append(QString("gpu/temperature")); sources.append(QString("gpu/temperature"));

View File

@ -30,7 +30,7 @@ HDDTemperatureSource::HDDTemperatureSource(QObject *parent,
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 2); Q_ASSERT(args.count() == 2);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
m_devices = args.at(0).split(QChar(','), QString::SkipEmptyParts); m_devices = args.at(0).split(QChar(','), QString::SkipEmptyParts);
m_cmd = args.at(1); m_cmd = args.at(1);
@ -42,13 +42,12 @@ HDDTemperatureSource::HDDTemperatureSource(QObject *parent,
HDDTemperatureSource::~HDDTemperatureSource() HDDTemperatureSource::~HDDTemperatureSource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
QVariant HDDTemperatureSource::data(QString source) QVariant HDDTemperatureSource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
QString device = source.remove(QString("hdd/temperature")); QString device = source.remove(QString("hdd/temperature"));
@ -88,7 +87,6 @@ QVariant HDDTemperatureSource::data(QString source)
QVariantMap HDDTemperatureSource::initialData(QString source) const QVariantMap HDDTemperatureSource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
QString device = source.remove(QString("hdd/temperature")); QString device = source.remove(QString("hdd/temperature"));
@ -105,8 +103,6 @@ QVariantMap HDDTemperatureSource::initialData(QString source) const
QStringList HDDTemperatureSource::sources() const QStringList HDDTemperatureSource::sources() const
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
foreach (QString device, m_devices) foreach (QString device, m_devices)
sources.append(QString("hdd/temperature%1").arg(device)); sources.append(QString("hdd/temperature%1").arg(device));

View File

@ -25,19 +25,18 @@ LoadSource::LoadSource(QObject *parent, const QStringList args)
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 0); Q_ASSERT(args.count() == 0);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
LoadSource::~LoadSource() LoadSource::~LoadSource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
QVariant LoadSource::data(QString source) QVariant LoadSource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
source.remove(QString("load/load")); source.remove(QString("load/load"));
@ -47,7 +46,6 @@ QVariant LoadSource::data(QString source)
QVariantMap LoadSource::initialData(QString source) const QVariantMap LoadSource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
QVariantMap data; QVariantMap data;
@ -65,8 +63,6 @@ QVariantMap LoadSource::initialData(QString source) const
QStringList LoadSource::sources() const QStringList LoadSource::sources() const
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
for (int i = 0; i < 1000; i++) for (int i = 0; i < 1000; i++)
sources.append(QString("load/load%1").arg(i)); sources.append(QString("load/load%1").arg(i));

View File

@ -27,19 +27,18 @@ NetworkSource::NetworkSource(QObject *parent, const QStringList args)
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 0); Q_ASSERT(args.count() == 0);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
NetworkSource::~NetworkSource() NetworkSource::~NetworkSource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
QVariant NetworkSource::data(QString source) QVariant NetworkSource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
if (source == QString("network/current/name")) { if (source == QString("network/current/name")) {
@ -66,7 +65,6 @@ QVariant NetworkSource::data(QString source)
QVariantMap NetworkSource::initialData(QString source) const QVariantMap NetworkSource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
QVariantMap data; QVariantMap data;
@ -84,8 +82,6 @@ QVariantMap NetworkSource::initialData(QString source) const
QStringList NetworkSource::sources() const QStringList NetworkSource::sources() const
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
sources.append(QString("network/current/name")); sources.append(QString("network/current/name"));

View File

@ -33,7 +33,7 @@ PlayerSource::PlayerSource(QObject *parent, const QStringList args)
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 5); Q_ASSERT(args.count() == 5);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
m_player = args.at(0); m_player = args.at(0);
m_mpdAddress = QString("%1:%2").arg(args.at(1)).arg(args.at(2)); m_mpdAddress = QString("%1:%2").arg(args.at(1)).arg(args.at(2));
@ -44,13 +44,12 @@ PlayerSource::PlayerSource(QObject *parent, const QStringList args)
PlayerSource::~PlayerSource() PlayerSource::~PlayerSource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
QVariant PlayerSource::data(QString source) QVariant PlayerSource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
if (source == QString("player/title")) if (source == QString("player/title"))
@ -61,7 +60,6 @@ QVariant PlayerSource::data(QString source)
QVariantMap PlayerSource::initialData(QString source) const QVariantMap PlayerSource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
QVariantMap data; QVariantMap data;
@ -148,8 +146,6 @@ QVariantMap PlayerSource::initialData(QString source) const
void PlayerSource::run() void PlayerSource::run()
{ {
qCDebug(LOG_ESM);
// initial data // initial data
if (m_player == QString("mpd")) { if (m_player == QString("mpd")) {
// mpd // mpd
@ -187,8 +183,6 @@ void PlayerSource::run()
QStringList PlayerSource::sources() const QStringList PlayerSource::sources() const
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
sources.append(QString("player/album")); sources.append(QString("player/album"));
sources.append(QString("player/dalbum")); sources.append(QString("player/dalbum"));
@ -221,8 +215,6 @@ QVariantHash PlayerSource::defaultInfo() const
QString PlayerSource::getAutoMpris() const QString PlayerSource::getAutoMpris() const
{ {
qCDebug(LOG_ESM);
QDBusMessage listServices = QDBusConnection::sessionBus().interface()->call( QDBusMessage listServices = QDBusConnection::sessionBus().interface()->call(
QDBus::BlockWithGui, QString("ListNames")); QDBus::BlockWithGui, QString("ListNames"));
if (listServices.arguments().isEmpty()) if (listServices.arguments().isEmpty())
@ -244,7 +236,6 @@ QString PlayerSource::getAutoMpris() const
QVariantHash PlayerSource::getPlayerMpdInfo(const QString mpdAddress) const QVariantHash PlayerSource::getPlayerMpdInfo(const QString mpdAddress) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "MPD" << mpdAddress; qCDebug(LOG_ESM) << "MPD" << mpdAddress;
QVariantHash info = defaultInfo(); QVariantHash info = defaultInfo();
@ -286,7 +277,6 @@ QVariantHash PlayerSource::getPlayerMpdInfo(const QString mpdAddress) const
QVariantHash PlayerSource::getPlayerMprisInfo(const QString mpris) const QVariantHash PlayerSource::getPlayerMprisInfo(const QString mpris) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "MPRIS" << mpris; qCDebug(LOG_ESM) << "MPRIS" << mpris;
QVariantHash info = defaultInfo(); QVariantHash info = defaultInfo();
@ -356,7 +346,6 @@ QVariantHash PlayerSource::getPlayerMprisInfo(const QString mpris) const
QString PlayerSource::buildString(const QString current, const QString value, QString PlayerSource::buildString(const QString current, const QString value,
const int s) const const int s) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Current value" << current; qCDebug(LOG_ESM) << "Current value" << current;
qCDebug(LOG_ESM) << "New value" << value; qCDebug(LOG_ESM) << "New value" << value;
qCDebug(LOG_ESM) << "Strip after" << s; qCDebug(LOG_ESM) << "Strip after" << s;
@ -372,7 +361,6 @@ QString PlayerSource::buildString(const QString current, const QString value,
QString PlayerSource::stripString(const QString value, const int s) const QString PlayerSource::stripString(const QString value, const int s) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "New value" << value; qCDebug(LOG_ESM) << "New value" << value;
qCDebug(LOG_ESM) << "Strip after" << s; qCDebug(LOG_ESM) << "Strip after" << s;

View File

@ -27,19 +27,18 @@ ProcessesSource::ProcessesSource(QObject *parent, const QStringList args)
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 0); Q_ASSERT(args.count() == 0);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
ProcessesSource::~ProcessesSource() ProcessesSource::~ProcessesSource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
QVariant ProcessesSource::data(QString source) QVariant ProcessesSource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
if (source == QString("ps/running/count")) if (source == QString("ps/running/count"))
@ -50,7 +49,6 @@ QVariant ProcessesSource::data(QString source)
QVariantMap ProcessesSource::initialData(QString source) const QVariantMap ProcessesSource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
QVariantMap data; QVariantMap data;
@ -80,8 +78,6 @@ QVariantMap ProcessesSource::initialData(QString source) const
void ProcessesSource::run() void ProcessesSource::run()
{ {
qCDebug(LOG_ESM);
QStringList allDirectories QStringList allDirectories
= QDir(QString("/proc")) = QDir(QString("/proc"))
.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name); .entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
@ -109,8 +105,6 @@ void ProcessesSource::run()
QStringList ProcessesSource::sources() const QStringList ProcessesSource::sources() const
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
sources.append(QString("ps/running/count")); sources.append(QString("ps/running/count"));
sources.append(QString("ps/running/list")); sources.append(QString("ps/running/list"));

View File

@ -26,7 +26,7 @@ QuotesSource::QuotesSource(QObject *parent, const QStringList args)
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 0); Q_ASSERT(args.count() == 0);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
extQuotes = new ExtItemAggregator<ExtQuotes>(nullptr, QString("quotes")); extQuotes = new ExtItemAggregator<ExtQuotes>(nullptr, QString("quotes"));
m_sources = getSources(); m_sources = getSources();
@ -35,7 +35,7 @@ QuotesSource::QuotesSource(QObject *parent, const QStringList args)
QuotesSource::~QuotesSource() QuotesSource::~QuotesSource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
delete extQuotes; delete extQuotes;
} }
@ -43,7 +43,6 @@ QuotesSource::~QuotesSource()
QVariant QuotesSource::data(QString source) QVariant QuotesSource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
if (source.startsWith(QString("quotes/percpricechg"))) { if (source.startsWith(QString("quotes/percpricechg"))) {
@ -58,7 +57,6 @@ QVariant QuotesSource::data(QString source)
QVariantMap QuotesSource::initialData(QString source) const QVariantMap QuotesSource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
int ind = index(source); int ind = index(source);
@ -143,16 +141,12 @@ QVariantMap QuotesSource::initialData(QString source) const
QStringList QuotesSource::sources() const QStringList QuotesSource::sources() const
{ {
qCDebug(LOG_ESM);
return m_sources; return m_sources;
} }
QStringList QuotesSource::getSources() QStringList QuotesSource::getSources()
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
foreach (ExtQuotes *item, extQuotes->activeItems()) { foreach (ExtQuotes *item, extQuotes->activeItems()) {
sources.append(QString("quotes/%1").arg(item->tag(QString("ask")))); sources.append(QString("quotes/%1").arg(item->tag(QString("ask"))));

View File

@ -25,19 +25,18 @@ UpdateSource::UpdateSource(QObject *parent, const QStringList args)
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 0); Q_ASSERT(args.count() == 0);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
UpdateSource::~UpdateSource() UpdateSource::~UpdateSource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
} }
QVariant UpdateSource::data(QString source) QVariant UpdateSource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
return true; return true;
@ -46,7 +45,6 @@ QVariant UpdateSource::data(QString source)
QVariantMap UpdateSource::initialData(QString source) const QVariantMap UpdateSource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
QVariantMap data; QVariantMap data;
@ -64,8 +62,6 @@ QVariantMap UpdateSource::initialData(QString source) const
QStringList UpdateSource::sources() const QStringList UpdateSource::sources() const
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
sources.append(QString("update")); sources.append(QString("update"));

View File

@ -26,7 +26,7 @@ UpgradeSource::UpgradeSource(QObject *parent, const QStringList args)
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 0); Q_ASSERT(args.count() == 0);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
extUpgrade = new ExtItemAggregator<ExtUpgrade>(nullptr, QString("upgrade")); extUpgrade = new ExtItemAggregator<ExtUpgrade>(nullptr, QString("upgrade"));
m_sources = getSources(); m_sources = getSources();
@ -35,7 +35,7 @@ UpgradeSource::UpgradeSource(QObject *parent, const QStringList args)
UpgradeSource::~UpgradeSource() UpgradeSource::~UpgradeSource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
delete extUpgrade; delete extUpgrade;
} }
@ -43,7 +43,6 @@ UpgradeSource::~UpgradeSource()
QVariant UpgradeSource::data(QString source) QVariant UpgradeSource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
// there are only one value // there are only one value
@ -53,7 +52,6 @@ QVariant UpgradeSource::data(QString source)
QVariantMap UpgradeSource::initialData(QString source) const QVariantMap UpgradeSource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
QVariantMap data; QVariantMap data;
@ -71,16 +69,12 @@ QVariantMap UpgradeSource::initialData(QString source) const
QStringList UpgradeSource::sources() const QStringList UpgradeSource::sources() const
{ {
qCDebug(LOG_ESM);
return m_sources; return m_sources;
} }
QStringList UpgradeSource::getSources() QStringList UpgradeSource::getSources()
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
foreach (ExtUpgrade *item, extUpgrade->activeItems()) foreach (ExtUpgrade *item, extUpgrade->activeItems())
sources.append( sources.append(

View File

@ -26,7 +26,7 @@ WeatherSource::WeatherSource(QObject *parent, const QStringList args)
: AbstractExtSysMonSource(parent, args) : AbstractExtSysMonSource(parent, args)
{ {
Q_ASSERT(args.count() == 0); Q_ASSERT(args.count() == 0);
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
extWeather = new ExtItemAggregator<ExtWeather>(nullptr, QString("weather")); extWeather = new ExtItemAggregator<ExtWeather>(nullptr, QString("weather"));
m_sources = getSources(); m_sources = getSources();
@ -35,7 +35,7 @@ WeatherSource::WeatherSource(QObject *parent, const QStringList args)
WeatherSource::~WeatherSource() WeatherSource::~WeatherSource()
{ {
qCDebug(LOG_ESM); qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
delete extWeather; delete extWeather;
} }
@ -43,7 +43,6 @@ WeatherSource::~WeatherSource()
QVariant WeatherSource::data(QString source) QVariant WeatherSource::data(QString source)
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
if (source.startsWith(QString("weather/weatherId"))) { if (source.startsWith(QString("weather/weatherId"))) {
@ -58,7 +57,6 @@ QVariant WeatherSource::data(QString source)
QVariantMap WeatherSource::initialData(QString source) const QVariantMap WeatherSource::initialData(QString source) const
{ {
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source; qCDebug(LOG_ESM) << "Source" << source;
int ind = index(source); int ind = index(source);
@ -111,16 +109,12 @@ QVariantMap WeatherSource::initialData(QString source) const
QStringList WeatherSource::sources() const QStringList WeatherSource::sources() const
{ {
qCDebug(LOG_ESM);
return m_sources; return m_sources;
} }
QStringList WeatherSource::getSources() QStringList WeatherSource::getSources()
{ {
qCDebug(LOG_ESM);
QStringList sources; QStringList sources;
foreach (ExtWeather *item, extWeather->activeItems()) { foreach (ExtWeather *item, extWeather->activeItems()) {
sources.append( sources.append(

View File

@ -1,6 +1,7 @@
#ifndef VERSION_H #ifndef VERSION_H
#define VERSION_H #define VERSION_H
// information // information
#define NAME "Awesome Widgets" #define NAME "Awesome Widgets"
#define VERSION "@PROJECT_VERSION@" #define VERSION "@PROJECT_VERSION@"
@ -43,13 +44,24 @@
// cmake properties // cmake properties
#define CMAKE_BUILD_TYPE "@CMAKE_BUILD_TYPE@" #define CMAKE_BUILD_TYPE "@CMAKE_BUILD_TYPE@"
#define CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@"
#define CMAKE_CXX_FLAGS "@CMAKE_CXX_FLAGS@"
#define CMAKE_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@"
#define CMAKE_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@"
#define CMAKE_CXX_FLAGS_OPTIMIZATION "@CMAKE_CXX_FLAGS_OPTIMIZATION@"
#define CMAKE_DEFINITIONS "@CMAKE_DEFINITIONS@"
#define CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" #define CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
#define CMAKE_MODULE_LINKER_FLAGS "@CMAKE_MODULE_LINKER_FLAGS@"
#define CMAKE_SHARED_LINKER_FLAGS "@CMAKE_SHARED_LINKER_FLAGS@"
// components // components
#define BUILD_PLASMOIDS "@BUILD_PLASMOIDS@" #define BUILD_PLASMOIDS "@BUILD_PLASMOIDS@"
#define BUILD_DEB_PACKAGE "@BUILD_DEB_PACKAGE@" #define BUILD_DEB_PACKAGE "@BUILD_DEB_PACKAGE@"
#define BUILD_RPM_PACKAGE "@BUILD_RPM_PACKAGE@" #define BUILD_RPM_PACKAGE "@BUILD_RPM_PACKAGE@"
#define CLANGFORMAT_EXECUTABLE "@CLANGFORMAT_EXECUTABLE@"
#define CPPCHECK_EXECUTABLE "@CPPCHECK_EXECUTABLE@"
// additional functions // additional functions
#define PROP_FUTURE "@BUILD_FUTURE@" #define PROP_FUTURE "@BUILD_FUTURE@"
#define PROP_TEST "@BUILD_TESTING@" #define PROP_TEST "@BUILD_TESTING@"
#endif /* VERSION_H */ #endif /* VERSION_H */