Replace deprecated QSignalMapper by lambda expressions
ClosedPublic

Authored by croick on Jan 14 2018, 10:03 PM.

Details

Summary
  • QSignalMapper can mostly be replaced using straightforward lambdas, reducing the code size
Test Plan
  • switch scope and arrangement of problems in ProblemView
  • create an application using the AppWizard
  • add a compiler
  • switch representation of register variables
  • add code to an existing file using a file template
  • open a file with an external application
  • switch to header/source file using the context menu action
  • track changes of a variable in the debugger
  • status bar seems to work
  • untested: runcontroller

Diff Detail

Repository
R32 KDevelop
Branch
deprSignalMapper
Lint
No Linters Available
Unit
No Unit Test Coverage
croick created this revision.Jan 14 2018, 10:03 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptJan 14 2018, 10:03 PM
croick requested review of this revision.Jan 14 2018, 10:03 PM
apol added a subscriber: apol.Jan 15 2018, 1:06 AM

All in all, LGTM. +1

plugins/debuggercommon/midebuggerplugin.cpp
88 ↗(On Diff #25353)

Shouldn't this line go to the end of the file?

croick updated this revision to Diff 25506.Jan 16 2018, 8:44 PM
  • move moc inclusion to the end of the file
croick marked an inline comment as done.Jan 16 2018, 8:47 PM
croick added inline comments.
plugins/debuggercommon/midebuggerplugin.cpp
88 ↗(On Diff #25353)

That's probably more common, thanks.

mwolff requested changes to this revision.Jan 25 2018, 8:59 AM
mwolff added a subscriber: mwolff.

excellent work! some nits, otherwise lgtm

plugins/debuggercommon/midebuggerplugin.cpp
64

style: remove space before &

70

dito

151

the old code was odd here already, but shouldn't you first check whether the service is already known and a proxy exists?
or at least ensure that its freed by calling slotDBusServiceUnregistered

also, add a comment here please saying that we use the proxy to map N services to the one slot that takes the proxy.

Finally, can't we just use old-style connect + sender() here to simplify the code? Yes, sender() isn't the nicest thing on earth, but it certainly is less code than this here.

plugins/debuggercommon/registers/registersview.cpp
244

why not capture a and then call a->text() in the lambda?

This revision now requires changes to proceed.Jan 25 2018, 8:59 AM
croick marked an inline comment as done.Jan 26 2018, 12:41 AM
croick added inline comments.
plugins/debuggercommon/midebuggerplugin.cpp
151

Actually, since I didn't know what the thing is supposed to do, I checked the DrKonqi side of the code: The whole thing is never called, since DrKonqi never starts a service called "org.kde.drkonqi". There is a service foreseen called "org.kde.Krash", but it is not registered to the DBus.
So I think, I will drop those changes completely for now and fix this independently within DrKonqi and KDevelop in separate patches if you agree.

plugins/debuggercommon/registers/registersview.cpp
244

Sure, if there is no a, there is no connection. Thanks.

you forgot to upload the new version, no?

croick updated this revision to Diff 26225.Jan 30 2018, 9:03 PM
croick edited the summary of this revision. (Show Details)
croick edited the test plan for this revision. (Show Details)
  • directly access QAction inside lambda
  • revert changes to MIDebuggerPlugin for postponed changes to DBus connection
croick marked an inline comment as done.Jan 30 2018, 9:06 PM

you forgot to upload the new version, no?

I first wanted to evaluate if it makes sense to drop the changes here. But it does and I will propose that patch soon.

May this go in then? The problematic files became part of the other commit.

mwolff accepted this revision.Mar 14 2018, 8:00 AM

sorry for the delay, this lgtm - thanks!

This revision is now accepted and ready to land.Mar 14 2018, 8:00 AM
This revision was automatically updated to reflect the committed changes.