Unfortunately, this is not possible with the current state of Uncrustify. So the best thing you could do is to configure the options that you've mentioned in the following way:
nl_func_decl_start = ignore
nl_func_def_start = ignore
nl_func_decl_start_single = ignore
nl_func_def_start_single = ignore
ls_func_split_full = true
and to manually wrap the first parameter in appropriate cases. However, personally, I don't think it is a good idea. Just let it perform lazy/on demand wrapping automatically. For instance, I enjoy the same settings I've listed above, and still have very neat code in any possible case. Examples follow.
No wrapping - constructor parameters and constructor initializer list both fit into maximal line length:
PluginDialog::
PluginDialog(QString const& path, QStringList const& fileNames, QWidget* parent): QDialog(parent), label(new QLabel), treeWidget(new QTreeWidget), okButton(new QPushButton(tr("OK"))) {
// ...
}
Now they do not fit, and by convention we decide to wrap initializer list first:
PluginDialog::
PluginDialog(QString const& path, QStringList const& fileNames, QWidget* parent): QDialog(parent),
label(new QLabel),
treeWidget(new QTreeWidget),
okButton(new QPushButton(tr("OK"))) {
// ...
}
the opposite convention could be possible as well:
PluginDialog::
PluginDialog(QString const& path,
QStringList const& fileNames,
QWidget* parent): QDialog(parent), label(new QLabel), treeWidget(new QTreeWidget), okButton(new QPushButton(tr("OK"))) {
// ...
}
Now either case from 2 previous ones does not fit, and therefore either of them merge into the next and the only possible configuration:
PluginDialog::
PluginDialog(QString const& path,
QStringList const& fileNames,
QWidget* parent): QDialog(parent),
label(new QLabel),
treeWidget(new QTreeWidget),
okButton(new QPushButton(tr("OK"))) {
// ...
}
Now we do not fit again, and by convention we decide to move constructor initializer list column under the constructor parameter list column:
PluginDialog::
PluginDialog(QString const& path,
QStringList const& fileNames,
QWidget* parent):
QDialog(parent),
label(new QLabel),
treeWidget(new QTreeWidget),
okButton(new QPushButton(tr("OK"))) {
// ...
}
by the way we have branching case again, i.e. this could be possible as well:
PluginDialog::
PluginDialog(
QString const& path,
QStringList const& fileNames,
QWidget* parent): QDialog(parent),
label(new QLabel),
treeWidget(new QTreeWidget),
okButton(new QPushButton(tr("OK"))) {
// ...
}
Finally, either case from 2 previous ones does not fit, and therefore either of them merge into the final and the only possible configuration:
PluginDialog::
PluginDialog(
QString const& path,
QStringList const& fileNames,
QWidget* parent):
QDialog(parent),
label(new QLabel),
treeWidget(new QTreeWidget),
okButton(new QPushButton(tr("OK"))) {
// ...
}
It would be great if Uncrustify offered sort of "avoid confusing indentations" option like Jindent does. In this case, the last snippet would for example look as follows:
PluginDialog::
PluginDialog(
QString const& path,
QStringList const& fileNames,
QWidget* parent):
QDialog(parent),
label(new QLabel),
treeWidget(new QTreeWidget),
okButton(new QPushButton(tr("OK"))) {
// ...
}
which is clearly more readable and pleasing. I proposed this feature for Uncrustify. However, I doubt we can see it implemented any time soon because the author of this project seems to be either too busy with some other stuff or not really interested in developing this project actively any more.