~osomon/webbrowser-app/ua-override

« back to all changes in this revision

Viewing changes to src/app/commandline-parser.cpp

  • Committer: Tarmac
  • Author(s): Olivier Tilloy
  • Date: 2013-08-06 13:27:54 UTC
  • mfrom: (268.3.1 webbrowser-app)
  • Revision ID: tarmac-20130806132754-1n9wv9q02nkcorsu
Cosmetics, for increased consistency across the code base.

Approved by Günter Schwann, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
                } else if (argument == "--inspector") {
56
56
                    m_remoteInspector = true;
57
57
                } else if (argument.startsWith("--webapp")) {
58
 
                    // We use the name as a reference instead of
59
 
                    //  the url /w a subsequent step to match it w/ a webapp
60
 
                    // TODO: validate that it is fine in all cases (country dependant, etc.)
61
 
 
 
58
                    // We use the name as a reference instead of the URL with a
 
59
                    // subsequent step to match it with a webapp.
 
60
                    // TODO: validate that it is fine in all cases
 
61
                    // (country dependant, etc…).
62
62
                    m_webapp = true;
63
63
                    QString tail = argument.split("--webapp")[1];
64
 
                    if ( ! tail.isEmpty() && tail.startsWith("="))
65
 
                    {
66
 
                        tail = QUrl::fromPercentEncoding (tail.split("=")[1].toUtf8()).trimmed();
67
 
                        if (! tail.isEmpty())
 
64
                    if (!tail.isEmpty() && tail.startsWith("=")) {
 
65
                        tail = QUrl::fromPercentEncoding(tail.split("=")[1].toUtf8()).trimmed();
 
66
                        if (!tail.isEmpty()) {
68
67
                            m_webappName = tail;
 
68
                        }
69
69
                    }
70
70
                } else if (argument.startsWith("--homepage=")) {
71
71
                    homepage = QUrl::fromUserInput(argument.split("--homepage=")[1]);
147
147
    return m_remoteInspector;
148
148
}
149
149
 
 
150
bool CommandLineParser::webapp() const
 
151
{
 
152
    return m_webapp;
 
153
}
 
154
 
150
155
QString CommandLineParser::webappName() const
151
156
{
152
157
    return m_webappName;
153
158
}
154
 
 
155
 
bool CommandLineParser::webapp() const
156
 
{
157
 
    return m_webapp;
158
 
}