- It compiles
- Tested all functionality; everything works (well... at least everything that was working before is still working now :) )
Details
- Reviewers
apol - Group Reviewers
Frameworks - Commits
- R432:95df6fa38a45: Port to new connect syntax
Diff Detail
- Repository
- R432 File Sharing (Samba) integration
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
samba/filepropertiesplugin/delegate.h | ||
---|---|---|
41 | why add the int if you're not going to use it? |
samba/filepropertiesplugin/delegate.cpp | ||
---|---|---|
46 | use a lambda here:
|
samba/filepropertiesplugin/sambausershareplugin.cpp | ||
---|---|---|
136 | I think instead of emiting KFilePropertiesPlugin::changed() it would be better to call setDirty() in the slots. |
samba/filepropertiesplugin/delegate.cpp | ||
---|---|---|
46 | I'd love to, and I tried, but this stuff is pretty new to me and I kept getting error: cannot define member function What's wrong with this? connect(comboBox, &QComboBox::activated, [comboBox]() { emit commitData(comboBox); }); | |
samba/filepropertiesplugin/delegate.h | ||
41 | QComboBox::activated passes an int argument along that as far as I can tell (I could be wrong) needs to be handled by the function it's connected to |
samba/filepropertiesplugin/delegate.cpp | ||
---|---|---|
46 | commitData is an inherited member function from QItemDelegate, i.e. you have to also capture this |
samba/filepropertiesplugin/delegate.cpp | ||
---|---|---|
46 | without having tried it, you probably still need the QOverload to say which activated version you want, so connect(comboBox, QOverload<int>::of(&QComboBox::activated), this, [this, comboBox] { emit commitData(comboBox); }); | |
samba/filepropertiesplugin/delegate.h | ||
41 | nah, the right hand side needs to be a subset of the left hand side (or be able to convert from one to another) |
samba/filepropertiesplugin/delegate.cpp | ||
---|---|---|
46 | Nope, same issue I'm afraid. |
samba/filepropertiesplugin/delegate.cpp | ||
---|---|---|
46 | GCC 8.3.1 gives me a helpful error message: ...samba/filepropertiesplugin/delegate.cpp: In lambda function: ...samba/filepropertiesplugin/delegate.cpp:48:58: error: passing ‘const UserPermissionDelegate’ as ‘this’ argument discards qualifiers [-fpermissive] [this, comboBox] (int) { emit commitData(comboBox); } this is const as createEditor(...) is const. Apparently connect discards the constness of this. But reading through https://doc.qt.io/qt-5/qtwidgets-itemviews-spinboxdelegate-example.html , it seems like the connect is not needed at all. The selected value is propagated via setModelData. Can you test if it still works when you remove the whole connect(...) here? |
samba/filepropertiesplugin/sambausershareplugin.cpp | ||
---|---|---|
140 | I meant - do setDirty() in e.g. checkShareName(), i.e. only one connection per signal. |
LGTM
currently, GCC thows some "0 for nullptr" and "missing override" warnings, are you going to address these (new SR)?
Also, Qt recommends deriving from QStyledItemDelegate
Yeah there are a lot of warnings and more code cleanup needed, this is just the first of many. :)