[DrKonqi] Show debug button when KDevelop session is running
ClosedPublic

Authored by croick on Mar 11 2018, 2:52 PM.

Details

Summary
  • independently of the config setting in drkonqirc propose debugging with KDevelop if a session is available
  • default debugger is only displayed if ShowDebugButton=true in [DrKonqi]
  • button is the first action button to be displayed
  • fix adding/removing of the button to the button box
Test Plan
  • set ShowDebugButton=false, have no KDevelop session running
  • force a crash (using src/tests/crashtest for instance)
  • DrKonqi shows no debug button
  • start a KDevelop session
  • the button appears with the KDevelop session selectable
  • quit DrKonqi, set ShowDebugButton=true
  • crash again, the button now always is visible, including the default debugger as a selection

Diff Detail

Repository
R871 DrKonqi
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
croick created this revision.Mar 11 2018, 2:52 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 11 2018, 2:52 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
croick requested review of this revision.Mar 11 2018, 2:52 PM

I know that DrKonqi hardly pops up these days. But still, if this button became more popular, then D11235 and D11236 might get some attention as well...

A few screenshots:

Before the patch:

  • ShowDebugButton=false in drkonqirc
  • ShowDebugButton=true in drkonqirc
    Note how the button is just floating.

After the patch:

  • ShowDebugButton=false in drkonqirc, but with KDevelop running
croick updated this revision to Diff 59394.Jun 8 2019, 11:50 AM

Rebase to current master

sitter requested changes to this revision.Jun 11 2019, 10:30 AM

addDebugger seems a bit much, no? Why don't you just have a m_debugButtonInBox member to track whether it is currently added or not? When it is already in the buttonBox running the for loop over the buttons is entirely unnecessary.

src/drkonqidialog.cpp
190

CamelCase

193–195

We always use curly braces for ifs in Plasma

248

CamelCase

Should be = false

250

No single letter variables please.

261

No single letter variables please.

This revision now requires changes to proceed.Jun 11 2019, 10:30 AM
croick updated this revision to Diff 59627.Jun 11 2019, 10:24 PM
croick marked 5 inline comments as done.
  • Fix code style.
  • Save state of the debug button in a member variable.
  • Resize the dialog after inserting/removing the debug button.

Thanks for looking into this :D

Past self obviously still had to read the style guide and tried not to change header files.
I took your commit cc640cea as an example to resize the dialog after inserting or deleting the button.

Could you explain your thinking behind the adjustSize call please? The way I see it the window should scale up as necessary if the size hints are properly set (which they should be on master).

src/drkonqidialog.cpp
203
  • goes to the right of the space.
210

could probably just do away with this and merge the condition into the setEnabled call below. the variable doesn't seem to do much in the way of readability.

croick updated this revision to Diff 61377.Jul 8 2019, 9:58 PM
  • more style fixes
  • do not adjustSize after adding the button, since that is redundant now
croick marked 2 inline comments as done.Jul 8 2019, 10:03 PM

Could you explain your thinking behind the adjustSize call please? The way I see it the window should scale up as necessary if the size hints are properly set (which they should be on master).

That's true, but only since your latest commits. Before, the text of the report button was cut off (in german for example) once the debug button got activated. I removed the call again.

sitter accepted this revision.Jul 9 2019, 10:08 AM

Heh. Fair enough, I too ran down the wrong rabbit hole with the size issue until I noticed the policy was wrong.

Diff looks good now. Works very well too. 👍

This revision is now accepted and ready to land.Jul 9 2019, 10:08 AM
This revision was automatically updated to reflect the committed changes.
croick added a comment.Jul 9 2019, 8:45 PM

Thanks for your review. It was the last in a series of patches and I'll try to advertise the whole "Debug your KDE application with KDevelop"-feature somewhere.