~abreu-alexandre/ubuntu-html5-theme/oxide-backport-14.04

« back to all changes in this revision

Viewing changes to src/ubuntu-html5-app-launcher/main.cpp

  • Committer: Alexandre Abreu
  • Date: 2014-11-28 01:10:47 UTC
  • Revision ID: alexandre.abreu@canonical.com-20141128011047-4btrizr08eh10njy
backport to 14.04 oxide

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
    QString wwwfolderArg;
143
143
    bool maximized = false;
144
144
 
 
145
    QString remoteInspectorHost = "";
 
146
    QString remoteInspectorPort = QString::number(REMOTE_INSPECTOR_PORT);
 
147
    bool remoteInspectorEnabled = false;
 
148
 
145
149
    QStringList arguments = app.arguments();
146
150
    arguments.pop_front();
147
151
 
159
163
        else
160
164
        if (argument.contains(INSPECTOR))
161
165
        {
162
 
            QString host;
 
166
            remoteInspectorEnabled = true;
163
167
            Q_FOREACH(QHostAddress address, QNetworkInterface::allAddresses()) {
164
168
                if (!address.isLoopback() && (address.protocol() == QAbstractSocket::IPv4Protocol)) {
165
 
                    host = address.toString();
 
169
                    remoteInspectorHost = address.toString();
166
170
                    break;
167
171
                }
168
172
            }
169
 
            QString server;
170
 
            if (host.isEmpty()) {
171
 
                server = QString::number(REMOTE_INSPECTOR_PORT);
172
 
            } else {
173
 
                server = QString("%1:%2").arg(host, QString::number(REMOTE_INSPECTOR_PORT));
174
 
            }
175
 
            qputenv("QTWEBKIT_INSPECTOR_SERVER", server.toUtf8());
176
173
        }
177
174
        else
178
175
        {
226
223
        return EXIT_FAILURE;
227
224
    }
228
225
    view.rootObject()->setProperty("htmlIndexDirectory", wwwFolder.canonicalFilePath());
 
226
    view.rootObject()->setProperty("remoteInspectorEnabled", remoteInspectorEnabled);
 
227
    view.rootObject()->setProperty("remoteInspectorHost", remoteInspectorHost);
 
228
    view.rootObject()->setProperty("remoteInspectorPort", remoteInspectorPort);
229
229
 
230
230
    view.setTitle(QCoreApplication::applicationName());
231
231
    view.setResizeMode(QQuickView::SizeRootObjectToView);