add option to debug timers

--this is especially useful in order to be sure that
there are timers that create unending loops
pull/2/head
Michail Vourlakos 7 years ago
parent 51f879d2a2
commit 88108ac524

@ -81,10 +81,11 @@ int main(int argc, char **argv)
parser.addOptions({ parser.addOptions({
{{"r", "replace"}, i18nc("command line", "Replace the current dock instance.")} {{"r", "replace"}, i18nc("command line", "Replace the current dock instance.")}
, {{"d", "debug"}, i18nc("command line", "Show the debugging messages on stdout.")} , {{"d", "debug"}, i18nc("command line", "Show the debugging messages on stdout.")}
, {"mask", i18nc("command line" , "Show messages of debugging for the mask (Only useful to devs).")}
, {"graphics", i18nc("command line", "Draw boxes around of the applets.")} , {"graphics", i18nc("command line", "Draw boxes around of the applets.")}
, {"with-window", i18nc("command line", "Open a window with much debug information.")} , {"with-window", i18nc("command line", "Open a window with much debug information.")}
, {"import", i18nc("command line", "Import configuration."), i18nc("command line: import", "file_name")} , {"import", i18nc("command line", "Import configuration."), i18nc("command line: import", "file_name")}
, {"mask", i18nc("command line" , "Show messages of debugging for the mask (Only useful to devs).")}
, {"timers", i18nc("command line", "Show messages for debugging the timers (Only useful to devs).")}
}); });
parser.process(app); parser.process(app);

@ -131,7 +131,13 @@ Item {
Timer { Timer {
id: fakeInitTimer id: fakeInitTimer
interval: 4000 interval: 4000
onTriggered: AppletIndetifier.reconsiderAppletIconItem(); onTriggered: {
AppletIndetifier.reconsiderAppletIconItem();
if (root.debugModeTimers) {
console.log("containment timer: appletItem fakeInitTimer called...");
}
}
} }
//set up the fake containers and properties for when a fakeIconItem must be presented to the user //set up the fake containers and properties for when a fakeIconItem must be presented to the user

@ -49,6 +49,7 @@ DragDrop.DropArea {
////BEGIN properties ////BEGIN properties
property bool debugMode: Qt.application.arguments.indexOf("--graphics")>=0 property bool debugMode: Qt.application.arguments.indexOf("--graphics")>=0
property bool debugModeWindow: Qt.application.arguments.indexOf("--with-window")>=0 property bool debugModeWindow: Qt.application.arguments.indexOf("--with-window")>=0
property bool debugModeTimers: Qt.application.arguments.indexOf("--timers")>=0
property bool globalDirectRender: false //it is used as a globalDirectRender for all elements in the dock property bool globalDirectRender: false //it is used as a globalDirectRender for all elements in the dock
property bool directRenderTimerIsRunning: enableDirectRenderTimer.running property bool directRenderTimerIsRunning: enableDirectRenderTimer.running
property int directRenderAnimationTime: 0 property int directRenderAnimationTime: 0
@ -1268,7 +1269,13 @@ DragDrop.DropArea {
Timer { Timer {
id: showTitleTooltipTimer id: showTitleTooltipTimer
interval: 100 interval: 100
onTriggered: titleTooltipDialog.update(); onTriggered: {
titleTooltipDialog.update();
if (root.debugModeTimers) {
console.log("containment timer: showTitleTooltipTimer called...");
}
}
} }
Timer { Timer {
@ -1278,6 +1285,11 @@ DragDrop.DropArea {
if (!titleTooltipDialog.activeItemHovered) { if (!titleTooltipDialog.activeItemHovered) {
titleTooltipDialog.visible = false; titleTooltipDialog.visible = false;
} }
if (root.debugModeTimers) {
console.log("containment timer: hideTitleTooltipTimer called...");
}
} }
} }
/////END: Title Tooltip/////////// /////END: Title Tooltip///////////
@ -1431,6 +1443,10 @@ DragDrop.DropArea {
root.globalDirectRender = false; root.globalDirectRender = false;
root.clearZoom(); root.clearZoom();
} }
if (root.debugModeTimers) {
console.log("containment timer: checkRestoreZoom called...");
}
} }
} }
@ -1446,6 +1462,10 @@ DragDrop.DropArea {
if (dock.visibility.containsMouse) if (dock.visibility.containsMouse)
root.globalDirectRender = true; root.globalDirectRender = true;
if (root.debugModeTimers) {
console.log("containment timer: enableDirectRenderTimer called...");
}
} }
} }
@ -1465,6 +1485,10 @@ DragDrop.DropArea {
} }
visibilityManager.updateMaskArea(); visibilityManager.updateMaskArea();
if (root.debugModeTimers) {
console.log("containment timer: delayUpdateMaskArea called...");
}
} }
} }

