From 93abb863409c18ae0322d5b722346687f3a1b825 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Thu, 28 Aug 2014 15:35:57 +0400 Subject: [PATCH] update to use submodules --- sources/CMakeLists.txt | 1 + sources/desktop-panel/CMakeLists.txt | 7 +- sources/desktop-panel/desktop-panel.cpp | 66 +++++++------- sources/ext-sysmon/CMakeLists.txt | 11 ++- sources/ext-sysmon/extsysmon.cpp | 113 ++++++++++++------------ sources/ext-sysmon/task.h | 1 - sources/ext-sysmon/taskadds.cpp | 1 - sources/ext-sysmon/taskadds.h | 1 - 8 files changed, 105 insertions(+), 96 deletions(-) delete mode 120000 sources/ext-sysmon/task.h delete mode 120000 sources/ext-sysmon/taskadds.cpp delete mode 120000 sources/ext-sysmon/taskadds.h diff --git a/sources/CMakeLists.txt b/sources/CMakeLists.txt index 788f639..bfc5082 100644 --- a/sources/CMakeLists.txt +++ b/sources/CMakeLists.txt @@ -10,6 +10,7 @@ set (PROJECT_VERSION_MAJOR 1) set (PROJECT_VERSION_MINOR 11) set (PROJECT_VERSION_PATCH 0) set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}) +set (PROJECT_TRDPARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty) message (STATUS "Version: ${PROJECT_VERSION}") diff --git a/sources/desktop-panel/CMakeLists.txt b/sources/desktop-panel/CMakeLists.txt index 02cbf17..dc6f03d 100644 --- a/sources/desktop-panel/CMakeLists.txt +++ b/sources/desktop-panel/CMakeLists.txt @@ -9,7 +9,12 @@ add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) add_subdirectory (po) include (KDE4Defaults) -include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../) +include_directories (${CMAKE_SOURCE_DIR} + ${CMAKE_BINARY_DIR} + ${KDE4_INCLUDES} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/../ + ${PROJECT_TRDPARTY_DIR}) # set sources set (PLUGIN_NAME ${SUBPROJECT}) diff --git a/sources/desktop-panel/desktop-panel.cpp b/sources/desktop-panel/desktop-panel.cpp index 966a1d8..45cd1e9 100644 --- a/sources/desktop-panel/desktop-panel.cpp +++ b/sources/desktop-panel/desktop-panel.cpp @@ -16,8 +16,6 @@ ***************************************************************************/ #include "desktop-panel.h" -#include "ui_appearance.h" -#include "ui_widget.h" #include #include @@ -34,6 +32,8 @@ #include #include +#include + CustomPlasmaLabel::CustomPlasmaLabel(DesktopPanel *wid, const int num) : Plasma::Label(wid), @@ -48,7 +48,7 @@ CustomPlasmaLabel::CustomPlasmaLabel(DesktopPanel *wid, const int num) else debug = false; - if (debug) qDebug() << "[PTM-DP]" << "Init label" << number; + if (debug) qDebug() << PDEBUG << ":" << "Init label" << number; } @@ -59,7 +59,7 @@ CustomPlasmaLabel::~CustomPlasmaLabel() int CustomPlasmaLabel::getNumber() { - if (debug) qDebug() << "[PTM-DP]" << "[" << number << "]" << "[getNumber]"; + if (debug) qDebug() << PDEBUG; return number; } @@ -67,8 +67,8 @@ int CustomPlasmaLabel::getNumber() void CustomPlasmaLabel::mousePressEvent(QGraphicsSceneMouseEvent *event) { - if (debug) qDebug() << "[PTM-DP]" << "[" << number << "]" << "[mouseMoveEvent]"; - if (debug) qDebug() << "[PTM-DP]" << "[" << number << "]" << "[mouseMoveEvent]" << "Get signal" << event->button(); + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Get signal" << event->button(); if (event->button() == Qt::LeftButton) widget->setCurrentDesktop(number); @@ -106,7 +106,7 @@ DesktopPanel::~DesktopPanel() void DesktopPanel::init() { - if (debug) qDebug() << "[PTM-DP]" << "[init]"; + if (debug) qDebug() << PDEBUG; extsysmonEngine = dataEngine(QString("ext-sysmon")); @@ -124,11 +124,11 @@ void DesktopPanel::init() QStringList DesktopPanel::getDesktopNames() { - if (debug) qDebug() << "[PTM-DP]" << "[getDesktopNames]"; + if (debug) qDebug() << PDEBUG; QStringList list; QString fileName = KGlobal::dirs()->findResource("config", "kwinrc"); - if (debug) qDebug() << "[PTM-DP]" << "[getDesktopNames]" << ":" << "Configuration file" << fileName; + if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName; QFile configFile(fileName); if (!configFile.open(QIODevice::ReadOnly)) return list; @@ -161,7 +161,7 @@ QStringList DesktopPanel::getDesktopNames() QList DesktopPanel::getPanels() { - if (debug) qDebug() << "[PTM-DP]" << "[getPanels]"; + if (debug) qDebug() << PDEBUG; QList panels; for (int i=0; icorona()->containments().count(); i++) @@ -174,8 +174,8 @@ QList DesktopPanel::getPanels() QString DesktopPanel::panelLocationToStr(Plasma::Location loc) { - if (debug) qDebug() << "[PTM-DP]" << "[panelLocationToStr]"; - if (debug) qDebug() << "[PTM-DP]" << "[panelLocationToStr]" << ":" << "Location" << loc; + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Location" << loc; switch(loc) { case Plasma::TopEdge: @@ -194,9 +194,9 @@ QString DesktopPanel::panelLocationToStr(Plasma::Location loc) QString DesktopPanel::parsePattern(const QString rawLine, const int num) { - if (debug) qDebug() << "[PTM-DP]" << "[parsePattern]"; - if (debug) qDebug() << "[PTM-DP]" << "[parsePattern]" << "Run function with raw line" << rawLine; - if (debug) qDebug() << "[PTM-DP]" << "[parsePattern]" << "Run function with number" << num; + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Run function with raw line" << rawLine; + if (debug) qDebug() << PDEBUG << ":" << "Run function with number" << num; QString line, mark; line = rawLine; @@ -205,19 +205,19 @@ QString DesktopPanel::parsePattern(const QString rawLine, const int num) else mark = QString(""); if (line.split(QString("$mark"))[0] != line) { - if (debug) qDebug() << "[PTM-DP]" << "[parsePattern]" << "Found mark"; + if (debug) qDebug() << PDEBUG << ":" << "Found mark"; line = line.split(QString("$mark"))[0] + mark + line.split(QString("$mark"))[1]; } if (line.split(QString("$name"))[0] != line) { - if (debug) qDebug() << "[PTM-DP]" << "[parsePattern]" << "Found name"; + if (debug) qDebug() << PDEBUG << ":" << "Found name"; line = line.split(QString("$name"))[0] + desktopNames[num] + line.split(QString("$name"))[1]; } if (line.split(QString("$number"))[0] != line) { - if (debug) qDebug() << "[PTM-DP]" << "[parsePattern]" << "Found number"; + if (debug) qDebug() << PDEBUG << ":" << "Found number"; line = line.split(QString("$number"))[0] + QString::number(num + 1) + line.split(QString("$number"))[1]; } if (line.split(QString("$total"))[0] != line) { - if (debug) qDebug() << "[PTM-DP]" << "[parsePattern]" << "Found total"; + if (debug) qDebug() << PDEBUG << ":" << "Found total"; line = line.split(QString("$total"))[0] + QString::number(desktopNames.count()) + line.split(QString("$total"))[1]; } @@ -227,7 +227,7 @@ QString DesktopPanel::parsePattern(const QString rawLine, const int num) void DesktopPanel::reinit() { - if (debug) qDebug() << "[PTM-DP]" << "[reinit]"; + if (debug) qDebug() << PDEBUG; // clear // labels @@ -270,7 +270,7 @@ void DesktopPanel::reinit() void DesktopPanel::changePanelsState() { - if (debug) qDebug() << "[PTM-DP]" << "[changePanelsState]"; + if (debug) qDebug() << PDEBUG; QList panels = getPanels(); for (int i=0; iview()->isVisible(); int winId = panels[i]->view()->winId(); if (wasVisible) { - if (debug) qDebug() << "[PTM-DP]" << "[changePanelsState]" << ":" << "Hide panel"; + if (debug) qDebug() << PDEBUG << ":" << "Hide panel"; KWindowInfo oldInfo = KWindowSystem::windowInfo(winId, NET::WMState); oldState = oldInfo.state(); panels[i]->view()->setVisible(false); } else { - if (debug) qDebug() << "[PTM-DP]" << "[changePanelsState]" << ":" << "Show panel"; + if (debug) qDebug() << PDEBUG << ":" << "Show panel"; panels[i]->view()->setVisible(true); KWindowSystem::clearState(winId, NET::KeepAbove); KWindowSystem::setState(winId, oldState | NET::StaysOnTop); @@ -298,11 +298,11 @@ void DesktopPanel::changePanelsState() void DesktopPanel::setCurrentDesktop(const int number) { - if (debug) qDebug() << "[PTM-DP]" << "[setCurrentDesktop]"; - if (debug) qDebug() << "[PTM-DP]" << "[setCurrentDesktop]" << "Set desktop" << number + 1; + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Set desktop" << number + 1; QString cmd = parsePattern(configuration[QString("desktopcmd")], number); - if (debug) qDebug() << "[PTM-DP]" << "[setCurrentDesktop]" << "Run cmd " << cmd; + if (debug) qDebug() << PDEBUG << ":" << "Run cmd " << cmd; QProcess command; command.startDetached(cmd); @@ -311,12 +311,12 @@ void DesktopPanel::setCurrentDesktop(const int number) void DesktopPanel::updateText() { - if (debug) qDebug() << "[PTM-DP]" << "[updateText]"; + if (debug) qDebug() << PDEBUG; if (labels.isEmpty()) return; QString line, text; for (int i=0; idisconnectSource(QString("desktop"), this); KConfigGroup cg = config(); @@ -470,7 +470,7 @@ void DesktopPanel::configAccepted() void DesktopPanel::configChanged() { - if (debug) qDebug() << "[PTM-DP]" << "[configChanged]"; + if (debug) qDebug() << PDEBUG; KConfigGroup cg = config(); diff --git a/sources/ext-sysmon/CMakeLists.txt b/sources/ext-sysmon/CMakeLists.txt index 0c87dd1..3355f57 100644 --- a/sources/ext-sysmon/CMakeLists.txt +++ b/sources/ext-sysmon/CMakeLists.txt @@ -6,13 +6,18 @@ find_package (KDE4 REQUIRED) include (KDE4Defaults) add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) -include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../) +include_directories (${CMAKE_SOURCE_DIR} + ${CMAKE_BINARY_DIR} + ${KDE4_INCLUDES} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/../ + ${PROJECT_TRDPARTY_DIR}) set (PLUGIN_NAME ${SUBPROJECT}) file (GLOB SUBPROJECT_DESKTOP_IN *.desktop) file (RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN}) -file (GLOB SUBPROJECT_SOURCE *.cpp) -set (TASK_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/task.h) +file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp) +set (TASK_HEADER ${PROJECT_TRDPARTY_DIR}/task/task.h) file (GLOB SUBPROJECT_CONF *.conf) # prepare diff --git a/sources/ext-sysmon/extsysmon.cpp b/sources/ext-sysmon/extsysmon.cpp index b91d1d7..6bc45a2 100644 --- a/sources/ext-sysmon/extsysmon.cpp +++ b/sources/ext-sysmon/extsysmon.cpp @@ -28,7 +28,8 @@ #include #include -#include "taskadds.h" +#include +#include ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList& args) @@ -51,32 +52,32 @@ ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList& args) QString ExtendedSysMon::getAllHdd() { - if (debug) qDebug() << "[DE]" << "[getAllHdd]"; + if (debug) qDebug() << PDEBUG; QStringList devices; QString cmd = QString("find /dev -name [hms]d[a-z]"); - if (debug) qDebug() << "[DE]" << "[getAllHdd]" << ":" << "cmd" << cmd; + if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; TaskResult process = runTask(cmd); - if (debug) qDebug() << "[DE]" << "[getAllHdd]" << ":" << "Cmd returns" << process.exitCode; + if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output); for (int i=0; itoUnicode(process.output); if (qoutput.toLower().contains("nvidia")) @@ -84,36 +85,36 @@ QString ExtendedSysMon::getAutoGpu() else if (qoutput.toLower().contains("radeon")) gpu = QString("ati"); - if (debug) qDebug() << "[DE]" << "[getAutoGpu]" << ":" << "Device" << gpu; + if (debug) qDebug() << PDEBUG << ":" << "Device" << gpu; return gpu; } QString ExtendedSysMon::getAutoMpris() { - if (debug) qDebug() << "[DE]" << "[getAutoMpris]"; + if (debug) qDebug() << PDEBUG; QString mpris; QString cmd = QString("bash -c \"qdbus 'org.mpris.MediaPlayer2.*'\""); - if (debug) qDebug() << "[DE]" << "[getAutoMpris]" << ":" << "cmd" << cmd; + if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; TaskResult process = runTask(cmd); QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); if (qoutput.split(QChar('\n'))[0].split(QChar('.')).count() > 3) mpris = qoutput.split(QChar('\n'))[0].split(QChar('.'))[3]; - if (debug) qDebug() << "[DE]" << "[getAutoMpris]" << ":" << "Player found" << mpris; + if (debug) qDebug() << PDEBUG << ":" << "Player found" << mpris; return mpris; } QStringList ExtendedSysMon::getDesktopNames() { - if (debug) qDebug() << "[DE]" << "[getDesktopNames]"; + if (debug) qDebug() << PDEBUG; QStringList list; QString fileName = KGlobal::dirs()->findResource("config", "kwinrc"); - if (debug) qDebug() << "[DE]" << "[getDesktopNames]" << ":" << "Configuration file" << fileName; + if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName; QFile configFile(fileName); if (!configFile.open(QIODevice::ReadOnly)) return list; @@ -146,7 +147,7 @@ QStringList ExtendedSysMon::getDesktopNames() QStringList ExtendedSysMon::sources() const { - if (debug) qDebug() << "[DE]" << "[sources]"; + if (debug) qDebug() << PDEBUG; QStringList source; source.append(QString("custom")); @@ -158,14 +159,14 @@ QStringList ExtendedSysMon::sources() const source.append(QString("player")); source.append(QString("ps")); - if (debug) qDebug() << "[DE]" << "[sources]" << ":" << "Sources" << source; + if (debug) qDebug() << PDEBUG << ":" << "Sources" << source; return source; } void ExtendedSysMon::readConfiguration() { - if (debug) qDebug() << "[DE]" << "[readConfiguration]"; + if (debug) qDebug() << PDEBUG; // pre-setup QMap rawConfig; @@ -183,7 +184,7 @@ void ExtendedSysMon::readConfiguration() rawConfig[QString("PLAYER")] = QString("mpris"); QString fileName = KGlobal::dirs()->findResource("config", "extsysmon.conf"); - if (debug) qDebug() << "[DE]" << "[readConfiguration]" << ":" << "Configuration file" << fileName; + if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName; QFile configFile(fileName); if (!configFile.open(QIODevice::ReadOnly)) { configuration = updateConfiguration(rawConfig); @@ -212,7 +213,7 @@ void ExtendedSysMon::readConfiguration() QMap ExtendedSysMon::updateConfiguration(const QMap rawConfig) { - if (debug) qDebug() << "[DE]" << "[updateConfiguration]"; + if (debug) qDebug() << PDEBUG; QMap config; QString key, value; @@ -268,7 +269,7 @@ QMap ExtendedSysMon::updateConfiguration(const QMaptoUnicode(process.output).trimmed(); int number = qoutput.toInt(); @@ -296,11 +297,11 @@ QMap ExtendedSysMon::getCurrentDesktop(const QString cmd) QString ExtendedSysMon::getCustomCmd(const QString cmd) { - if (debug) qDebug() << "[DE]" << "[getCustomCmd]"; - if (debug) qDebug() << "[DE]" << "[getCustomCmd]" << ":" << "cmd" << cmd; + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; TaskResult process = runTask(QString("bash -c \"") + cmd + QString("\"")); - if (debug) qDebug() << "[DE]" << "[getCustomCmd]" << ":" << "Cmd returns" << process.exitCode; + if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; return QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); } @@ -308,8 +309,8 @@ QString ExtendedSysMon::getCustomCmd(const QString cmd) float ExtendedSysMon::getGpu(const QString device) { - if (debug) qDebug() << "[DE]" << "[getGpu]"; - if (debug) qDebug() << "[DE]" << "[getGpu]" << ":" << "Device" << device; + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Device" << device; float value = 0.0; if ((device != QString("nvidia")) && (device != QString("ati"))) @@ -319,9 +320,9 @@ float ExtendedSysMon::getGpu(const QString device) cmd = QString("nvidia-smi -q -d UTILIZATION"); else if (device == QString("ati")) cmd = QString("aticonfig --od-getclocks"); - if (debug) qDebug() << "[DE]" << "[getGpu]" << ":" << "cmd" << cmd; + if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; TaskResult process = runTask(QString("bash -c \"") + cmd + QString("\"")); - if (debug) qDebug() << "[DE]" << "[getGpu]" << ":" << "Cmd returns" << process.exitCode; + if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); if (configuration[QString("GPUDEV")] == QString("nvidia")) @@ -349,8 +350,8 @@ float ExtendedSysMon::getGpu(const QString device) float ExtendedSysMon::getGpuTemp(const QString device) { - if (debug) qDebug() << "[DE]" << "[getGpuTemp]"; - if (debug) qDebug() << "[DE]" << "[getGpuTemp]" << ":" << "Device" << device; + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Device" << device; float value = 0.0; if ((device != QString("nvidia")) && (device != QString("ati"))) @@ -360,9 +361,9 @@ float ExtendedSysMon::getGpuTemp(const QString device) cmd = QString("nvidia-smi -q -d TEMPERATURE"); else if (device == QString("ati")) cmd = QString("aticonfig --od-gettemperature"); - if (debug) qDebug() << "[DE]" << "[getGpuTemp]" << ":" << "cmd" << cmd; + if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; TaskResult process = runTask(QString("bash -c \"") + cmd + QString("\"")); - if (debug) qDebug() << "[DE]" << "[getGpuTemp]" << ":" << "Cmd returns" << process.exitCode; + if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output); if (configuration[QString("GPUDEV")] == QString("nvidia")) @@ -388,13 +389,13 @@ float ExtendedSysMon::getGpuTemp(const QString device) float ExtendedSysMon::getHddTemp(const QString cmd, const QString device) { - if (debug) qDebug() << "[DE]" << "[getHddTemp]"; - if (debug) qDebug() << "[DE]" << "[getHddTemp]" << ":" << "cmd" << cmd; - if (debug) qDebug() << "[DE]" << "[getHddTemp]" << ":" << "Device" << device; + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; + if (debug) qDebug() << PDEBUG << ":" << "Device" << device; float value = 0.0; TaskResult process = runTask(cmd + QString(" ") + device); - if (debug) qDebug() << "[DE]" << "[getHddTemp]" << ":" << "Cmd returns" << process.exitCode; + if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); if (qoutput.split(QChar(':'), QString::SkipEmptyParts).count() >= 3) { @@ -412,10 +413,10 @@ QMap ExtendedSysMon::getPlayerInfo(const QString playerName, const QString mpdPort, QString mpris) { - if (debug) qDebug() << "[DE]" << "[getPlayerInfo]"; - if (debug) qDebug() << "[DE]" << "[getPlayerInfo]" << ":" << "player" << playerName; - if (debug) qDebug() << "[DE]" << "[getPlayerInfo]" << ":" << "MPD" << mpdAddress + QString(":") + mpdPort; - if (debug) qDebug() << "[DE]" << "[getPlayerInfo]" << ":" << "MPRIS" << mpris; + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "player" << playerName; + if (debug) qDebug() << PDEBUG << ":" << "MPD" << mpdAddress + QString(":") + mpdPort; + if (debug) qDebug() << PDEBUG << ":" << "MPRIS" << mpris; QMap info; info[QString("album")] = QString("unknown"); @@ -436,9 +437,9 @@ QMap ExtendedSysMon::getPlayerInfo(const QString playerName, cmd = QString("bash -c \"qdbus org.mpris.%1 /Player GetMetadata && qdbus org.mpris.%1 /Player PositionGet\"") .arg(mpris); } - if (debug) qDebug() << "[DE]" << "[getPlayerInfo]" << ":" << "cmd" << cmd; + if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; TaskResult process = runTask(cmd); - if (debug) qDebug() << "[DE]" << "[getPlayerInfo]" << ":" << "Cmd returns" << process.exitCode; + if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); QString qstr = QString(""); @@ -483,14 +484,14 @@ QMap ExtendedSysMon::getPlayerInfo(const QString playerName, QMap ExtendedSysMon::getPsStats() { - if (debug) qDebug() << "[DE]" << "[getPsStats]"; + if (debug) qDebug() << PDEBUG; QMap psStats; QString cmd, qoutput; cmd = QString("ps --no-headers -o command"); - if (debug) qDebug() << "[DE]" << "[getPsStats]" << ":" << "Run cmd" << cmd; + if (debug) qDebug() << PDEBUG << ":" << "Run cmd" << cmd; TaskResult process = runTask(cmd); - if (debug) qDebug() << "[DE]" << "[getPsStats]" << ":" << "Cmd returns" << process.exitCode; + if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); QStringList psList; @@ -501,9 +502,9 @@ QMap ExtendedSysMon::getPsStats() psStats[QString("ps")] = psList.join(QString(",")); cmd = QString("ps -e --no-headers -o command"); - if (debug) qDebug() << "[DE]" << "[getPsStats]" << ":" << "Run cmd" << cmd; + if (debug) qDebug() << PDEBUG << ":" << "Run cmd" << cmd; process = runTask(cmd); - if (debug) qDebug() << "[DE]" << "[getPsStats]" << ":" << "Cmd returns" << process.exitCode; + if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); psStats[QString("psTotal")] = qoutput.split(QChar('\n'), QString::SkipEmptyParts).count(); @@ -514,11 +515,11 @@ QMap ExtendedSysMon::getPsStats() int ExtendedSysMon::getUpgradeInfo(const QString cmd) { - if (debug) qDebug() << "[DE]" << "[getUpgradeInfo]"; - if (debug) qDebug() << "[DE]" << "[getUpgradeInfo]" << ":" << "cmd" << cmd; + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; TaskResult process = runTask(QString("bash -c \"") + cmd + QString("\"")); - if (debug) qDebug() << "[DE]" << "[getUpgradeInfo]" << ":" << "Cmd returns" << process.exitCode; + if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode; QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed(); int count = 0; @@ -532,8 +533,8 @@ int ExtendedSysMon::getUpgradeInfo(const QString cmd) bool ExtendedSysMon::sourceRequestEvent(const QString &source) { - if (debug) qDebug() << "[DE]" << "[sourceRequestEvent]"; - if (debug) qDebug() << "[DE]" << "[sourceRequestEvent]" << ":" << "Source" << source; + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Source" << source; return updateSourceEvent(source); } @@ -541,8 +542,8 @@ bool ExtendedSysMon::sourceRequestEvent(const QString &source) bool ExtendedSysMon::updateSourceEvent(const QString &source) { - if (debug) qDebug() << "[DE]" << "[updateSourceEvent]"; - if (debug) qDebug() << "[DE]" << "[updateSourceEvent]" << ":" << "Source" << source; + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Source" << source; if (source == QString("custom")) { for (int i=0; i