mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-09-08 08:39:57 +00:00
implement datetime logging feature
This commit is contained in:
@ -21,7 +21,8 @@ include_directories (${CMAKE_SOURCE_DIR}
|
||||
${Qt_INCLUDE}
|
||||
${Kf5_INCLUDE})
|
||||
|
||||
file (GLOB SUBPROJECT_SOURCE *.cpp)
|
||||
file (GLOB_RECURSE SUBPROJECT_SOURCE ${PROJECT_TRDPARTY_DIR}/pdebug/*.cpp
|
||||
*.cpp)
|
||||
file (GLOB SUBPROJECT_NOTIFY *.notifyrc)
|
||||
|
||||
add_library (${PLUGIN_NAME} SHARED ${SUBPROJECT_SOURCE})
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include <pdebug/pdebug.h>
|
||||
#include <pdebug/pdebug-time.h>
|
||||
|
||||
#include "netctladds.h"
|
||||
#include "version.h"
|
||||
@ -35,6 +36,7 @@
|
||||
NetctlAdds::NetctlAdds(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
qInstallMessageHandler(debugString);
|
||||
// debug
|
||||
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
|
||||
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
|
||||
@ -169,6 +171,13 @@ void NetctlAdds::setDataBySource(const QString sourceName, const QVariantMap dat
|
||||
|
||||
void NetctlAdds::sendNotification(const QString eventId, const QString message)
|
||||
{
|
||||
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
|
||||
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
|
||||
bool debugLocal = (debugEnv == QString("yes"));
|
||||
if (debugLocal) qDebug() << PDEBUG;
|
||||
if (debugLocal) qDebug() << PDEBUG << ":" << "Event" << eventId;
|
||||
if (debugLocal) qDebug() << PDEBUG << ":" << "Message" << message;
|
||||
|
||||
KNotification *notification = KNotification::event(eventId, QString("Netctl ::: %1").arg(eventId), message);
|
||||
notification->setComponentName(QString("plasma-applet-org.kde.plasma.netctl"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user