Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit d84e0a3b authored by Laurent Montel's avatar Laurent Montel 😁

Allow to set variables

parent 151663d9
......@@ -26,16 +26,28 @@ sub rewriteConnectPrivateFunction($$$$$$$)
if (defined $activateSlotPrivatePorting) {
my ($indent, $sender, $signal, $receiver, $slot, $slotArgument, $lastArgument) = @_;
my $myNewLine;
my $localSlotArgument;
my $localSlotVariable;
if ($slotArgument eq "()") {
if (defined $lastArgument) {
# lastArgument has ')'
warn "last argument :$lastArgument\n";
$myNewLine = $indent . "connect($sender, $signal, $receiver, [this]$slotArgument { d->$slot$slotArgument; }$lastArgument;\n";
} else {
$myNewLine = $indent . "connect($sender, $signal, $receiver, [this]$slotArgument { d->$slot$slotArgument; });\n";
}
return $myNewLine;
$localSlotArgument = "()";
$localSlotVariable = "()";
} elsif ($slotArgument eq "(QUrl)") {
$localSlotArgument = "(const QUrl &url)";
$localSlotVariable = "(url)";
} elsif ($slotArgument eq "(KJob*)") {
$localSlotArgument = "(KJob *job)";
$localSlotVariable = "(job)";
} else {
return undef;
}
if (defined $lastArgument) {
# lastArgument has ')'
warn "last argument :$lastArgument\n";
$myNewLine = $indent . "connect($sender, $signal, $receiver, [this]$localSlotArgument { d->$slot$localSlotVariable; }$lastArgument;\n";
} else {
$myNewLine = $indent . "connect($sender, $signal, $receiver, [this]$localSlotArgument { d->$slot$localSlotVariable; });\n";
}
return $myNewLine;
}
return undef;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment