diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dd54838..cebc934 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,15 +2,18 @@ Code 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. * 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. * If some method is called only once, it is recommended to use lambda functions. Exception is `Q_INVOKABLE` methods. -* STL containers are not recommended, use Qt one instead. -* In other hand Qt specific variables (`qint`, `qfloat`, etc) are not recommended. +* STL containers are not recommended, use Qt ones instead. +* 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)). * Headers declaration: * 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. * It is highly recommended to avoid implicit casts. -* Abstract classes (which has at least one pure virtual method) are allowed. -* Templates are allowed and recommended. Templates usually should be desribed +* Abstract classes (which have at least one pure virtual method) are allowed. +* Templates are allowed and recommended. Templates usually should be described inside header not source code file. * Hardcode is not recommended. But it is possible to use cmake variables to 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. * Do not hesitate move public methods to private one if possible. * Do not hesitate use `const` modifier. In other hand `volatile` modifier is not recommended. * New lines rules: * 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 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). * Two lines between methods inside source code (`*.cpp`). * 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 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 ----------- @@ -137,9 +140,9 @@ Logging For logging please use [QLoggingCategory](http://doc.qt.io/qt-5/qloggingcategory.html). 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. * **warning** (`qCWarning()`) - not critical information, which may be caused by mistakes in configuration for example. @@ -148,6 +151,10 @@ level should be used: * **critical** (`qCCritical()`) - a critical error. After this error program will 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 ------- @@ -157,8 +164,7 @@ Testing * Test builds should be: 1. `-DCMAKE_BUILD_TYPE=Debug`. 2. `-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON`. - 3. `-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON`. - 4. `-DCMAKE_BUILD_TYPE=Release`. + 3. `-DCMAKE_BUILD_TYPE=Release`. * It is recommended to create addition test if possible. * Addition test functions should be declated and used only inside `BUILD_TESTING` definition. @@ -192,10 +198,10 @@ Tools ``` FooClass::FooClass(QObject *parent, const QVariant var) - : QObject(parent), - m_var(var) + : QObject(parent) + , m_var(var) { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; // some code below if any } ``` diff --git a/sources/CMakeLists.txt b/sources/CMakeLists.txt index 4c82d12..64b372a 100644 --- a/sources/CMakeLists.txt +++ b/sources/CMakeLists.txt @@ -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_TESTING "Build with additional test abilities" OFF) # 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(CPPCHECK_EXECUTABLE "/usr/bin/cppcheck" CACHE STRING "Path to cppcheck executable") # flags if (CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "-Wall -Wno-cpp -std=c++11") set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") 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 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_DEBUG "-g -O0") set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") - set(CMAKE_CXX_FLAGS_OPTIMIZATION "-O3 -DNDEBUG") + set(CMAKE_CXX_FLAGS_OPTIMIZATION "-Ofast -DNDEBUG") # linker flags set(CMAKE_EXE_LINKER_FLAGS "-lc++abi") set(CMAKE_MODULE_LINKER_FLAGS "-lc++abi") set(CMAKE_SHARED_LINKER_FLAGS "-lc++abi") -else() +else () message(FATAL_ERROR "Unknown compiler") endif () if (CMAKE_BUILD_TYPE MATCHES Debug) set(CMAKE_VERBOSE_MAKEFILE ON) 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_LIBRARY awesomewidgets) include(libraries.cmake) include(clang-format.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(extsysmon) if (BUILD_PLASMOIDS) diff --git a/sources/awdebug.cpp b/sources/awdebug.cpp index ece4089..eee61e1 100644 --- a/sources/awdebug.cpp +++ b/sources/awdebug.cpp @@ -17,6 +17,7 @@ #include "awdebug.h" +#include "version.h" 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_LIB, "org.kde.plasma.awesomewidgets", 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; +} diff --git a/sources/awdebug.h b/sources/awdebug.h index 8587f2d..8b37523 100644 --- a/sources/awdebug.h +++ b/sources/awdebug.h @@ -23,8 +23,7 @@ #ifndef LOG_FORMAT #define LOG_FORMAT \ - "[%{time " \ - "yyyy-MM-ddTHH:mm:ss.zzz}][%{if-debug}DD%{endif}%{if-info}II%{endif}%{if-" \ + "[%{time process}][%{if-debug}DD%{endif}%{if-info}II%{endif}%{if-" \ "warning}WW%{endif}%{if-critical}CC%{endif}%{if-fatal}FF%{endif}][%{" \ "category}][%{function}] %{message}" #endif /* LOG_FORMAT */ @@ -45,5 +44,7 @@ Q_DECLARE_LOGGING_CATEGORY(LOG_DP) Q_DECLARE_LOGGING_CATEGORY(LOG_ESM) Q_DECLARE_LOGGING_CATEGORY(LOG_LIB) +const QStringList getBuildData(); + #endif /* AWDEBUG_H */ diff --git a/sources/awesome-widget/plugin/awactions.cpp b/sources/awesome-widget/plugin/awactions.cpp index 83765c7..6a181c5 100644 --- a/sources/awesome-widget/plugin/awactions.cpp +++ b/sources/awesome-widget/plugin/awactions.cpp @@ -40,19 +40,18 @@ AWActions::AWActions(QObject *parent) : QObject(parent) { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; } AWActions::~AWActions() { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; } void AWActions::checkUpdates(const bool showAnyway) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Show anyway" << showAnyway; // showAnyway options requires to show message if no updates found on direct @@ -70,15 +69,12 @@ void AWActions::checkUpdates(const bool showAnyway) // HACK: since QML could not use QLoggingCategory I need this hack bool AWActions::isDebugEnabled() const { - qCDebug(LOG_AW); - return LOG_AW().isDebugEnabled(); } bool AWActions::runCmd(const QString cmd) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Cmd" << cmd; sendNotification(QString("Info"), i18n("Run %1", cmd)); @@ -90,8 +86,6 @@ bool AWActions::runCmd(const QString cmd) const // HACK: this method uses variable from version.h void AWActions::showReadme() const { - qCDebug(LOG_AW); - QDesktopServices::openUrl(QString(HOMEPAGE)); } @@ -99,7 +93,6 @@ void AWActions::showReadme() const // HACK: this method uses variables from version.h QString AWActions::getAboutText(const QString type) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Type" << type; QString text; @@ -159,7 +152,6 @@ QString AWActions::getAboutText(const QString type) const QVariantMap AWActions::getFont(const QVariantMap defaultFont) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Default font is" << defaultFont; QVariantMap fontMap; @@ -179,7 +171,6 @@ QVariantMap AWActions::getFont(const QVariantMap defaultFont) const // to avoid additional object definition this method is static void AWActions::sendNotification(const QString eventId, const QString message) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Event" << eventId; qCDebug(LOG_AW) << "Message" << message; @@ -192,7 +183,6 @@ void AWActions::sendNotification(const QString eventId, const QString message) void AWActions::showInfo(const QString version) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Version" << version; QString text = i18n("You are using the actual version %1", version); @@ -204,7 +194,6 @@ void AWActions::showInfo(const QString version) const void AWActions::showUpdates(const QString version) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Version" << version; QString text; @@ -232,7 +221,6 @@ void AWActions::showUpdates(const QString version) const void AWActions::versionReplyRecieved(QNetworkReply *reply, const bool showAnyway) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Return code" << reply->error(); qCDebug(LOG_AW) << "Reply error message" << reply->errorString(); qCDebug(LOG_AW) << "Show anyway" << showAnyway; diff --git a/sources/awesome-widget/plugin/awconfighelper.cpp b/sources/awesome-widget/plugin/awconfighelper.cpp index 1d1eac5..5f61d2a 100644 --- a/sources/awesome-widget/plugin/awconfighelper.cpp +++ b/sources/awesome-widget/plugin/awconfighelper.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -34,20 +35,18 @@ AWConfigHelper::AWConfigHelper(QObject *parent) : QObject(parent) { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; } AWConfigHelper::~AWConfigHelper() { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; } bool AWConfigHelper::dropCache() const { - qCDebug(LOG_AW); - QString fileName = QString("%1/awesomewidgets.ndx") .arg(QStandardPaths::writableLocation( QStandardPaths::GenericCacheLocation)); @@ -58,8 +57,6 @@ bool AWConfigHelper::dropCache() const void AWConfigHelper::exportConfiguration(QObject *nativeConfig) const { - qCDebug(LOG_AW); - // get file path and init settings object QString fileName = QFileDialog::getSaveFileName(nullptr, i18n("Export")); if (fileName.isEmpty()) @@ -105,13 +102,23 @@ void AWConfigHelper::exportConfiguration(QObject *nativeConfig) const // sync settings settings.sync(); + // show additional message + switch (settings.status()) { + case QSettings::NoError: + QMessageBox::information( + nullptr, i18n("Success"), + i18n("Please note that binary files were not copied")); + break; + default: + QMessageBox::critical(nullptr, i18n("Ooops..."), + i18n("Could not save configuration file")); + break; + } } QVariantMap AWConfigHelper::importConfiguration() const { - qCDebug(LOG_AW); - QVariantMap configuration; // get file path and init settings object QString fileName = QFileDialog::getOpenFileName(nullptr, i18n("Import")); @@ -159,8 +166,6 @@ QVariantMap AWConfigHelper::importConfiguration() const QVariantMap AWConfigHelper::readDataEngineConfiguration() const { - qCDebug(LOG_AW); - QString fileName = QStandardPaths::locate(QStandardPaths::ConfigLocation, QString("plasma-dataengine-extsysmon.conf")); @@ -198,7 +203,7 @@ QVariantMap AWConfigHelper::readDataEngineConfiguration() const void AWConfigHelper::writeDataEngineConfiguration( const QVariantMap configuration) const { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << "Configuration" << configuration; QString fileName = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) @@ -229,7 +234,6 @@ void AWConfigHelper::copyExtensions(const QString item, const QString type, QSettings &settings, const bool inverse) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Extension" << item; qCDebug(LOG_AW) << "Type" << type; qCDebug(LOG_AW) << "Inverse" << inverse; @@ -253,8 +257,6 @@ void AWConfigHelper::copyExtensions(const QString item, const QString type, void AWConfigHelper::copySettings(QSettings &from, QSettings &to) const { - qCDebug(LOG_AW); - foreach (QString key, from.childKeys()) to.setValue(key, from.value(key)); } @@ -263,7 +265,6 @@ void AWConfigHelper::copySettings(QSettings &from, QSettings &to) const void AWConfigHelper::readFile(QSettings &settings, const QString key, const QString fileName) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Key" << key; qCDebug(LOG_AW) << "File" << fileName; @@ -280,8 +281,6 @@ void AWConfigHelper::readFile(QSettings &settings, const QString key, QHash AWConfigHelper::selectImport() const { - qCDebug(LOG_AW); - QDialog *dialog = new QDialog(nullptr); QCheckBox *importPlasmoidSettings = new QCheckBox(i18n("Import plasmoid settings"), dialog); @@ -308,7 +307,7 @@ QHash AWConfigHelper::selectImport() const import[QString("plasmoid")] = false; import[QString("extensions")] = false; import[QString("adds")] = false; - switch (int ret = dialog->exec()) { + switch (dialog->exec()) { case QDialog::Accepted: import[QString("plasmoid")] = importPlasmoidSettings->isChecked(); import[QString("extensions")] = importExtensionsSettings->isChecked(); @@ -327,7 +326,6 @@ QHash AWConfigHelper::selectImport() const void AWConfigHelper::writeFile(QSettings &settings, const QString key, const QString fileName) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Key" << key; qCDebug(LOG_AW) << "File" << fileName; diff --git a/sources/awesome-widget/plugin/awdataaggregator.cpp b/sources/awesome-widget/plugin/awdataaggregator.cpp index 4435322..0464d8e 100644 --- a/sources/awesome-widget/plugin/awdataaggregator.cpp +++ b/sources/awesome-widget/plugin/awdataaggregator.cpp @@ -34,7 +34,7 @@ AWDataAggregator::AWDataAggregator(QObject *parent) : QObject(parent) { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; // required by signals qRegisterMetaType>("QHash"); @@ -46,7 +46,7 @@ AWDataAggregator::AWDataAggregator(QObject *parent) AWDataAggregator::~AWDataAggregator() { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; delete toolTipScene; } @@ -54,7 +54,6 @@ AWDataAggregator::~AWDataAggregator() QList AWDataAggregator::getData(const QString key) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Key" << key; return data[QString("%1Tooltip").arg(key)]; @@ -63,8 +62,6 @@ QList AWDataAggregator::getData(const QString key) const QString AWDataAggregator::htmlImage(const QPixmap &source) const { - qCDebug(LOG_AW); - QByteArray byteArray; QBuffer buffer(&byteArray); source.save(&buffer, "PNG"); @@ -78,7 +75,6 @@ QString AWDataAggregator::htmlImage(const QPixmap &source) const void AWDataAggregator::setParameters(QVariantMap settings) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Settings" << settings; // cast from QVariantMap to QVariantHash without data lost @@ -131,8 +127,6 @@ void AWDataAggregator::setParameters(QVariantMap settings) QPixmap AWDataAggregator::tooltipImage() { - qCDebug(LOG_AW); - // create image toolTipScene->clear(); QPen pen; @@ -176,8 +170,7 @@ QPixmap AWDataAggregator::tooltipImage() void AWDataAggregator::dataUpdate(const QHash &values) { - qCDebug(LOG_AW); - + // do not log these arguments setData(values); emit(toolTipPainted(htmlImage(tooltipImage()))); } @@ -186,7 +179,6 @@ void AWDataAggregator::dataUpdate(const QHash &values) void AWDataAggregator::checkValue(const QString source, const float value, const float extremum) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Notification source" << source; qCDebug(LOG_AW) << "Value" << value; qCDebug(LOG_AW) << "Called with extremum" << extremum; @@ -208,7 +200,6 @@ void AWDataAggregator::checkValue(const QString source, const float value, void AWDataAggregator::checkValue(const QString source, const QString current, const QString received) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Notification source" << source; qCDebug(LOG_AW) << "Current value" << current; qCDebug(LOG_AW) << "Received value" << received; @@ -221,8 +212,6 @@ void AWDataAggregator::checkValue(const QString source, const QString current, void AWDataAggregator::initScene() { - qCDebug(LOG_AW); - toolTipScene = new QGraphicsScene(nullptr); toolTipView = new QGraphicsView(toolTipScene); toolTipView->setStyleSheet(QString("background: transparent")); @@ -236,7 +225,6 @@ void AWDataAggregator::initScene() QString AWDataAggregator::notificationText(const QString source, const float value) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Notification source" << source; qCDebug(LOG_AW) << "Value" << value; @@ -259,7 +247,6 @@ QString AWDataAggregator::notificationText(const QString source, QString AWDataAggregator::notificationText(const QString source, const QString value) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Notification source" << source; qCDebug(LOG_AW) << "Value" << value; @@ -273,8 +260,7 @@ QString AWDataAggregator::notificationText(const QString source, void AWDataAggregator::setData(const QHash &values) { - qCDebug(LOG_AW); - + // do not log these arguments // battery update requires info is AC online or not setData(values[QString("ac")] == configuration[QString("acOnline")], QString("batTooltip"), values[QString("bat")].toFloat()); @@ -301,7 +287,6 @@ void AWDataAggregator::setData(const QHash &values) void AWDataAggregator::setData(const QString &source, float value, const float extremum) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Source" << source; qCDebug(LOG_AW) << "Value" << value; qCDebug(LOG_AW) << "Called with extremum" << extremum; @@ -331,8 +316,9 @@ void AWDataAggregator::setData(const QString &source, float value, void AWDataAggregator::setData(const bool dontInvert, const QString &source, float value) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Do not invert value" << dontInvert; + qCDebug(LOG_AW) << "Source" << source; + qCDebug(LOG_AW) << "Value" << value; // invert values for different battery colours value = dontInvert ? value : -value; diff --git a/sources/awesome-widget/plugin/awdataengineaggregator.cpp b/sources/awesome-widget/plugin/awdataengineaggregator.cpp index 14f8789..eeb7e44 100644 --- a/sources/awesome-widget/plugin/awdataengineaggregator.cpp +++ b/sources/awesome-widget/plugin/awdataengineaggregator.cpp @@ -27,7 +27,7 @@ AWDataEngineAggregator::AWDataEngineAggregator(QObject *parent, const int interval) : QObject(parent) { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; setInterval(interval); initDataEngines(); @@ -36,7 +36,7 @@ AWDataEngineAggregator::AWDataEngineAggregator(QObject *parent, AWDataEngineAggregator::~AWDataEngineAggregator() { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; // disconnect sources first disconnectSources(); @@ -46,8 +46,6 @@ AWDataEngineAggregator::~AWDataEngineAggregator() void AWDataEngineAggregator::disconnectSources() { - qCDebug(LOG_AW); - foreach (QString dataengine, m_dataEngines.keys()) foreach (QString source, m_dataEngines[dataengine]->sources()) m_dataEngines[dataengine]->disconnectSource(source, parent()); @@ -56,7 +54,6 @@ void AWDataEngineAggregator::disconnectSources() void AWDataEngineAggregator::setInterval(const int _interval) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Interval" << _interval; m_interval = _interval; @@ -65,7 +62,6 @@ void AWDataEngineAggregator::setInterval(const int _interval) void AWDataEngineAggregator::dropSource(const QString source) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Source" << source; // FIXME there is no possibility to check to which dataengine source @@ -77,8 +73,6 @@ void AWDataEngineAggregator::dropSource(const QString source) void AWDataEngineAggregator::reconnectSources() { - qCDebug(LOG_AW); - m_dataEngines[QString("systemmonitor")]->connectAllSources(parent(), m_interval); m_dataEngines[QString("extsysmon")]->connectAllSources(parent(), @@ -90,8 +84,6 @@ void AWDataEngineAggregator::reconnectSources() void AWDataEngineAggregator::initDataEngines() { - qCDebug(LOG_AW); - Plasma::DataEngineConsumer *deConsumer = new Plasma::DataEngineConsumer(); m_dataEngines[QString("systemmonitor")] = deConsumer->dataEngine(QString("systemmonitor")); diff --git a/sources/awesome-widget/plugin/awdataengineaggregator.h b/sources/awesome-widget/plugin/awdataengineaggregator.h index 7fedd21..5a86ab6 100644 --- a/sources/awesome-widget/plugin/awdataengineaggregator.h +++ b/sources/awesome-widget/plugin/awdataengineaggregator.h @@ -20,6 +20,7 @@ #define AWDATAENGINEAGGREGATOR_H #include + #include diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp index 76516ee..826defc 100644 --- a/sources/awesome-widget/plugin/awkeys.cpp +++ b/sources/awesome-widget/plugin/awkeys.cpp @@ -42,10 +42,10 @@ AWKeys::AWKeys(QObject *parent) : QObject(parent) { - qCDebug(LOG_AW); - - // logging qSetMessagePattern(LOG_FORMAT); + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; + foreach (const QString metadata, getBuildData()) + qCDebug(LOG_AW) << metadata; #ifdef BUILD_FUTURE // thread pool @@ -63,7 +63,7 @@ AWKeys::AWKeys(QObject *parent) AWKeys::~AWKeys() { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; // extensions if (graphicalItems != nullptr) @@ -89,7 +89,6 @@ AWKeys::~AWKeys() void AWKeys::initDataAggregator(const QVariantMap tooltipParams) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Tooltip parameters" << tooltipParams; dataAggregator->setParameters(tooltipParams); @@ -99,7 +98,6 @@ void AWKeys::initDataAggregator(const QVariantMap tooltipParams) void AWKeys::initKeys(const QString currentPattern, const int interval, const int limit) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Pattern" << currentPattern; qCDebug(LOG_AW) << "Interval" << interval; qCDebug(LOG_AW) << "Queue limit" << limit; @@ -124,7 +122,8 @@ void AWKeys::initKeys(const QString currentPattern, const int interval, void AWKeys::setAggregatorProperty(const QString key, const QVariant value) { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << "Key" << key; + qCDebug(LOG_AW) << "Value" << value; aggregator->setProperty(key.toUtf8().constData(), value); } @@ -132,7 +131,6 @@ void AWKeys::setAggregatorProperty(const QString key, const QVariant value) void AWKeys::setWrapNewLines(const bool wrap) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Is wrapping enabled" << wrap; m_wrapNewLines = wrap; @@ -141,8 +139,6 @@ void AWKeys::setWrapNewLines(const bool wrap) void AWKeys::updateCache() { - qCDebug(LOG_AW); - // update network and hdd list addKeyToCache(QString("hdd")); addKeyToCache(QString("net")); @@ -151,7 +147,6 @@ void AWKeys::updateCache() QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Should be sorted" << sorted; qCDebug(LOG_AW) << "Filter" << regexp; @@ -320,8 +315,6 @@ QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const QStringList AWKeys::getHddDevices() const { - qCDebug(LOG_AW); - QStringList devices = m_devices[QString("hdd")]; // required by selector in the UI devices.insert(0, QString("disable")); @@ -333,7 +326,6 @@ QStringList AWKeys::getHddDevices() const QString AWKeys::infoByKey(QString key) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Requested key" << key; key.remove(QRegExp(QString("^bar[0-9]{1,}"))); @@ -387,7 +379,6 @@ QString AWKeys::infoByKey(QString key) const // HACK this method requires to define tag value from bar from UI interface QString AWKeys::valueByKey(QString key) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Requested key" << key; return values.value(key.remove(QRegExp(QString("^bar[0-9]{1,}"))), @@ -397,7 +388,6 @@ QString AWKeys::valueByKey(QString key) const void AWKeys::editItem(const QString type) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Item type" << type; if (type == QString("graphicalitem")) { @@ -418,7 +408,6 @@ void AWKeys::editItem(const QString type) void AWKeys::addDevice(const QString source) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Source" << source; QRegExp diskRegexp @@ -442,12 +431,11 @@ void AWKeys::addDevice(const QString source) void AWKeys::dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data) { - qCDebug(LOG_AW); - qCDebug(LOG_AW) << "Source" << sourceName; - qCDebug(LOG_AW) << "Data" << data; - - if (sourceName == QString("update")) + // do not log these parameters + if (sourceName == QString("update")) { + qCInfo(LOG_AW) << "Update data"; return emit(needToBeUpdated()); + } #ifdef BUILD_FUTURE // run concurrent data update @@ -461,8 +449,6 @@ void AWKeys::dataUpdated(const QString &sourceName, void AWKeys::loadKeysFromCache() { - qCDebug(LOG_AW); - QString fileName = QString("%1/awesomewidgets.ndx") .arg(QStandardPaths::writableLocation( QStandardPaths::GenericCacheLocation)); @@ -483,8 +469,6 @@ void AWKeys::loadKeysFromCache() void AWKeys::reinitKeys() { - qCDebug(LOG_AW); - // renew extensions // delete them if any if (graphicalItems != nullptr) @@ -579,8 +563,6 @@ void AWKeys::reinitKeys() void AWKeys::updateTextData() { - qCDebug(LOG_AW); - calculateValues(); emit(needTextToBeUpdated(parsePattern(m_pattern))); emit(dataAggregator->updateData(values)); @@ -589,7 +571,6 @@ void AWKeys::updateTextData() void AWKeys::addKeyToCache(const QString type, const QString key) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Key type" << type; qCDebug(LOG_AW) << "Key" << key; @@ -648,8 +629,6 @@ void AWKeys::addKeyToCache(const QString type, const QString key) // specified pattern. Usually they are values which depend on several others void AWKeys::calculateValues() { - qCDebug(LOG_AW); - // hddtot* foreach (QString device, m_devices[QString("mount")]) { int index = m_devices[QString("mount")].indexOf(device); @@ -726,8 +705,6 @@ void AWKeys::calculateValues() QString AWKeys::parsePattern(QString pattern) const { - qCDebug(LOG_AW); - // screen sign pattern.replace(QString("$$"), QString("$\\$\\")); @@ -770,7 +747,6 @@ QString AWKeys::parsePattern(QString pattern) const void AWKeys::setDataBySource(const QString &sourceName, const QVariantMap &data) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Source" << sourceName; qCDebug(LOG_AW) << "Data" << data; diff --git a/sources/awesome-widget/plugin/awkeys.h b/sources/awesome-widget/plugin/awkeys.h index a6e9ead..a8300f1 100644 --- a/sources/awesome-widget/plugin/awkeys.h +++ b/sources/awesome-widget/plugin/awkeys.h @@ -20,6 +20,7 @@ #define AWKEYS_H #include + #include #include diff --git a/sources/awesome-widget/plugin/awkeysaggregator.cpp b/sources/awesome-widget/plugin/awkeysaggregator.cpp index 9c169da..0ac20a1 100644 --- a/sources/awesome-widget/plugin/awkeysaggregator.cpp +++ b/sources/awesome-widget/plugin/awkeysaggregator.cpp @@ -29,20 +29,19 @@ AWKeysAggregator::AWKeysAggregator(QObject *parent) : QObject(parent) { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; } AWKeysAggregator::~AWKeysAggregator() { - qCDebug(LOG_AW); + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; } QString AWKeysAggregator::formater(const QVariant &data, const QString &key) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Data" << data; qCDebug(LOG_AW) << "Key" << key; @@ -150,7 +149,6 @@ QString AWKeysAggregator::formater(const QVariant &data, QStringList AWKeysAggregator::keysFromSource(const QString &source) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Search for source" << source; return m_map.values(source); @@ -159,7 +157,6 @@ QStringList AWKeysAggregator::keysFromSource(const QString &source) const void AWKeysAggregator::setAcOffline(const QString inactive) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Inactive AC string" << inactive; m_acOffline = inactive; @@ -168,7 +165,6 @@ void AWKeysAggregator::setAcOffline(const QString inactive) void AWKeysAggregator::setAcOnline(const QString active) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Active AC string" << active; m_acOnline = active; @@ -177,7 +173,6 @@ void AWKeysAggregator::setAcOnline(const QString active) void AWKeysAggregator::setCustomTime(const QString customTime) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Format" << customTime; m_customTime = customTime; @@ -186,7 +181,6 @@ void AWKeysAggregator::setCustomTime(const QString customTime) void AWKeysAggregator::setCustomUptime(const QString customUptime) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Format" << customUptime; m_customUptime = customUptime; @@ -195,7 +189,6 @@ void AWKeysAggregator::setCustomUptime(const QString customUptime) void AWKeysAggregator::setDevices(const QHash devices) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Devices" << devices; m_devices = devices; @@ -204,7 +197,6 @@ void AWKeysAggregator::setDevices(const QHash devices) void AWKeysAggregator::setTempUnits(const QString units) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Units" << units; m_tempUnits = units; @@ -213,7 +205,6 @@ void AWKeysAggregator::setTempUnits(const QString units) void AWKeysAggregator::setTranslate(const bool translate) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Translate" << translate; m_translate = translate; @@ -225,7 +216,6 @@ void AWKeysAggregator::setTranslate(const bool translate) QStringList AWKeysAggregator::registerSource(const QString &source, const QString &units) { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Source" << source; qCDebug(LOG_AW) << "Units" << units; @@ -528,7 +518,6 @@ QStringList AWKeysAggregator::registerSource(const QString &source, float AWKeysAggregator::temperature(const float temp) const { - qCDebug(LOG_AW); qCDebug(LOG_AW) << "Temperature value" << temp; float converted = temp; diff --git a/sources/awesomewidgets/abstractextitem.cpp b/sources/awesomewidgets/abstractextitem.cpp index d98320b..4249bc5 100644 --- a/sources/awesomewidgets/abstractextitem.cpp +++ b/sources/awesomewidgets/abstractextitem.cpp @@ -32,7 +32,7 @@ AbstractExtItem::AbstractExtItem(QWidget *parent, const QString desktopName, , m_fileName(desktopName) , m_dirs(directories) { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; qCDebug(LOG_LIB) << "Desktop name" << desktopName; qCDebug(LOG_LIB) << "Directories" << directories; @@ -42,14 +42,12 @@ AbstractExtItem::AbstractExtItem(QWidget *parent, const QString desktopName, AbstractExtItem::~AbstractExtItem() { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; } template T *AbstractExtItem::copy(const QString, const int) { - qCDebug(LOG_LIB); - // an analog of pure virtual method return new T(); } @@ -57,71 +55,54 @@ template T *AbstractExtItem::copy(const QString, const int) int AbstractExtItem::apiVersion() const { - qCDebug(LOG_LIB); - return m_apiVersion; } QString AbstractExtItem::comment() const { - qCDebug(LOG_LIB); - return m_comment; } QStringList AbstractExtItem::directories() const { - qCDebug(LOG_LIB); - return m_dirs; } QString AbstractExtItem::fileName() const { - qCDebug(LOG_LIB); - return m_fileName; } int AbstractExtItem::interval() const { - qCDebug(LOG_LIB); - return m_interval; } bool AbstractExtItem::isActive() const { - qCDebug(LOG_LIB); - return m_active; } QString AbstractExtItem::name() const { - qCDebug(LOG_LIB); - return m_name; } int AbstractExtItem::number() const { - qCDebug(LOG_LIB); - return m_number; } QString AbstractExtItem::tag(const QString _type) const { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Tag type" << _type; 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) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Version" << _apiVersion; m_apiVersion = _apiVersion; @@ -139,7 +119,6 @@ void AbstractExtItem::setApiVersion(const int _apiVersion) void AbstractExtItem::setActive(const bool _state) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "State" << _state; m_active = _state; @@ -148,7 +127,6 @@ void AbstractExtItem::setActive(const bool _state) void AbstractExtItem::setComment(const QString _comment) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Comment" << _comment; m_comment = _comment; @@ -157,7 +135,6 @@ void AbstractExtItem::setComment(const QString _comment) void AbstractExtItem::setInterval(const int _interval) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Interval" << _interval; if (_interval <= 0) return; @@ -168,7 +145,6 @@ void AbstractExtItem::setInterval(const int _interval) void AbstractExtItem::setName(const QString _name) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Name" << _name; m_name = _name; @@ -177,7 +153,6 @@ void AbstractExtItem::setName(const QString _name) void AbstractExtItem::setNumber(int _number) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Number" << _number; if (_number == -1) _number = []() { @@ -194,8 +169,6 @@ void AbstractExtItem::setNumber(int _number) void AbstractExtItem::readConfiguration() { - qCDebug(LOG_LIB); - for (int i = m_dirs.count() - 1; i >= 0; i--) { if (!QDir(m_dirs.at(i)).entryList(QDir::Files).contains(m_fileName)) continue; @@ -220,8 +193,6 @@ void AbstractExtItem::readConfiguration() bool AbstractExtItem::tryDelete() const { - qCDebug(LOG_LIB); - foreach (QString dir, m_dirs) { bool status = QFile::remove(QString("%1/%2").arg(dir).arg(m_fileName)); qCInfo(LOG_LIB) << "Remove file" @@ -238,8 +209,6 @@ bool AbstractExtItem::tryDelete() const void AbstractExtItem::writeConfiguration() const { - qCDebug(LOG_LIB); - QSettings settings(QString("%1/%2").arg(m_dirs.first()).arg(m_fileName), QSettings::IniFormat); qCInfo(LOG_LIB) << "Configuration file" << settings.fileName(); diff --git a/sources/awesomewidgets/abstractextitemaggregator.cpp b/sources/awesomewidgets/abstractextitemaggregator.cpp index 799975d..a9159e9 100644 --- a/sources/awesomewidgets/abstractextitemaggregator.cpp +++ b/sources/awesomewidgets/abstractextitemaggregator.cpp @@ -29,7 +29,7 @@ AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *parent) : QWidget(parent) { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; dialog = new QDialog(this); widgetDialog = new QListWidget(dialog); @@ -56,7 +56,7 @@ AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *parent) AbstractExtItemAggregator::~AbstractExtItemAggregator() { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; delete dialog; } @@ -64,8 +64,6 @@ AbstractExtItemAggregator::~AbstractExtItemAggregator() QString AbstractExtItemAggregator::getName() { - qCDebug(LOG_LIB); - bool ok; QString name = QInputDialog::getText(this, i18n("Enter file name"), i18n("File name"), QLineEdit::Normal, @@ -81,15 +79,12 @@ QString AbstractExtItemAggregator::getName() QVariant AbstractExtItemAggregator::configArgs() const { - qCDebug(LOG_LIB); - return m_configArgs; } void AbstractExtItemAggregator::setConfigArgs(const QVariant _configArgs) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Configuration arguments" << _configArgs; m_configArgs = _configArgs; @@ -99,7 +94,6 @@ void AbstractExtItemAggregator::setConfigArgs(const QVariant _configArgs) void AbstractExtItemAggregator::editItemActivated(QListWidgetItem *item) { Q_UNUSED(item) - qCDebug(LOG_LIB); return editItem(); } @@ -107,8 +101,6 @@ void AbstractExtItemAggregator::editItemActivated(QListWidgetItem *item) void AbstractExtItemAggregator::editItemButtonPressed(QAbstractButton *button) { - qCDebug(LOG_LIB); - if (static_cast(button) == copyButton) return copyItem(); else if (static_cast(button) == createButton) diff --git a/sources/awesomewidgets/abstractextitemaggregator.h b/sources/awesomewidgets/abstractextitemaggregator.h index 94ad6b4..c10b202 100644 --- a/sources/awesomewidgets/abstractextitemaggregator.h +++ b/sources/awesomewidgets/abstractextitemaggregator.h @@ -25,7 +25,7 @@ #include -// additinal class since QObject macro does not allow class templates +// additional class since QObject macro does not allow class templates class AbstractExtItemAggregator : public QWidget { Q_OBJECT diff --git a/sources/awesomewidgets/extitemaggregator.h b/sources/awesomewidgets/extitemaggregator.h index 1f521e0..ecb4f1d 100644 --- a/sources/awesomewidgets/extitemaggregator.h +++ b/sources/awesomewidgets/extitemaggregator.h @@ -24,9 +24,8 @@ #include #include -#include "awdebug.h" - #include "abstractextitemaggregator.h" +#include "awdebug.h" template class ExtItemAggregator : public AbstractExtItemAggregator @@ -36,33 +35,27 @@ public: : AbstractExtItemAggregator(parent) , m_type(type) { - qCDebug(LOG_LIB); - qCDebug(LOG_LIB) << "Type" << type; - qSetMessagePattern(LOG_FORMAT); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; + foreach (const QString metadata, getBuildData()) + qCDebug(LOG_LIB) << metadata; + qCDebug(LOG_LIB) << "Type" << type; initItems(); }; virtual ~ExtItemAggregator() { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; m_items.clear(); m_activeItems.clear(); }; - QList activeItems() - { - qCDebug(LOG_LIB); - - return m_activeItems; - }; + QList activeItems() { return m_activeItems; }; void editItems() { - qCDebug(LOG_LIB); - repaint(); int ret = dialog->exec(); qCInfo(LOG_LIB) << "Dialog returns" << ret; @@ -70,7 +63,6 @@ public: T *itemByTag(const QString _tag) const { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Tag" << _tag; T *found = nullptr; @@ -88,7 +80,6 @@ public: T *itemByTagNumber(const int _number) const { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Number" << _number; T *found = nullptr; @@ -106,8 +97,6 @@ public: T *itemFromWidget() const { - qCDebug(LOG_LIB); - QListWidgetItem *widgetItem = widgetDialog->currentItem(); if (widgetItem == nullptr) return nullptr; @@ -126,17 +115,10 @@ public: return found; }; - QList items() const - { - qCDebug(LOG_LIB); - - return m_items; - }; + QList items() const { return m_items; }; int uniqNumber() const { - qCDebug(LOG_LIB); - QList tagList; foreach (T *item, m_items) tagList.append(item->number()); @@ -155,8 +137,6 @@ private: // init method QList getItems() { - qCDebug(LOG_LIB); - // create directory at $HOME QString localDir = QString("%1/awesomewidgets/%2") .arg(QStandardPaths::writableLocation( @@ -193,8 +173,6 @@ private: void initItems() { - qCDebug(LOG_LIB); - m_items.clear(); m_activeItems.clear(); @@ -208,8 +186,6 @@ private: void repaint() { - qCDebug(LOG_LIB); - widgetDialog->clear(); foreach (T *_item, m_items) { QListWidgetItem *item @@ -226,8 +202,6 @@ private: // methods void copyItem() { - qCDebug(LOG_LIB); - T *source = itemFromWidget(); QString fileName = getName(); int number = uniqNumber(); @@ -245,8 +219,6 @@ private: void createItem() { - qCDebug(LOG_LIB); - QString fileName = getName(); int number = uniqNumber(); QStringList dirs = QStandardPaths::locateAll( @@ -268,8 +240,6 @@ private: void deleteItem() { - qCDebug(LOG_LIB); - T *source = itemFromWidget(); if (source == nullptr) { qCWarning(LOG_LIB) << "Nothing to delete"; @@ -284,8 +254,6 @@ private: void editItem() { - qCDebug(LOG_LIB); - T *source = itemFromWidget(); if (source == nullptr) { qCWarning(LOG_LIB) << "Nothing to edit"; diff --git a/sources/awesomewidgets/extquotes.cpp b/sources/awesomewidgets/extquotes.cpp index c0219e4..dc26994 100644 --- a/sources/awesomewidgets/extquotes.cpp +++ b/sources/awesomewidgets/extquotes.cpp @@ -38,7 +38,7 @@ ExtQuotes::ExtQuotes(QWidget *parent, const QString quotesName, : AbstractExtItem(parent, quotesName, directories) , ui(new Ui::ExtQuotes) { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; readConfiguration(); ui->setupUi(this); @@ -64,7 +64,7 @@ ExtQuotes::ExtQuotes(QWidget *parent, const QString quotesName, ExtQuotes::~ExtQuotes() { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; disconnect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(quotesReplyReceived(QNetworkReply *))); @@ -76,7 +76,6 @@ ExtQuotes::~ExtQuotes() ExtQuotes *ExtQuotes::copy(const QString _fileName, const int _number) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "File" << _fileName; qCDebug(LOG_LIB) << "Number" << _number; @@ -96,23 +95,18 @@ ExtQuotes *ExtQuotes::copy(const QString _fileName, const int _number) QString ExtQuotes::ticker() const { - qCDebug(LOG_LIB); - return m_ticker; } QString ExtQuotes::uniq() const { - qCDebug(LOG_LIB); - return m_ticker; } void ExtQuotes::setTicker(const QString _ticker) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Ticker" << _ticker; m_ticker = _ticker; @@ -121,7 +115,6 @@ void ExtQuotes::setTicker(const QString _ticker) void ExtQuotes::readConfiguration() { - qCDebug(LOG_LIB); AbstractExtItem::readConfiguration(); for (int i = directories().count() - 1; i >= 0; i--) { @@ -150,7 +143,6 @@ void ExtQuotes::readConfiguration() QVariantHash ExtQuotes::run() { - qCDebug(LOG_LIB); if ((!isActive()) || (isRunning)) return values; @@ -173,7 +165,6 @@ QVariantHash ExtQuotes::run() int ExtQuotes::showConfiguration(const QVariant args) { Q_UNUSED(args) - qCDebug(LOG_LIB); ui->lineEdit_name->setText(name()); ui->lineEdit_comment->setText(comment()); @@ -201,7 +192,6 @@ int ExtQuotes::showConfiguration(const QVariant args) void ExtQuotes::writeConfiguration() const { - qCDebug(LOG_LIB); AbstractExtItem::writeConfiguration(); QSettings settings( @@ -218,7 +208,6 @@ void ExtQuotes::writeConfiguration() const void ExtQuotes::quotesReplyReceived(QNetworkReply *reply) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Return code" << reply->error(); qCDebug(LOG_LIB) << "Reply error message" << reply->errorString(); @@ -274,8 +263,6 @@ void ExtQuotes::quotesReplyReceived(QNetworkReply *reply) void ExtQuotes::translate() { - qCDebug(LOG_LIB); - ui->label_name->setText(i18n("Name")); ui->label_comment->setText(i18n("Comment")); ui->label_number->setText(i18n("Tag")); @@ -292,8 +279,6 @@ get quotes for the instrument. Refer to \ QString ExtQuotes::url() const { - qCDebug(LOG_LIB); - QString apiUrl = QString(YAHOO_URL); apiUrl.replace(QString("$TICKER"), m_ticker); qCInfo(LOG_LIB) << "API url" << apiUrl; diff --git a/sources/awesomewidgets/extscript.cpp b/sources/awesomewidgets/extscript.cpp index 57f9aa3..51ed024 100644 --- a/sources/awesomewidgets/extscript.cpp +++ b/sources/awesomewidgets/extscript.cpp @@ -36,7 +36,7 @@ ExtScript::ExtScript(QWidget *parent, const QString scriptName, : AbstractExtItem(parent, scriptName, directories) , ui(new Ui::ExtScript) { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; readConfiguration(); readJsonFilters(); @@ -45,7 +45,7 @@ ExtScript::ExtScript(QWidget *parent, const QString scriptName, value[tag(QString("custom"))] = QString(""); - process = new QProcess(this); + process = new QProcess(nullptr); connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(updateValue())); process->waitForFinished(0); @@ -54,17 +54,16 @@ ExtScript::ExtScript(QWidget *parent, const QString scriptName, ExtScript::~ExtScript() { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; process->kill(); - delete process; + process->deleteLater(); delete ui; } ExtScript *ExtScript::copy(const QString _fileName, const int _number) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "File" << _fileName; qCDebug(LOG_LIB) << "Number" << _number; @@ -86,48 +85,36 @@ ExtScript *ExtScript::copy(const QString _fileName, const int _number) QString ExtScript::executable() const { - qCDebug(LOG_LIB); - return m_executable; } QStringList ExtScript::filters() const { - qCDebug(LOG_LIB); - return m_filters; } QString ExtScript::prefix() const { - qCDebug(LOG_LIB); - return m_prefix; } ExtScript::Redirect ExtScript::redirect() const { - qCDebug(LOG_LIB); - return m_redirect; } QString ExtScript::uniq() const { - qCDebug(LOG_LIB); - return m_executable; } QString ExtScript::strRedirect() const { - qCDebug(LOG_LIB); - QString value; switch (m_redirect) { case stdout2stderr: @@ -151,7 +138,6 @@ QString ExtScript::strRedirect() const void ExtScript::setExecutable(const QString _executable) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Executable" << _executable; m_executable = _executable; @@ -160,7 +146,6 @@ void ExtScript::setExecutable(const QString _executable) void ExtScript::setFilters(const QStringList _filters) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Filters" << _filters; std::for_each(_filters.cbegin(), _filters.cend(), @@ -170,7 +155,6 @@ void ExtScript::setFilters(const QStringList _filters) void ExtScript::setPrefix(const QString _prefix) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Prefix" << _prefix; m_prefix = _prefix; @@ -179,7 +163,6 @@ void ExtScript::setPrefix(const QString _prefix) void ExtScript::setRedirect(const Redirect _redirect) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Redirect" << _redirect; m_redirect = _redirect; @@ -188,7 +171,6 @@ void ExtScript::setRedirect(const Redirect _redirect) void ExtScript::setStrRedirect(const QString _redirect) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Redirect" << _redirect; if (_redirect == QString("stdout2sdterr")) @@ -204,7 +186,6 @@ void ExtScript::setStrRedirect(const QString _redirect) QString ExtScript::applyFilters(QString _value) const { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Value" << _value; foreach (QString filt, m_filters) { @@ -225,7 +206,6 @@ QString ExtScript::applyFilters(QString _value) const void ExtScript::updateFilter(const QString _filter, const bool _add) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Filter" << _filter; qCDebug(LOG_LIB) << "Should be added" << _add; @@ -241,7 +221,6 @@ void ExtScript::updateFilter(const QString _filter, const bool _add) void ExtScript::readConfiguration() { - qCDebug(LOG_LIB); AbstractExtItem::readConfiguration(); for (int i = directories().count() - 1; i >= 0; i--) { @@ -277,8 +256,6 @@ void ExtScript::readConfiguration() void ExtScript::readJsonFilters() { - qCDebug(LOG_LIB); - QString fileName = QStandardPaths::locate( QStandardPaths::GenericDataLocation, QString( @@ -306,7 +283,6 @@ void ExtScript::readJsonFilters() QVariantHash ExtScript::run() { - qCDebug(LOG_LIB); if (!isActive()) return value; @@ -329,7 +305,6 @@ QVariantHash ExtScript::run() int ExtScript::showConfiguration(const QVariant args) { Q_UNUSED(args) - qCDebug(LOG_LIB); ui->lineEdit_name->setText(name()); ui->lineEdit_comment->setText(comment()); @@ -375,7 +350,6 @@ int ExtScript::showConfiguration(const QVariant args) void ExtScript::writeConfiguration() const { - qCDebug(LOG_LIB); AbstractExtItem::writeConfiguration(); QSettings settings( @@ -396,8 +370,6 @@ void ExtScript::writeConfiguration() const void ExtScript::updateValue() { - qCDebug(LOG_LIB); - qCInfo(LOG_LIB) << "Cmd returns" << process->exitCode(); QString qdebug = QTextCodec::codecForMib(106) ->toUnicode(process->readAllStandardError()) @@ -431,8 +403,6 @@ void ExtScript::updateValue() void ExtScript::translate() { - qCDebug(LOG_LIB); - ui->label_name->setText(i18n("Name")); ui->label_comment->setText(i18n("Comment")); ui->label_number->setText(i18n("Tag")); diff --git a/sources/awesomewidgets/extupgrade.cpp b/sources/awesomewidgets/extupgrade.cpp index c9ff403..06b9515 100644 --- a/sources/awesomewidgets/extupgrade.cpp +++ b/sources/awesomewidgets/extupgrade.cpp @@ -34,7 +34,7 @@ ExtUpgrade::ExtUpgrade(QWidget *parent, const QString upgradeName, : AbstractExtItem(parent, upgradeName, directories) , ui(new Ui::ExtUpgrade) { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; readConfiguration(); ui->setupUi(this); @@ -42,7 +42,7 @@ ExtUpgrade::ExtUpgrade(QWidget *parent, const QString upgradeName, value[tag(QString("pkgcount"))] = 0; - process = new QProcess(this); + process = new QProcess(nullptr); connect(process, SIGNAL(finished(int)), this, SLOT(updateValue())); process->waitForFinished(0); } @@ -50,17 +50,16 @@ ExtUpgrade::ExtUpgrade(QWidget *parent, const QString upgradeName, ExtUpgrade::~ExtUpgrade() { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; process->kill(); - delete process; + process->deleteLater(); delete ui; } ExtUpgrade *ExtUpgrade::copy(const QString _fileName, const int _number) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "File" << _fileName; qCDebug(LOG_LIB) << "Number" << _number; @@ -82,39 +81,30 @@ ExtUpgrade *ExtUpgrade::copy(const QString _fileName, const int _number) QString ExtUpgrade::executable() const { - qCDebug(LOG_LIB); - return m_executable; } QString ExtUpgrade::filter() const { - qCDebug(LOG_LIB); - return m_filter; } int ExtUpgrade::null() const { - qCDebug(LOG_LIB); - return m_null; } QString ExtUpgrade::uniq() const { - qCDebug(LOG_LIB); - return m_executable; } void ExtUpgrade::setExecutable(const QString _executable) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Executable" << _executable; m_executable = _executable; @@ -123,7 +113,6 @@ void ExtUpgrade::setExecutable(const QString _executable) void ExtUpgrade::setFilter(const QString _filter) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Filter" << _filter; m_filter = _filter; @@ -132,7 +121,6 @@ void ExtUpgrade::setFilter(const QString _filter) void ExtUpgrade::setNull(const int _null) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Null lines" << _null; if (_null < 0) return; @@ -143,7 +131,6 @@ void ExtUpgrade::setNull(const int _null) void ExtUpgrade::readConfiguration() { - qCDebug(LOG_LIB); AbstractExtItem::readConfiguration(); for (int i = directories().count() - 1; i >= 0; i--) { @@ -175,7 +162,6 @@ void ExtUpgrade::readConfiguration() QVariantHash ExtUpgrade::run() { - qCDebug(LOG_LIB); if (!isActive()) return value; @@ -195,7 +181,6 @@ QVariantHash ExtUpgrade::run() int ExtUpgrade::showConfiguration(const QVariant args) { Q_UNUSED(args) - qCDebug(LOG_LIB); ui->lineEdit_name->setText(name()); ui->lineEdit_comment->setText(comment()); @@ -227,7 +212,6 @@ int ExtUpgrade::showConfiguration(const QVariant args) void ExtUpgrade::writeConfiguration() const { - qCDebug(LOG_LIB); AbstractExtItem::writeConfiguration(); QSettings settings( @@ -247,8 +231,6 @@ void ExtUpgrade::writeConfiguration() const void ExtUpgrade::updateValue() { - qCDebug(LOG_LIB); - qCInfo(LOG_LIB) << "Cmd returns" << process->exitCode(); qCInfo(LOG_LIB) << "Error" << process->readAllStandardError(); @@ -268,8 +250,6 @@ void ExtUpgrade::updateValue() void ExtUpgrade::translate() { - qCDebug(LOG_LIB); - ui->label_name->setText(i18n("Name")); ui->label_comment->setText(i18n("Comment")); ui->label_number->setText(i18n("Tag")); diff --git a/sources/awesomewidgets/extweather.cpp b/sources/awesomewidgets/extweather.cpp index f4ed386..6245af4 100644 --- a/sources/awesomewidgets/extweather.cpp +++ b/sources/awesomewidgets/extweather.cpp @@ -39,7 +39,7 @@ ExtWeather::ExtWeather(QWidget *parent, const QString weatherName, : AbstractExtItem(parent, weatherName, directories) , ui(new Ui::ExtWeather) { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; readConfiguration(); readJsonMap(); @@ -62,7 +62,7 @@ ExtWeather::ExtWeather(QWidget *parent, const QString weatherName, ExtWeather::~ExtWeather() { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; disconnect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(weatherReplyReceived(QNetworkReply *))); @@ -74,7 +74,6 @@ ExtWeather::~ExtWeather() ExtWeather *ExtWeather::copy(const QString _fileName, const int _number) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "File" << _fileName; 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 { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Weather ID" << _id; QVariantMap map @@ -108,47 +106,36 @@ QString ExtWeather::weatherFromInt(const int _id) const QString ExtWeather::city() const { - qCDebug(LOG_LIB); - return m_city; } QString ExtWeather::country() const { - qCDebug(LOG_LIB); - return m_country; } bool ExtWeather::image() const { - qCDebug(LOG_LIB); - return m_image; } int ExtWeather::ts() const { - qCDebug(LOG_LIB); - return m_ts; } QString ExtWeather::uniq() const { - qCDebug(LOG_LIB); - return QString("%1 (%2) at %3").arg(m_city).arg(m_country).arg(m_ts); } void ExtWeather::setCity(const QString _city) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "City" << _city; m_city = _city; @@ -157,7 +144,6 @@ void ExtWeather::setCity(const QString _city) void ExtWeather::setCountry(const QString _country) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Country" << _country; m_country = _country; @@ -166,7 +152,6 @@ void ExtWeather::setCountry(const QString _country) void ExtWeather::setImage(const bool _image) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Use image" << _image; m_image = _image; @@ -175,7 +160,6 @@ void ExtWeather::setImage(const bool _image) void ExtWeather::setTs(const int _ts) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Timestamp" << _ts; m_ts = _ts; @@ -184,7 +168,6 @@ void ExtWeather::setTs(const int _ts) void ExtWeather::readConfiguration() { - qCDebug(LOG_LIB); AbstractExtItem::readConfiguration(); for (int i = directories().count() - 1; i >= 0; i--) { @@ -220,8 +203,6 @@ void ExtWeather::readConfiguration() void ExtWeather::readJsonMap() { - qCDebug(LOG_LIB); - QString fileName = QStandardPaths::locate( QStandardPaths::GenericDataLocation, QString("awesomewidgets/weather/awesomewidgets-extweather-ids.json")); @@ -248,7 +229,6 @@ void ExtWeather::readJsonMap() QVariantHash ExtWeather::run() { - qCDebug(LOG_LIB); if ((!isActive()) || (isRunning)) return values; @@ -272,7 +252,6 @@ QVariantHash ExtWeather::run() int ExtWeather::showConfiguration(const QVariant args) { Q_UNUSED(args) - qCDebug(LOG_LIB); ui->lineEdit_name->setText(name()); ui->lineEdit_comment->setText(comment()); @@ -306,7 +285,6 @@ int ExtWeather::showConfiguration(const QVariant args) void ExtWeather::writeConfiguration() const { - qCDebug(LOG_LIB); AbstractExtItem::writeConfiguration(); QSettings settings( @@ -327,7 +305,6 @@ void ExtWeather::writeConfiguration() const void ExtWeather::weatherReplyReceived(QNetworkReply *reply) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Return code" << reply->error(); qCDebug(LOG_LIB) << "Reply error message" << reply->errorString(); @@ -364,7 +341,6 @@ void ExtWeather::weatherReplyReceived(QNetworkReply *reply) QVariantHash ExtWeather::parseSingleJson(const QVariantMap json) const { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Single json data" << json; QVariantHash output; @@ -393,8 +369,6 @@ QVariantHash ExtWeather::parseSingleJson(const QVariantMap json) const void ExtWeather::translate() { - qCDebug(LOG_LIB); - ui->label_name->setText(i18n("Name")); ui->label_comment->setText(i18n("Comment")); ui->label_number->setText(i18n("Tag")); @@ -409,7 +383,6 @@ void ExtWeather::translate() QString ExtWeather::url(const bool isForecast) const { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Is forecast" << isForecast; QString apiUrl = isForecast ? QString(OWM_FORECAST_URL) : QString(OWM_URL); diff --git a/sources/awesomewidgets/graphicalitem.cpp b/sources/awesomewidgets/graphicalitem.cpp index 1da0da5..1f4cabf 100644 --- a/sources/awesomewidgets/graphicalitem.cpp +++ b/sources/awesomewidgets/graphicalitem.cpp @@ -39,7 +39,7 @@ GraphicalItem::GraphicalItem(QWidget *parent, const QString desktopName, : AbstractExtItem(parent, desktopName, directories) , ui(new Ui::GraphicalItem) { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; readConfiguration(); ui->setupUi(this); @@ -56,7 +56,7 @@ GraphicalItem::GraphicalItem(QWidget *parent, const QString desktopName, GraphicalItem::~GraphicalItem() { - qCDebug(LOG_LIB); + qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; delete m_scene; delete ui; @@ -65,7 +65,6 @@ GraphicalItem::~GraphicalItem() GraphicalItem *GraphicalItem::copy(const QString _fileName, const int _number) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "File" << _fileName; qCDebug(LOG_LIB) << "Number" << _number; @@ -91,7 +90,6 @@ GraphicalItem *GraphicalItem::copy(const QString _fileName, const int _number) QString GraphicalItem::image(const QVariant value) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Value" << value; if (m_bar == QString("none")) return QString(""); @@ -138,48 +136,36 @@ QString GraphicalItem::image(const QVariant value) QString GraphicalItem::bar() const { - qCDebug(LOG_LIB); - return m_bar; } QString GraphicalItem::activeColor() const { - qCDebug(LOG_LIB); - return m_activeColor; } QString GraphicalItem::inactiveColor() const { - qCDebug(LOG_LIB); - return m_inactiveColor; } QString GraphicalItem::tag() const { - qCDebug(LOG_LIB); - return QString("bar%1%2").arg(number()).arg(m_bar); } GraphicalItem::Type GraphicalItem::type() const { - qCDebug(LOG_LIB); - return m_type; } QString GraphicalItem::strType() const { - qCDebug(LOG_LIB); - QString value; switch (m_type) { case Vertical: @@ -203,16 +189,12 @@ QString GraphicalItem::strType() const GraphicalItem::Direction GraphicalItem::direction() const { - qCDebug(LOG_LIB); - return m_direction; } QString GraphicalItem::strDirection() const { - qCDebug(LOG_LIB); - QString value; switch (m_direction) { case RightToLeft: @@ -230,31 +212,24 @@ QString GraphicalItem::strDirection() const int GraphicalItem::height() const { - qCDebug(LOG_LIB); - return m_height; } int GraphicalItem::width() const { - qCDebug(LOG_LIB); - return m_width; } QString GraphicalItem::uniq() const { - qCDebug(LOG_LIB); - return m_bar; } void GraphicalItem::setBar(const QString _bar) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Bar" << _bar; if (!_bar.contains(QRegExp( @@ -269,7 +244,6 @@ void GraphicalItem::setBar(const QString _bar) void GraphicalItem::setActiveColor(const QString _color) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Color" << _color; m_activeColor = _color; @@ -278,7 +252,6 @@ void GraphicalItem::setActiveColor(const QString _color) void GraphicalItem::setInactiveColor(const QString _color) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Color" << _color; m_inactiveColor = _color; @@ -287,7 +260,6 @@ void GraphicalItem::setInactiveColor(const QString _color) void GraphicalItem::setType(const Type _type) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Type" << _type; m_type = _type; @@ -296,7 +268,6 @@ void GraphicalItem::setType(const Type _type) void GraphicalItem::setStrType(const QString _type) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Type" << _type; if (_type == QString("Vertical")) @@ -312,7 +283,6 @@ void GraphicalItem::setStrType(const QString _type) void GraphicalItem::setDirection(const Direction _direction) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Direction" << _direction; m_direction = _direction; @@ -321,7 +291,6 @@ void GraphicalItem::setDirection(const Direction _direction) void GraphicalItem::setStrDirection(const QString _direction) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Direction" << _direction; if (_direction == QString("RightToLeft")) @@ -333,7 +302,6 @@ void GraphicalItem::setStrDirection(const QString _direction) void GraphicalItem::setHeight(const int _height) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Height" << _height; if (_height <= 0) return; @@ -344,7 +312,6 @@ void GraphicalItem::setHeight(const int _height) void GraphicalItem::setWidth(const int _width) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Width" << _width; if (_width <= 0) return; @@ -355,7 +322,6 @@ void GraphicalItem::setWidth(const int _width) void GraphicalItem::readConfiguration() { - qCDebug(LOG_LIB); AbstractExtItem::readConfiguration(); for (int i = directories().count() - 1; i >= 0; i--) { @@ -399,8 +365,6 @@ void GraphicalItem::readConfiguration() QVariantHash GraphicalItem::run() { - qCDebug(LOG_LIB); - // required by abstract class return QVariantHash(); } @@ -408,7 +372,6 @@ QVariantHash GraphicalItem::run() int GraphicalItem::showConfiguration(const QVariant args) { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Combobox arguments" << args; QStringList tags = args.toStringList(); @@ -445,7 +408,6 @@ int GraphicalItem::showConfiguration(const QVariant args) void GraphicalItem::writeConfiguration() const { - qCDebug(LOG_LIB); AbstractExtItem::writeConfiguration(); QSettings settings( @@ -469,8 +431,6 @@ void GraphicalItem::writeConfiguration() const void GraphicalItem::changeColor() { - qCDebug(LOG_LIB); - QColor color = stringToColor((static_cast(sender()))->text()); QColor newColor = QColorDialog::getColor(color, this, tr("Select color"), @@ -492,8 +452,6 @@ void GraphicalItem::changeColor() void GraphicalItem::initScene() { - qCDebug(LOG_LIB); - // init scene m_scene = new QGraphicsScene(); if (m_type == Graph) @@ -513,8 +471,6 @@ void GraphicalItem::initScene() void GraphicalItem::paintCircle(const float value) { - qCDebug(LOG_LIB); - QPen pen; pen.setWidth(1.0); float percent = value / 100.0; @@ -540,8 +496,6 @@ void GraphicalItem::paintCircle(const float value) void GraphicalItem::paintGraph(const QList value) { - qCDebug(LOG_LIB); - QPen pen; pen.setColor(stringToColor(m_activeColor)); @@ -563,8 +517,6 @@ void GraphicalItem::paintGraph(const QList value) void GraphicalItem::paintHorizontal(const float value) { - qCDebug(LOG_LIB); - QPen pen; float percent = value / 100.0; @@ -582,8 +534,6 @@ void GraphicalItem::paintHorizontal(const float value) void GraphicalItem::paintVertical(const float value) { - qCDebug(LOG_LIB); - QPen pen; float percent = value / 100.0; @@ -601,7 +551,6 @@ void GraphicalItem::paintVertical(const float value) QColor GraphicalItem::stringToColor(const QString _color) const { - qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Color" << _color; QColor qcolor; @@ -619,8 +568,6 @@ QColor GraphicalItem::stringToColor(const QString _color) const void GraphicalItem::translate() { - qCDebug(LOG_LIB); - ui->label_name->setText(i18n("Name")); ui->label_comment->setText(i18n("Comment")); ui->label_value->setText(i18n("Value")); diff --git a/sources/desktop-panel/plugin/dpadds.cpp b/sources/desktop-panel/plugin/dpadds.cpp index 1c98695..702f570 100644 --- a/sources/desktop-panel/plugin/dpadds.cpp +++ b/sources/desktop-panel/plugin/dpadds.cpp @@ -40,10 +40,10 @@ DPAdds::DPAdds(QObject *parent) : QObject(parent) { - qCDebug(LOG_DP); - - // logging qSetMessagePattern(LOG_FORMAT); + qCDebug(LOG_DP) << __PRETTY_FUNCTION__; + foreach (const QString metadata, getBuildData()) + qCDebug(LOG_DP) << metadata; connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this, SIGNAL(desktopChanged())); @@ -56,31 +56,25 @@ DPAdds::DPAdds(QObject *parent) DPAdds::~DPAdds() { - qCDebug(LOG_DP); + qCDebug(LOG_DP) << __PRETTY_FUNCTION__; } // HACK: since QML could not use QLoggingCategory I need this hack bool DPAdds::isDebugEnabled() const { - qCDebug(LOG_DP); - return LOG_DP().isDebugEnabled(); } int DPAdds::currentDesktop() const { - qCDebug(LOG_DP); - return KWindowSystem::currentDesktop(); } QStringList DPAdds::dictKeys() const { - qCDebug(LOG_DP); - QStringList allKeys; allKeys.append(QString("mark")); allKeys.append(QString("name")); @@ -93,15 +87,12 @@ QStringList DPAdds::dictKeys() const int DPAdds::numberOfDesktops() const { - qCDebug(LOG_DP); - return KWindowSystem::numberOfDesktops(); } QString DPAdds::toolTipImage(const int desktop) const { - qCDebug(LOG_DP); qCDebug(LOG_DP) << "Desktop" << desktop; // drop if no tooltip required 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 { - qCDebug(LOG_DP); qCDebug(LOG_DP) << "Pattern" << pattern; 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) { - qCDebug(LOG_DP); qCDebug(LOG_DP) << "Mark" << newMark; m_mark = newMark; @@ -225,7 +214,6 @@ void DPAdds::setMark(const QString newMark) void DPAdds::setToolTipData(const QVariantMap tooltipData) { - qCDebug(LOG_DP); qCDebug(LOG_DP) << "Data" << tooltipData; 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 { - qCDebug(LOG_DP); qCDebug(LOG_DP) << "Requested key" << key; qCDebug(LOG_DP) << "Desktop number" << desktop; if (desktop == -1) @@ -262,7 +249,6 @@ QString DPAdds::valueByKey(const QString key, int desktop) const // HACK: this method uses variables from version.h QString DPAdds::getAboutText(const QString type) const { - qCDebug(LOG_DP); qCDebug(LOG_DP) << "Type" << type; QString text; @@ -323,7 +309,6 @@ QString DPAdds::getAboutText(const QString type) const QVariantMap DPAdds::getFont(const QVariantMap defaultFont) const { - qCDebug(LOG_DP); qCDebug(LOG_DP) << "Default font is" << defaultFont; QVariantMap fontMap; @@ -343,7 +328,6 @@ QVariantMap DPAdds::getFont(const QVariantMap defaultFont) const // to avoid additional object definition this method is static void DPAdds::sendNotification(const QString eventId, const QString message) { - qCDebug(LOG_DP); qCDebug(LOG_DP) << "Event" << eventId; qCDebug(LOG_DP) << "Message" << message; @@ -357,7 +341,6 @@ void DPAdds::sendNotification(const QString eventId, const QString message) // slot for mouse click void DPAdds::setCurrentDesktop(const int desktop) const { - qCDebug(LOG_DP); qCDebug(LOG_DP) << "Desktop" << desktop; KWindowSystem::setCurrentDesktop(desktop); @@ -366,7 +349,6 @@ void DPAdds::setCurrentDesktop(const int desktop) const DPAdds::DesktopWindowsInfo DPAdds::getInfoByDesktop(const int desktop) const { - qCDebug(LOG_DP); qCDebug(LOG_DP) << "Desktop" << desktop; diff --git a/sources/extsysmon/extsysmon.cpp b/sources/extsysmon/extsysmon.cpp index 69ddf8f..019533e 100644 --- a/sources/extsysmon/extsysmon.cpp +++ b/sources/extsysmon/extsysmon.cpp @@ -32,10 +32,10 @@ ExtendedSysMon::ExtendedSysMon(QObject *parent, const QVariantList &args) : Plasma::DataEngine(parent, args) { Q_UNUSED(args) - qCDebug(LOG_ESM); - - // logging qSetMessagePattern(LOG_FORMAT); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; + foreach (const QString metadata, getBuildData()) + qCDebug(LOG_ESM) << metadata; setMinimumPollingInterval(333); readConfiguration(); @@ -49,7 +49,7 @@ ExtendedSysMon::ExtendedSysMon(QObject *parent, const QVariantList &args) ExtendedSysMon::~ExtendedSysMon() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; delete aggregator; } @@ -57,15 +57,12 @@ ExtendedSysMon::~ExtendedSysMon() QStringList ExtendedSysMon::sources() const { - qCDebug(LOG_ESM); - return aggregator->sources(); } bool ExtendedSysMon::sourceRequestEvent(const QString &source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; return updateSourceEvent(source); @@ -74,7 +71,6 @@ bool ExtendedSysMon::sourceRequestEvent(const QString &source) bool ExtendedSysMon::updateSourceEvent(const QString &source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; if (aggregator->hasSource(source)) { @@ -90,8 +86,6 @@ bool ExtendedSysMon::updateSourceEvent(const QString &source) QStringList ExtendedSysMon::getAllHdd() const { - qCDebug(LOG_ESM); - QStringList allDevices = QDir(QString("/dev")).entryList(QDir::System, QDir::Name); QStringList devices = allDevices.filter(QRegExp(QString("^[hms]d[a-z]$"))); @@ -105,8 +99,6 @@ QStringList ExtendedSysMon::getAllHdd() const QString ExtendedSysMon::getAutoGpu() const { - qCDebug(LOG_ESM); - QString gpu = QString("disable"); QFile moduleFile(QString("/proc/modules")); if (!moduleFile.open(QIODevice::ReadOnly)) @@ -125,8 +117,6 @@ QString ExtendedSysMon::getAutoGpu() const void ExtendedSysMon::readConfiguration() { - qCDebug(LOG_ESM); - QString fileName = QStandardPaths::locate(QStandardPaths::ConfigLocation, QString("plasma-dataengine-extsysmon.conf")); @@ -166,7 +156,6 @@ void ExtendedSysMon::readConfiguration() QHash ExtendedSysMon::updateConfiguration(QHash rawConfig) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Raw configuration" << rawConfig; // gpudev diff --git a/sources/extsysmon/extsysmonaggregator.cpp b/sources/extsysmon/extsysmonaggregator.cpp index 23ed9b9..bd14e95 100644 --- a/sources/extsysmon/extsysmonaggregator.cpp +++ b/sources/extsysmon/extsysmonaggregator.cpp @@ -18,7 +18,6 @@ #include "extsysmonaggregator.h" #include "awdebug.h" -#include "version.h" #include "sources/batterysource.h" #include "sources/customsource.h" #include "sources/desktopsource.h" @@ -33,13 +32,14 @@ #include "sources/updatesource.h" #include "sources/upgradesource.h" #include "sources/weathersource.h" +#include "version.h" ExtSysMonAggregator::ExtSysMonAggregator(QObject *parent, const QHash config) : QObject(parent) { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; init(config); } @@ -47,7 +47,7 @@ ExtSysMonAggregator::ExtSysMonAggregator(QObject *parent, ExtSysMonAggregator::~ExtSysMonAggregator() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; m_map.clear(); } @@ -55,7 +55,6 @@ ExtSysMonAggregator::~ExtSysMonAggregator() QVariant ExtSysMonAggregator::data(const QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; 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 { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; return hasSource(source) ? m_map[source]->initialData(source) @@ -80,8 +78,6 @@ QVariantMap ExtSysMonAggregator::initialData(const QString source) const QStringList ExtSysMonAggregator::sources() const { - qCDebug(LOG_ESM); - QStringList sorted = m_map.keys(); sorted.sort(); return sorted; @@ -90,7 +86,7 @@ QStringList ExtSysMonAggregator::sources() const void ExtSysMonAggregator::init(const QHash config) { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << "Configuration" << config; // battery AbstractExtSysMonSource *batteryItem diff --git a/sources/extsysmon/sources/batterysource.cpp b/sources/extsysmon/sources/batterysource.cpp index 597ae90..70ee6e2 100644 --- a/sources/extsysmon/sources/batterysource.cpp +++ b/sources/extsysmon/sources/batterysource.cpp @@ -27,7 +27,7 @@ BatterySource::BatterySource(QObject *parent, const QStringList args) : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 1); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; m_acpiPath = args.at(0); m_sources = getSources(); @@ -36,13 +36,12 @@ BatterySource::BatterySource(QObject *parent, const QStringList args) BatterySource::~BatterySource() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } QVariant BatterySource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; if (source == QString("battery/ac")) @@ -53,7 +52,6 @@ QVariant BatterySource::data(QString source) QVariantMap BatterySource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; QVariantMap data; @@ -83,8 +81,6 @@ QVariantMap BatterySource::initialData(QString source) const void BatterySource::run() { - qCDebug(LOG_ESM); - // adaptor QFile acFile(QString("%1/AC/online").arg(m_acpiPath)); if (acFile.open(QIODevice::ReadOnly)) @@ -121,16 +117,12 @@ void BatterySource::run() QStringList BatterySource::sources() const { - qCDebug(LOG_ESM); - return m_sources; } QStringList BatterySource::getSources() { - qCDebug(LOG_ESM); - QStringList sources; sources.append(QString("battery/ac")); sources.append(QString("battery/bat")); diff --git a/sources/extsysmon/sources/customsource.cpp b/sources/extsysmon/sources/customsource.cpp index e762769..68c9c7d 100644 --- a/sources/extsysmon/sources/customsource.cpp +++ b/sources/extsysmon/sources/customsource.cpp @@ -26,7 +26,7 @@ CustomSource::CustomSource(QObject *parent, const QStringList args) : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 0); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; extScripts = new ExtItemAggregator(nullptr, QString("scripts")); m_sources = getSources(); @@ -35,7 +35,7 @@ CustomSource::CustomSource(QObject *parent, const QStringList args) CustomSource::~CustomSource() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; delete extScripts; } @@ -43,7 +43,6 @@ CustomSource::~CustomSource() QVariant CustomSource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; // there are only one value @@ -53,7 +52,6 @@ QVariant CustomSource::data(QString source) QVariantMap CustomSource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; QVariantMap data; @@ -71,16 +69,12 @@ QVariantMap CustomSource::initialData(QString source) const QStringList CustomSource::sources() const { - qCDebug(LOG_ESM); - return m_sources; } QStringList CustomSource::getSources() { - qCDebug(LOG_ESM); - QStringList sources; foreach (ExtScript *item, extScripts->activeItems()) sources.append(QString("custom/%1").arg(item->tag(QString("custom")))); diff --git a/sources/extsysmon/sources/desktopsource.cpp b/sources/extsysmon/sources/desktopsource.cpp index 5916c5b..3c3ec1d 100644 --- a/sources/extsysmon/sources/desktopsource.cpp +++ b/sources/extsysmon/sources/desktopsource.cpp @@ -27,19 +27,18 @@ DesktopSource::DesktopSource(QObject *parent, const QStringList args) : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 0); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } DesktopSource::~DesktopSource() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } QVariant DesktopSource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; int current = KWindowSystem::currentDesktop(); @@ -64,7 +63,6 @@ QVariant DesktopSource::data(QString source) QVariantMap DesktopSource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; QVariantMap data; @@ -100,8 +98,6 @@ QVariantMap DesktopSource::initialData(QString source) const QStringList DesktopSource::sources() const { - qCDebug(LOG_ESM); - QStringList sources; sources.append(QString("desktop/current/name")); sources.append(QString("desktop/current/number")); diff --git a/sources/extsysmon/sources/gpuloadsource.cpp b/sources/extsysmon/sources/gpuloadsource.cpp index 1138e69..c4d0c12 100644 --- a/sources/extsysmon/sources/gpuloadsource.cpp +++ b/sources/extsysmon/sources/gpuloadsource.cpp @@ -29,7 +29,7 @@ GPULoadSource::GPULoadSource(QObject *parent, const QStringList args) : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 1); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; m_device = args.at(0); } @@ -37,13 +37,12 @@ GPULoadSource::GPULoadSource(QObject *parent, const QStringList args) GPULoadSource::~GPULoadSource() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } QVariant GPULoadSource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; if (source == QString("gpu/load")) { @@ -94,7 +93,6 @@ QVariant GPULoadSource::data(QString source) QVariantMap GPULoadSource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; QVariantMap data; @@ -112,8 +110,6 @@ QVariantMap GPULoadSource::initialData(QString source) const QStringList GPULoadSource::sources() const { - qCDebug(LOG_ESM); - QStringList sources; sources.append(QString("gpu/load")); diff --git a/sources/extsysmon/sources/gputempsource.cpp b/sources/extsysmon/sources/gputempsource.cpp index 65b2f89..c02ec81 100644 --- a/sources/extsysmon/sources/gputempsource.cpp +++ b/sources/extsysmon/sources/gputempsource.cpp @@ -30,7 +30,7 @@ GPUTemperatureSource::GPUTemperatureSource(QObject *parent, : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 1); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; m_device = args.at(0); } @@ -38,13 +38,12 @@ GPUTemperatureSource::GPUTemperatureSource(QObject *parent, GPUTemperatureSource::~GPUTemperatureSource() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } QVariant GPUTemperatureSource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; if (source == QString("gpu/temperature")) { @@ -93,7 +92,6 @@ QVariant GPUTemperatureSource::data(QString source) QVariantMap GPUTemperatureSource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; QVariantMap data; @@ -111,8 +109,6 @@ QVariantMap GPUTemperatureSource::initialData(QString source) const QStringList GPUTemperatureSource::sources() const { - qCDebug(LOG_ESM); - QStringList sources; sources.append(QString("gpu/temperature")); diff --git a/sources/extsysmon/sources/hddtempsource.cpp b/sources/extsysmon/sources/hddtempsource.cpp index 5d11c76..2816e3b 100644 --- a/sources/extsysmon/sources/hddtempsource.cpp +++ b/sources/extsysmon/sources/hddtempsource.cpp @@ -30,7 +30,7 @@ HDDTemperatureSource::HDDTemperatureSource(QObject *parent, : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 2); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; m_devices = args.at(0).split(QChar(','), QString::SkipEmptyParts); m_cmd = args.at(1); @@ -42,13 +42,12 @@ HDDTemperatureSource::HDDTemperatureSource(QObject *parent, HDDTemperatureSource::~HDDTemperatureSource() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } QVariant HDDTemperatureSource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; QString device = source.remove(QString("hdd/temperature")); @@ -88,7 +87,6 @@ QVariant HDDTemperatureSource::data(QString source) QVariantMap HDDTemperatureSource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; QString device = source.remove(QString("hdd/temperature")); @@ -105,8 +103,6 @@ QVariantMap HDDTemperatureSource::initialData(QString source) const QStringList HDDTemperatureSource::sources() const { - qCDebug(LOG_ESM); - QStringList sources; foreach (QString device, m_devices) sources.append(QString("hdd/temperature%1").arg(device)); diff --git a/sources/extsysmon/sources/loadsource.cpp b/sources/extsysmon/sources/loadsource.cpp index e8f8ee6..e5eff33 100644 --- a/sources/extsysmon/sources/loadsource.cpp +++ b/sources/extsysmon/sources/loadsource.cpp @@ -25,19 +25,18 @@ LoadSource::LoadSource(QObject *parent, const QStringList args) : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 0); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } LoadSource::~LoadSource() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } QVariant LoadSource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; source.remove(QString("load/load")); @@ -47,7 +46,6 @@ QVariant LoadSource::data(QString source) QVariantMap LoadSource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; QVariantMap data; @@ -65,8 +63,6 @@ QVariantMap LoadSource::initialData(QString source) const QStringList LoadSource::sources() const { - qCDebug(LOG_ESM); - QStringList sources; for (int i = 0; i < 1000; i++) sources.append(QString("load/load%1").arg(i)); diff --git a/sources/extsysmon/sources/networksource.cpp b/sources/extsysmon/sources/networksource.cpp index f5beb52..2203000 100644 --- a/sources/extsysmon/sources/networksource.cpp +++ b/sources/extsysmon/sources/networksource.cpp @@ -27,19 +27,18 @@ NetworkSource::NetworkSource(QObject *parent, const QStringList args) : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 0); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } NetworkSource::~NetworkSource() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } QVariant NetworkSource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; if (source == QString("network/current/name")) { @@ -66,7 +65,6 @@ QVariant NetworkSource::data(QString source) QVariantMap NetworkSource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; QVariantMap data; @@ -84,8 +82,6 @@ QVariantMap NetworkSource::initialData(QString source) const QStringList NetworkSource::sources() const { - qCDebug(LOG_ESM); - QStringList sources; sources.append(QString("network/current/name")); diff --git a/sources/extsysmon/sources/playersource.cpp b/sources/extsysmon/sources/playersource.cpp index ad23865..61b4814 100644 --- a/sources/extsysmon/sources/playersource.cpp +++ b/sources/extsysmon/sources/playersource.cpp @@ -33,7 +33,7 @@ PlayerSource::PlayerSource(QObject *parent, const QStringList args) : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 5); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; m_player = args.at(0); 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() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } QVariant PlayerSource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; if (source == QString("player/title")) @@ -61,7 +60,6 @@ QVariant PlayerSource::data(QString source) QVariantMap PlayerSource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; QVariantMap data; @@ -148,8 +146,6 @@ QVariantMap PlayerSource::initialData(QString source) const void PlayerSource::run() { - qCDebug(LOG_ESM); - // initial data if (m_player == QString("mpd")) { // mpd @@ -187,8 +183,6 @@ void PlayerSource::run() QStringList PlayerSource::sources() const { - qCDebug(LOG_ESM); - QStringList sources; sources.append(QString("player/album")); sources.append(QString("player/dalbum")); @@ -221,8 +215,6 @@ QVariantHash PlayerSource::defaultInfo() const QString PlayerSource::getAutoMpris() const { - qCDebug(LOG_ESM); - QDBusMessage listServices = QDBusConnection::sessionBus().interface()->call( QDBus::BlockWithGui, QString("ListNames")); if (listServices.arguments().isEmpty()) @@ -244,7 +236,6 @@ QString PlayerSource::getAutoMpris() const QVariantHash PlayerSource::getPlayerMpdInfo(const QString mpdAddress) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "MPD" << mpdAddress; QVariantHash info = defaultInfo(); @@ -286,7 +277,6 @@ QVariantHash PlayerSource::getPlayerMpdInfo(const QString mpdAddress) const QVariantHash PlayerSource::getPlayerMprisInfo(const QString mpris) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "MPRIS" << mpris; QVariantHash info = defaultInfo(); @@ -356,7 +346,6 @@ QVariantHash PlayerSource::getPlayerMprisInfo(const QString mpris) const QString PlayerSource::buildString(const QString current, const QString value, const int s) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Current value" << current; qCDebug(LOG_ESM) << "New value" << value; 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 { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "New value" << value; qCDebug(LOG_ESM) << "Strip after" << s; diff --git a/sources/extsysmon/sources/processessource.cpp b/sources/extsysmon/sources/processessource.cpp index d9e2291..4a01b81 100644 --- a/sources/extsysmon/sources/processessource.cpp +++ b/sources/extsysmon/sources/processessource.cpp @@ -27,19 +27,18 @@ ProcessesSource::ProcessesSource(QObject *parent, const QStringList args) : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 0); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } ProcessesSource::~ProcessesSource() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } QVariant ProcessesSource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; if (source == QString("ps/running/count")) @@ -50,7 +49,6 @@ QVariant ProcessesSource::data(QString source) QVariantMap ProcessesSource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; QVariantMap data; @@ -80,8 +78,6 @@ QVariantMap ProcessesSource::initialData(QString source) const void ProcessesSource::run() { - qCDebug(LOG_ESM); - QStringList allDirectories = QDir(QString("/proc")) .entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name); @@ -109,8 +105,6 @@ void ProcessesSource::run() QStringList ProcessesSource::sources() const { - qCDebug(LOG_ESM); - QStringList sources; sources.append(QString("ps/running/count")); sources.append(QString("ps/running/list")); diff --git a/sources/extsysmon/sources/quotessource.cpp b/sources/extsysmon/sources/quotessource.cpp index c412573..d2f7e90 100644 --- a/sources/extsysmon/sources/quotessource.cpp +++ b/sources/extsysmon/sources/quotessource.cpp @@ -26,7 +26,7 @@ QuotesSource::QuotesSource(QObject *parent, const QStringList args) : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 0); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; extQuotes = new ExtItemAggregator(nullptr, QString("quotes")); m_sources = getSources(); @@ -35,7 +35,7 @@ QuotesSource::QuotesSource(QObject *parent, const QStringList args) QuotesSource::~QuotesSource() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; delete extQuotes; } @@ -43,7 +43,6 @@ QuotesSource::~QuotesSource() QVariant QuotesSource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; if (source.startsWith(QString("quotes/percpricechg"))) { @@ -58,7 +57,6 @@ QVariant QuotesSource::data(QString source) QVariantMap QuotesSource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; int ind = index(source); @@ -143,16 +141,12 @@ QVariantMap QuotesSource::initialData(QString source) const QStringList QuotesSource::sources() const { - qCDebug(LOG_ESM); - return m_sources; } QStringList QuotesSource::getSources() { - qCDebug(LOG_ESM); - QStringList sources; foreach (ExtQuotes *item, extQuotes->activeItems()) { sources.append(QString("quotes/%1").arg(item->tag(QString("ask")))); diff --git a/sources/extsysmon/sources/updatesource.cpp b/sources/extsysmon/sources/updatesource.cpp index aff6110..709cc8c 100644 --- a/sources/extsysmon/sources/updatesource.cpp +++ b/sources/extsysmon/sources/updatesource.cpp @@ -25,19 +25,18 @@ UpdateSource::UpdateSource(QObject *parent, const QStringList args) : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 0); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } UpdateSource::~UpdateSource() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; } QVariant UpdateSource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; return true; @@ -46,7 +45,6 @@ QVariant UpdateSource::data(QString source) QVariantMap UpdateSource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; QVariantMap data; @@ -64,8 +62,6 @@ QVariantMap UpdateSource::initialData(QString source) const QStringList UpdateSource::sources() const { - qCDebug(LOG_ESM); - QStringList sources; sources.append(QString("update")); diff --git a/sources/extsysmon/sources/upgradesource.cpp b/sources/extsysmon/sources/upgradesource.cpp index a6d088b..84bb579 100644 --- a/sources/extsysmon/sources/upgradesource.cpp +++ b/sources/extsysmon/sources/upgradesource.cpp @@ -26,7 +26,7 @@ UpgradeSource::UpgradeSource(QObject *parent, const QStringList args) : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 0); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; extUpgrade = new ExtItemAggregator(nullptr, QString("upgrade")); m_sources = getSources(); @@ -35,7 +35,7 @@ UpgradeSource::UpgradeSource(QObject *parent, const QStringList args) UpgradeSource::~UpgradeSource() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; delete extUpgrade; } @@ -43,7 +43,6 @@ UpgradeSource::~UpgradeSource() QVariant UpgradeSource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; // there are only one value @@ -53,7 +52,6 @@ QVariant UpgradeSource::data(QString source) QVariantMap UpgradeSource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; QVariantMap data; @@ -71,16 +69,12 @@ QVariantMap UpgradeSource::initialData(QString source) const QStringList UpgradeSource::sources() const { - qCDebug(LOG_ESM); - return m_sources; } QStringList UpgradeSource::getSources() { - qCDebug(LOG_ESM); - QStringList sources; foreach (ExtUpgrade *item, extUpgrade->activeItems()) sources.append( diff --git a/sources/extsysmon/sources/weathersource.cpp b/sources/extsysmon/sources/weathersource.cpp index 125e850..f805432 100644 --- a/sources/extsysmon/sources/weathersource.cpp +++ b/sources/extsysmon/sources/weathersource.cpp @@ -26,7 +26,7 @@ WeatherSource::WeatherSource(QObject *parent, const QStringList args) : AbstractExtSysMonSource(parent, args) { Q_ASSERT(args.count() == 0); - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; extWeather = new ExtItemAggregator(nullptr, QString("weather")); m_sources = getSources(); @@ -35,7 +35,7 @@ WeatherSource::WeatherSource(QObject *parent, const QStringList args) WeatherSource::~WeatherSource() { - qCDebug(LOG_ESM); + qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; delete extWeather; } @@ -43,7 +43,6 @@ WeatherSource::~WeatherSource() QVariant WeatherSource::data(QString source) { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; if (source.startsWith(QString("weather/weatherId"))) { @@ -58,7 +57,6 @@ QVariant WeatherSource::data(QString source) QVariantMap WeatherSource::initialData(QString source) const { - qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "Source" << source; int ind = index(source); @@ -111,16 +109,12 @@ QVariantMap WeatherSource::initialData(QString source) const QStringList WeatherSource::sources() const { - qCDebug(LOG_ESM); - return m_sources; } QStringList WeatherSource::getSources() { - qCDebug(LOG_ESM); - QStringList sources; foreach (ExtWeather *item, extWeather->activeItems()) { sources.append( diff --git a/sources/version.h.in b/sources/version.h.in index b2fc435..eec6074 100644 --- a/sources/version.h.in +++ b/sources/version.h.in @@ -1,6 +1,7 @@ #ifndef VERSION_H #define VERSION_H + // information #define NAME "Awesome Widgets" #define VERSION "@PROJECT_VERSION@" @@ -43,13 +44,24 @@ // cmake properties #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_MODULE_LINKER_FLAGS "@CMAKE_MODULE_LINKER_FLAGS@" +#define CMAKE_SHARED_LINKER_FLAGS "@CMAKE_SHARED_LINKER_FLAGS@" // components #define BUILD_PLASMOIDS "@BUILD_PLASMOIDS@" #define BUILD_DEB_PACKAGE "@BUILD_DEB_PACKAGE@" #define BUILD_RPM_PACKAGE "@BUILD_RPM_PACKAGE@" +#define CLANGFORMAT_EXECUTABLE "@CLANGFORMAT_EXECUTABLE@" +#define CPPCHECK_EXECUTABLE "@CPPCHECK_EXECUTABLE@" // additional functions #define PROP_FUTURE "@BUILD_FUTURE@" #define PROP_TEST "@BUILD_TESTING@" + #endif /* VERSION_H */