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
ae049938
Commit
ae049938
authored
Jul 23, 2014
by
Laurent Montel
😁
Browse files
Don't add twice QCommandLineParser
parent
166aa2ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
kf5/convert-kcmdlineargs.pl
View file @
ae049938
...
...
@@ -61,32 +61,37 @@ foreach my $file (@ARGV) {
s/KCmdLineOptions /QCommandLineParser /
;
s/$opt/parser/
;
if
(
defined
$port_kapplicationAndK4AboutData
)
{
$_
.=
"
QApplication app(argc, argv);
\n
";
$_
.=
"
KAboutData::setApplicationData(aboutData);
\n
";
$_
.=
"
app.setApplicationName(aboutData.componentName());
\n
";
$_
.=
"
app.setApplicationDisplayName(aboutData.displayName());
\n
";
$_
.=
"
app.setOrganizationDomain(aboutData.organizationDomain());
\n
";
$_
.=
"
app.setApplicationVersion(aboutData.version());
\n
";
}
$_
.=
"
parser.addVersionOption();
\n
";
$_
.=
"
parser.addHelpOption();
\n
";
if
(
defined
$use_aboutdata
)
{
$_
.=
"
//PORTING SCRIPT: adapt aboutdata variable if necessary
\n
";
$_
.=
"
aboutData.setupCommandLine(&parser);
\n
";
}
$_
.=
"
parser.process(app);
\n
";
if
(
defined
$use_aboutdata
)
{
$_
.=
"
aboutData.processCommandLine(&parser);
\n
";
if
(
defined
$QCommandLineParserAdded
)
{
$_
=
"";
}
else
{
if
(
defined
$port_kapplicationAndK4AboutData
)
{
$_
.=
"
QApplication app(argc, argv);
\n
";
$_
.=
"
KAboutData::setApplicationData(aboutData);
\n
";
$_
.=
"
app.setApplicationName(aboutData.componentName());
\n
";
$_
.=
"
app.setApplicationDisplayName(aboutData.displayName());
\n
";
$_
.=
"
app.setOrganizationDomain(aboutData.organizationDomain());
\n
";
$_
.=
"
app.setApplicationVersion(aboutData.version());
\n
";
}
$_
.=
"
parser.addVersionOption();
\n
";
$_
.=
"
parser.addHelpOption();
\n
";
if
(
defined
$use_aboutdata
)
{
$_
.=
"
//PORTING SCRIPT: adapt aboutdata variable if necessary
\n
";
$_
.=
"
aboutData.setupCommandLine(&parser);
\n
";
}
$_
.=
"
parser.process(app);
\n
";
if
(
defined
$use_aboutdata
)
{
$_
.=
"
aboutData.processCommandLine(&parser);
\n
";
}
}
$QCommandLineParserAdded
=
1
;
}
elsif
(
defined
$opt
&&
/KCmdLineArgs::addCmdLineOptions\s*\(\s*$opt\s*\)/
||
/KCmdLineArgs::init/
)
{
$_
=
"";
if
(
not
defined
$QCommandLineParserAdded
)
{
if
(
defined
$QCommandLineParserAdded
)
{
$_
=
"";
}
else
{
if
(
defined
$port_kapplicationAndK4AboutData
)
{
$_
=
"
QApplication app(argc, argv);
\n
";
$_
.=
"
QCommandLineParser parser;
\n
";
$_
.=
"
QCommandLineParser parser;
\n
";
$_
.=
"
KAboutData::setApplicationData(aboutData);
\n
";
$_
.=
"
app.setApplicationName(aboutData.componentName());
\n
";
$_
.=
"
app.setApplicationDisplayName(aboutData.displayName());
\n
";
...
...
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