Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SDK
KDE Development Scripts
Commits
0975e1b7
Commit
0975e1b7
authored
Aug 02, 2014
by
Laurent Montel
😁
Browse files
improve script
parent
ae7ac57c
Changes
1
Hide whitespace changes
Inline
Side-by-side
kf5/convert-kcmdlineargs.pl
View file @
0975e1b7
...
...
@@ -124,6 +124,8 @@ foreach my $file (@ARGV) {
$_
.=
$indent
.
"
aboutData.setShortDescription(
$description
);
\n
";
}
$addNewAboutData
=
1
;
}
else
{
$_
=
"";
}
}
...
...
@@ -152,8 +154,10 @@ foreach my $file (@ARGV) {
}
$QCommandLineParserAdded
=
1
;
}
elsif
(
defined
$opt
&&
/(.*)$opt.add\s*\(\s*"([^\"]*)"\s*\)/
)
{
# short option
$_
=
"";
$short
=
"
\"
$2
\"
<<
";
$short
=
"
QLatin1String(
\"
$2
\"
) <<
";
warn
"
$file
: Be sure that option is added
\
'$2
\
'
\n
";
}
elsif
(
defined
$opt
&&
/(.*)$opt.add\s*\(\s*"([^\"]*)"\s*,\s*k(i18nc?)\((.*)\)\s*(?:,\s*([^\)]*))?\)/
)
{
my
$prefix
=
$
1
;
# e.g. indent
my
$name
=
$
2
;
...
...
@@ -175,7 +179,7 @@ foreach my $file (@ARGV) {
$negatedOptions
{
$name
}
=
1
;
}
my
$translate
=
defined
$use_tr
?
"
QCoreApplication::translate(
$context
,
$description
)
"
:
"
$i18n
(
$description
)
";
$_
=
"
${prefix}
parser.addOption(QCommandLineOption(QStringList() << QLatin1String(
$short
\"
$name
\"
),
$translate$trail
));
\n
";
$_
=
"
${prefix}
parser.addOption(QCommandLineOption(QStringList() <<
$short
QLatin1String(
\"
$name
\"
),
$translate$trail
));
\n
";
$needQCommandLineOption
=
1
;
$short
=
"";
}
elsif
(
/KCmdLineArgs\s*\*\s*(\w*)\s*=\s*KCmdLineArgs::parsedArgs\(\s*\)/
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment