6
6
#include " i3pager.h"
7
7
8
8
#include < i3ipc++/ipc.hpp>
9
+ #include " i3pager_debug.h"
9
10
#include " i3listener.h"
10
11
#include < future>
11
12
#include < QDebug>
@@ -16,7 +17,7 @@ I3Pager::I3Pager(QObject* parent)
16
17
currentScreenPrivate = QString ();
17
18
mode = " default" ;
18
19
19
- qDebug ( ) << " Starting i3 listener" ;
20
+ qCDebug (I3PAGER ) << " Starting i3 listener" ;
20
21
this ->i3ListenerThread = new I3ListenerThread (this );
21
22
connect (i3ListenerThread, &I3ListenerThread::modeChanged, this , [=](const QString& mode) {
22
23
this ->mode = mode;
@@ -27,14 +28,14 @@ I3Pager::I3Pager(QObject* parent)
27
28
});
28
29
connect (i3ListenerThread, &I3ListenerThread::finished, i3ListenerThread, &QObject::deleteLater);
29
30
i3ListenerThread->start ();
30
- qDebug ( ) << " i3 listener started" ;
31
+ qCDebug (I3PAGER ) << " i3 listener started" ;
31
32
}
32
33
33
34
I3Pager::~I3Pager () {
34
- qDebug ( ) << " I3Pager destructor" ;
35
+ qCDebug (I3PAGER ) << " I3Pager destructor" ;
35
36
this ->i3ListenerThread ->stop ();
36
37
this ->i3ListenerThread ->wait ();
37
- qDebug ( ) << " I3Pager destructor done" ;
38
+ qCDebug (I3PAGER ) << " I3Pager destructor done" ;
38
39
}
39
40
40
41
QList<QString> I3Pager::getScreenNames () {
@@ -46,11 +47,11 @@ QList<QString> I3Pager::getScreenNames() {
46
47
for (auto & screen : screens) {
47
48
if (screen->active ) {
48
49
screenList.append (QString::fromStdString (screen->name ));
49
- qDebug ( ) << " Screen name:" << QString::fromStdString (screen->name );
50
+ qCDebug (I3PAGER ) << " Screen name:" << QString::fromStdString (screen->name );
50
51
}
51
52
}
52
53
} catch (std::exception const & e) {
53
- qWarning ( ) << " Exception while retrieving screen names: " << e.what ();
54
+ qCWarning (I3PAGER ) << " Exception while retrieving screen names: " << e.what ();
54
55
}
55
56
56
57
return screenList;
@@ -61,7 +62,7 @@ QList<Workspace> I3Pager::getWorkspaces(bool filterByCurrentScreen, QString orde
61
62
try {
62
63
i3ipc::connection conn;
63
64
auto i3workspaceList = conn.get_workspaces ();
64
- qDebug ( ) << " Loading workspaces:" ;
65
+ qCDebug (I3PAGER ) << " Loading workspaces:" ;
65
66
66
67
for (auto & i3workspace : i3workspaceList) {
67
68
Workspace workspace;
@@ -77,8 +78,8 @@ QList<Workspace> I3Pager::getWorkspaces(bool filterByCurrentScreen, QString orde
77
78
workspace.visible = i3workspace->visible ;
78
79
workspace.urgent = i3workspace->urgent ;
79
80
80
- qDebug ( ) << " i3Workspace name:" << QString::fromStdString (i3workspace->name );
81
- qDebug ( ) << " Workspace:"
81
+ qCDebug (I3PAGER ) << " i3Workspace name:" << QString::fromStdString (i3workspace->name );
82
+ qCDebug (I3PAGER ) << " Workspace:"
82
83
<< " id:" << workspace.id
83
84
<< " index:" << workspace.index
84
85
<< " name:" << workspace.name
@@ -90,7 +91,7 @@ QList<Workspace> I3Pager::getWorkspaces(bool filterByCurrentScreen, QString orde
90
91
workspaceList.append (workspace);
91
92
}
92
93
} catch (std::exception const & e) {
93
- qWarning ( ) << " Exception while retrieving workspaces:" << e.what ();
94
+ qCWarning (I3PAGER ) << " Exception while retrieving workspaces:" << e.what ();
94
95
}
95
96
96
97
if (filterByCurrentScreen) {
0 commit comments