@ -424,7 +424,13 @@ Item {
Timer { Timer {
id: showPreviewWinTimer id: showPreviewWinTimer
interval: 50 interval: 50
onTriggered: windowsPreviewDlg.visible = true; onTriggered: {
windowsPreviewDlg.visible = true;
if (latteDock && latteDock.debugModeTimers) {
console.log("plasmoid timer: showPreviewTimer called...");
}
}
} }
//! Timer to fix a crash that when going to Alternative Session through Context Menu, //! Timer to fix a crash that when going to Alternative Session through Context Menu,
@ -444,6 +450,10 @@ Item {
} }
latteDock.universalLayoutManager.switchToLayout(toLayout); latteDock.universalLayoutManager.switchToLayout(toLayout);
if (latteDock && latteDock.debugModeTimers) {
console.log("plasmoid timer: switchLayoutTimer called...");
}
} }
} }
@ -458,6 +468,10 @@ Item {
onTriggered: { onTriggered: {
tasksModel.requestClose(delayWindowRemovalTimer.modelIndex) tasksModel.requestClose(delayWindowRemovalTimer.modelIndex)
if (latteDock && latteDock.debugModeTimers) {
console.log("plasmoid timer: delayWindowRemovalTimer called...");
}
} }
} }
@ -467,6 +481,10 @@ Item {
onTriggered: { onTriggered: {
root.inActivityChange = false; root.inActivityChange = false;
activityInfo.previousActivity = activityInfo.currentActivity; activityInfo.previousActivity = activityInfo.currentActivity;
if (latteDock && latteDock.debugModeTimers) {
console.log("plasmoid timer: activityChangeDelayer called...");
}
} }
} }
@ -752,6 +770,10 @@ Item {
onTriggered: { onTriggered: {
plasmoid.status = PlasmaCore.Types.PassiveStatus; plasmoid.status = PlasmaCore.Types.PassiveStatus;
destroy(); destroy();
if (latteDock && latteDock.debugModeTimers) {
console.log("plasmoid timer: attentionTimer called...");
}
} }
Component.onCompleted: { Component.onCompleted: {
start(); start();
@ -787,6 +809,10 @@ Item {
} }
interval = normalInterval; interval = normalInterval;
if (latteDock && latteDock.debugModeTimers) {
console.log("plasmoid timer: checkListHovered called...");
}
} }
function startNormal(){ function startNormal(){
@ -818,6 +844,10 @@ Item {
restart(); restart();
else else
icList.directRender = true; icList.directRender = true;
if (latteDock && latteDock.debugModeTimers) {
console.log("plasmoid timer: enableDirectRenderTimer called...");
}
} }
} }
@ -1099,6 +1129,10 @@ Item {
onTriggered: { onTriggered: {
// console.debug("Found children: "+icList.contentItem.children.length); // console.debug("Found children: "+icList.contentItem.children.length);
TaskTools.publishIconGeometries(icList.contentItem.children); TaskTools.publishIconGeometries(icList.contentItem.children);
if (latteDock && latteDock.debugModeTimers) {
console.log("plasmoid timer: iconGeometryTimer called...");
}
} }
} }

@ -502,6 +502,11 @@ MouseArea{
onTriggered: { onTriggered: {
// mainItemContainer.hoverEnabled = true; // mainItemContainer.hoverEnabled = true;
slotPublishGeometries(); slotPublishGeometries();
if (latteDock && latteDock.debugModeTimers) {
console.log("plasmoid timer: taskInitComponentTimer called...");
}
timer.destroy(); timer.destroy();
} }
@ -1326,6 +1331,11 @@ MouseArea{
if (!mainItemContainer.inBlockingAnimation){ if (!mainItemContainer.inBlockingAnimation){
mainItemContainer.isDragged = true; mainItemContainer.isDragged = true;
} }
if (latteDock && latteDock.debugModeTimers) {
console.log("plasmoid timer: resistanerTimer called...");
}
resistanerTimer.destroy(); resistanerTimer.destroy();
} }
@ -1371,6 +1381,10 @@ MouseArea{
else else
showWindowAnimation.execute(); showWindowAnimation.execute();
if (latteDock && latteDock.debugModeTimers) {
console.log("plasmoid timer: timerWindow called...");
}
timerWindow.destroy(); timerWindow.destroy();
} }
@ -1389,6 +1403,10 @@ MouseArea{
onTriggered: { onTriggered: {
if (mainItemContainer.itemIndex >= 0) if (mainItemContainer.itemIndex >= 0)
mainItemContainer.lastValidIndex = mainItemContainer.itemIndex; mainItemContainer.lastValidIndex = mainItemContainer.itemIndex;
if (latteDock && latteDock.debugModeTimers) {
console.log("plasmoid timer: lastValidTimer called...");
}
} }
} }
@ -1398,7 +1416,13 @@ MouseArea{
Timer { Timer {
id: wheelActionDelayer id: wheelActionDelayer
interval: 200 interval: 200
onTriggered: mainItemContainer.inWheelAction = false; onTriggered: {
mainItemContainer.inWheelAction = false;
if (latteDock && latteDock.debugModeTimers) {
console.log("plasmoid timer: wheelActionDelayer called...");
}
}
} }
///Item's Removal Animation ///Item's Removal Animation

Loading…
Cancel
Save