Convert from the old syntax to the new connect syntax
Details
Diff Detail
- Repository
- R241 KIO
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Changed [&] by [this]in the lambdas.
Added a lambda for KActionCollection::addAction. I didn't knew it was already possible.
src/filewidgets/kfilewidget.cpp | ||
---|---|---|
1223 | Whenever disconnect after that reset connection to QMetaObject::Connection cause disconnect empty connection is safe, double disconnect same one - does not. |
src/filewidgets/kfilewidget.cpp | ||
---|---|---|
438 | I think it is using the url, the parameter to the lambda and _k_urlEntered(url); Changed & for this, d can't be used directly. | |
471–472 | Because I didn't knew KActionCollection have it already! Done. | |
1223 | I'm sorry but I don't understand your comment. |
src/filewidgets/kfilewidget.cpp | ||
---|---|---|
1223 | QObject::disconnect(m_connEditTextChanged); m_connEditTextChanged = QMetaObject::Connection(); |
src/filewidgets/kfilewidget.cpp | ||
---|---|---|
1223 | I'm sorry, but I still don't get it. |
Changed to 'Anonymous' connects and disconnects.
Even if the documentation say: use 0 as a wildcard, the compiler thinks it should be a nullptr
kfilewidget.cpp:1222:74: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
src/filewidgets/kfilewidget.cpp | ||
---|---|---|
1223 | Me neither ... But me wonders if this should not use {QSignalBlocker(locationEdit); ...} instead. |
Use nullptr instead of 0.
Remove the copied/pasted part of the cause of two dissconnects.
@bruns, as I'm not sure if the code emits other signals for lineEdit, I prefer to keep it as it was.
Fix a crash ,caused by a still connected signal, after running again the unittests.
kfilewidgettest still doesn't pass because QTest::qWaitForWindowActive fails for me.
Don't accept this revision until kfilewidgettest works flawlessly.
QTest::qWaitForWindowActive fails because I use kwin Focus stealing prevention High, therefore the windows doesn't become active until I click on them in the task bar or switch to them.
And qWaitForWindowExposed doesn't help because the window/widget needs to have the focus.
Is creating a README file and a kwin script to disable stealing prevention for kio tests an acceptable solution?