~abreu-alexandre/webbrowser-app/support-oxide-and-qtwebkit

« back to all changes in this revision

Viewing changes to src/app/webcontainer/webapp-container.cpp

  • Committer: Alexandre Abreu
  • Date: 2014-03-26 15:22:53 UTC
  • Revision ID: alexandre.abreu@canonical.com-20140326152253-isam6oink1tbvblj
fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <QtCore/QCoreApplication>
29
29
#include <QtCore/QDebug>
30
30
#include <QtCore/QFileInfo>
 
31
#include <QString>
31
32
#include <QtCore/QRegularExpression>
32
33
#include <QtCore/QTextStream>
33
34
#include <QtQuick/QQuickWindow>
55
56
        m_window->setProperty("webappName", name);
56
57
        m_window->setProperty("backForwardButtonsVisible", m_arguments.contains("--enable-back-forward"));
57
58
        m_window->setProperty("addressBarVisible", m_arguments.contains("--enable-addressbar"));
58
 
        m_window->setProperty("oxide", withOxide());
 
59
 
 
60
        bool oxide = withOxide();
 
61
        qDebug() << "Using" << (oxide ? "Oxide" : "QtWebkit") << "as the web engine backend";
 
62
        m_window->setProperty("oxide", oxide);
59
63
 
60
64
        // When a webapp is being launched by name, the URL is pulled from its 'homepage'.
61
65
        if (name.isEmpty()) {
118
122
    }
119
123
 
120
124
    bool oxide = false;
121
 
    int fd =
122
 
        open(QString("/usr/lib/%1/oxide-qt/oxide-renderer")
123
 
                  .arg(currentArchitecturePathName()).toStdString().c_str(), O_RDONLY);
 
125
 
 
126
    // Use a runtime hint to transparently know if oxide
 
127
    // can be used as a backend without the user/dev having
 
128
    // to update its app or change somehting in the Exec args.
 
129
    QString oxideHintLocation =
 
130
        QString("/usr/lib/%1/oxide-qt/oxide-renderer")
 
131
            .arg(currentArchitecturePathName());
 
132
 
 
133
    int fd = open(oxideHintLocation.toLatin1().data(), O_RDONLY);
124
134
    if (fd >=0) {
125
135
        oxide = true;
126
136
        close(fd);