=== modified file 'README'
--- README	2015-02-27 09:28:41 +0000
+++ README	2015-03-24 15:51:06 +0000
@@ -74,7 +74,7 @@
 webbrowser-app supports a limited set of custom settings, currently not exposed
 in the UI. The settings are persisted on disk in the following INI-like file:
 
-    $HOME/.config/webbrowser-app/settings.conf
+    $HOME/.config/webbrowser-app/webbrowser-app.conf
 
 The following keys are supported:
 
@@ -86,4 +86,11 @@
    the OpenSearch document description format
    (http://www.opensearch.org/Specifications/OpenSearch/1.1)
 
-If any of those keys are not specified, the default hardcoded value is used.
+ - 'allowOpenInBackgroundTab': whether to offer an option to open a link in a
+   new background tab in the contextual menu. Possible values are "true",
+   "false", and "default" (which resolves to true on desktop and false on
+   mobile).
+
+ - restoreSession: whether to restore the previous browsing session at startup
+   (defaults to true)
+

=== modified file 'debian/control'
--- debian/control	2015-03-02 12:21:27 +0000
+++ debian/control	2015-03-24 15:51:06 +0000
@@ -36,6 +36,7 @@
          fonts-liberation,
          liboxideqt-qmlplugin (>= 1.4),
          libqt5sql5-sqlite,
+         qml-module-qt-labs-settings,
          qml-module-qtquick2 (>= 5.4) | qtdeclarative5-qtquick2-plugin (>= 5.4),
          qml-module-qtquick-dialogs | qtdeclarative5-dialogs-plugin,
          qml-module-qtquick-window2 | qtdeclarative5-window-plugin,

=== modified file 'src/app/browserapplication.cpp'
--- src/app/browserapplication.cpp	2015-03-02 12:21:27 +0000
+++ src/app/browserapplication.cpp	2015-03-24 15:51:06 +0000
@@ -128,6 +128,7 @@
     QStringList appIdParts =
         QString::fromUtf8(qgetenv("APP_ID")).split('_');
     QCoreApplication::setApplicationName(appIdParts.first());
+    QCoreApplication::setOrganizationDomain(QCoreApplication::applicationName());
     // Get also the the first two components of the app ID: <package>_<app>,
     // which is needed by Online Accounts.
     QString unversionedAppId = QStringList(appIdParts.mid(0, 2)).join('_');

=== modified file 'src/app/config.h.in'
--- src/app/config.h.in	2014-06-30 10:40:59 +0000
+++ src/app/config.h.in	2015-03-24 15:51:06 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 Canonical Ltd.
+ * Copyright 2013-2015 Canonical Ltd.
  *
  * This file is part of webbrowser-app.
  *
@@ -24,10 +24,8 @@
 #include <QtCore/QString>
 
 #define APP_ID "webbrowser-app"
-#define DEFAULT_HOMEPAGE "http://start.ubuntu.com"
 #define REMOTE_INSPECTOR_PORT 9221
 
-#define DEFAULT_SEARCH_ENGINE "google"
 #define DEFAULT_SEARCH_NAME "Google Search"
 #define DEFAULT_SEARCH_DESC "Use google.com to search the Web"
 #define DEFAULT_SEARCH_TEMPLATE "https://google.com/search?client=ubuntu&q={searchTerms}&ie=utf-8&oe=utf-8"

=== modified file 'src/app/webbrowser/AddressBar.qml'
--- src/app/webbrowser/AddressBar.qml	2015-01-23 10:30:19 +0000
+++ src/app/webbrowser/AddressBar.qml	2015-03-24 15:51:06 +0000
@@ -21,6 +21,7 @@
 import Ubuntu.Components.Popups 1.0
 import com.canonical.Oxide 1.0 as Oxide
 import ".."
+import "urlManagement.js" as UrlManagement
 
 FocusScope {
     id: addressbar
@@ -257,16 +258,6 @@
             return false
         }
 
-        function fixUrl(address) {
-            var url = address
-            if (address.substr(0, 1) == "/") {
-                url = "file://" + address
-            } else if (address.indexOf("://") == -1) {
-                url = "http://" + address
-            }
-            return url
-        }
-
         function escapeHtmlEntities(query) {
             return query.replace(/\W/, encodeURIComponent)
         }
@@ -279,7 +270,7 @@
         function validate() {
             var query = text.trim()
             if (internal.looksLikeAUrl(query)) {
-                requestedUrl = internal.fixUrl(query)
+                requestedUrl = UrlManagement.fixUrl(query)
             } else {
                 requestedUrl = internal.buildSearchUrl(query)
             }

=== modified file 'src/app/webbrowser/Browser.qml'
--- src/app/webbrowser/Browser.qml	2015-03-20 12:19:51 +0000
+++ src/app/webbrowser/Browser.qml	2015-03-24 15:51:06 +0000
@@ -18,6 +18,7 @@
 
 import QtQuick 2.0
 import QtQuick.Window 2.0
+import Qt.labs.settings 1.0
 import com.canonical.Oxide 1.4 as Oxide
 import Ubuntu.Components 1.1
 import webbrowserapp.private 0.1
@@ -29,16 +30,17 @@
 BrowserView {
     id: browser
 
-    property bool restoreSession: true
-
     currentWebview: tabsModel.currentTab ? tabsModel.currentTab.webview : null
 
     property var historyModel: (historyModelLoader.status == Loader.Ready) ? historyModelLoader.item : null
     property var bookmarksModel: (bookmarksModelLoader.status == Loader.Ready) ? bookmarksModelLoader.item : null
 
-    property url homepage
-    property QtObject searchEngine
-    property string allowOpenInBackgroundTab
+    property url homepage: settingsDefaults.homepage
+    property string searchEngine: settingsDefaults.searchEngine
+    property string allowOpenInBackgroundTab: settingsDefaults.allowOpenInBackgroundTab
+    property bool restoreSession: settingsDefaults.restoreSession
+
+    property bool newSession: false
 
     // XXX: we might want to tweak this value depending
     // on the form factor and/or the available memory
@@ -78,6 +80,31 @@
         }
     ]
 
+    Settings {
+        id: settings
+
+        property alias homepage: browser.homepage
+        property alias searchEngine: browser.searchEngine
+        property alias allowOpenInBackgroundTab: browser.allowOpenInBackgroundTab
+        property alias restoreSession: browser.restoreSession
+
+        function restoreDefaults() {
+            browser.homepage  = settingsDefaults.homepage
+            browser.searchEngine = settingsDefaults.searchEngine
+            browser.allowOpenInBackgroundTab = settingsDefaults.allowOpenInBackgroundTab
+            browser.restoreSession = settingsDefaults.restoreSession
+        }
+    }
+
+    QtObject {
+        id: settingsDefaults
+
+        readonly property url homepage: "http://start.ubuntu.com"
+        readonly property string searchEngine: "google"
+        readonly property string allowOpenInBackgroundTab: "default"
+        readonly property bool restoreSession: true
+    }
+
     Item {
         anchors.fill: parent
 
@@ -136,13 +163,18 @@
             asynchronous: true
         }
 
+        SearchEngine {
+            id: searchEngine
+            filename: browser.searchEngine
+        }
+
         Chrome {
             id: chrome
 
             visible: !recentView.visible
 
             webview: browser.currentWebview
-            searchUrl: browser.searchEngine ? browser.searchEngine.template : ""
+            searchUrl: searchEngine.urlTemplate
 
             function isCurrentUrlBookmarked() {
                 return ((webview && browser.bookmarksModel) ? browser.bookmarksModel.contains(webview.url) : false)
@@ -210,6 +242,12 @@
                     iconName: "tab-new"
                     enabled: formFactor != "mobile"
                     onTriggered: browser.openUrlInNewTab("", true)
+                },
+                Action {
+                    objectName: "settings"
+                    text: i18n.tr("Settings")
+                    iconName: "settings"
+                    onTriggered: settingsComponent.createObject(settingsContainer)
                 }
             ]
 
@@ -471,6 +509,24 @@
         }
     }
 
+    Item {
+        id: settingsContainer
+
+        visible: children.length > 0
+        anchors.fill: parent
+
+        Component {
+            id: settingsComponent
+
+            SettingsPage {
+                anchors.fill: parent
+                onHistoryRemoved: browser.historyModel.clearAll()
+                onRestoreDefaults: settings.restoreDefaults()
+                onDone: destroy()
+            }
+        }
+    }
+
     TabsModel {
         id: tabsModel
 
@@ -783,7 +839,7 @@
         running: true
         interval: 1
         onTriggered: {
-            if (browser.restoreSession) {
+            if (!browser.newSession && browser.restoreSession) {
                 session.restore()
             }
             // Sanity check

=== modified file 'src/app/webbrowser/CMakeLists.txt'
--- src/app/webbrowser/CMakeLists.txt	2015-02-18 21:37:39 +0000
+++ src/app/webbrowser/CMakeLists.txt	2015-03-24 15:51:06 +0000
@@ -28,7 +28,6 @@
 set(WEBBROWSER_APP_SRC
     file-operations.cpp
     searchengine.cpp
-    settings.cpp
     webbrowser-app.cpp
 )
 

=== added file 'src/app/webbrowser/SettingsPage.qml'
--- src/app/webbrowser/SettingsPage.qml	1970-01-01 00:00:00 +0000
+++ src/app/webbrowser/SettingsPage.qml	2015-03-24 15:51:06 +0000
@@ -0,0 +1,266 @@
+/*
+ * Copyright 2015 Canonical Ltd.
+ *
+ * This file is part of webbrowser-app.
+ *
+ * webbrowser-app is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * webbrowser-app is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components 1.1
+import Ubuntu.Components.Popups 1.0
+import Ubuntu.Components.ListItems 1.0 as ListItem
+
+import "urlManagement.js" as UrlManagement
+
+Item {
+    id: settings
+
+    signal historyRemoved()
+    signal restoreDefaults()
+    signal done()
+
+    Rectangle {
+        anchors.fill: parent
+        color: "#f6f6f6"
+    }
+
+    ListItem.Empty {
+        id: title
+        anchors {
+            top: parent.top
+            left: parent.left
+            right: parent.right
+        }
+
+        highlightWhenPressed: false
+
+        Icon {
+            id: backButton
+            name: "back"
+
+            anchors {
+                top: parent.top
+                bottom: parent.bottom
+                left: parent.left
+                margins: units.gu(2)
+            }
+
+            width: height
+
+            MouseArea {
+                anchors.fill: parent
+
+                onClicked: settings.done()
+            }
+        }
+
+        Label {
+            anchors {
+                top: parent.top
+                bottom: parent.bottom
+                left: backButton.right
+                margins: units.gu(2)
+            }
+            text: i18n.tr("Settings")
+        }
+    }
+
+    Column {
+        anchors {
+            top: title.bottom
+            left: parent.left
+            right: parent.right
+            bottom: parent.bottom
+        }
+
+        ListItem.Subtitled {
+            text: i18n.tr("Search engine")
+            subText: browser.searchEngine
+            visible: false
+
+            action: Action {
+                onTriggered: {
+                    searchEngineItem.visible = true;
+                }
+            }
+        }
+
+        ListItem.Subtitled {
+            text: i18n.tr("Homepage")
+            subText: browser.homepage
+
+            action: Action {
+                onTriggered: PopupUtils.open(homepageDialog)
+            }
+        }
+
+        ListItem.Standard {
+            text: i18n.tr("Restore old session on startup")
+            highlightWhenPressed: false
+            control: Switch {
+                checked: browser.restoreSession
+                onClicked: browser.restoreSession = checked;
+            }
+        }
+
+        ListItem.Standard {
+            text: i18n.tr("Open new tab in background")
+            highlightWhenPressed: false
+            control: Switch {
+                checked: browser.allowOpenInBackgroundTab
+                onClicked: browser.allowOpenInBackgroundTab = checked;
+            }
+        }
+
+        ListItem.Standard {
+            text: i18n.tr("Privacy")
+
+            action: Action {
+                onTriggered: privacyItem.visible = true;
+            }
+        }
+
+        ListItem.Standard {
+            text: i18n.tr("Reset browser settings")
+            showDivider: false
+            onClicked: {
+                settings.restoreDefaults();
+            }
+        }
+    }
+
+    Item {
+        id: searchEngineItem
+        anchors.fill: parent
+        visible: false
+
+        Rectangle {
+            anchors.fill: parent
+            color: "#f6f6f6"
+        }
+
+        ListView {
+            anchors.fill: parent
+            model: 5
+            delegate: ListItem.Standard {
+                text: index
+                action: Action {
+                    onTriggered: {
+                        browser.searchEngine = text;
+                        searchEngineItem.visible = false;
+                    }
+                }
+            }
+        }
+    }
+
+    Item {
+        id: privacyItem
+        anchors.fill: parent
+        visible: false
+
+        Rectangle {
+            anchors.fill: parent
+            color: "#f6f6f6"
+        }
+
+        ListItem.Empty {
+            id: privacyTitle
+            anchors {
+                top: parent.top
+                left: parent.left
+                right: parent.right
+            }
+
+            highlightWhenPressed: false
+
+            Icon {
+                id: privacyBackButton
+                name: "back"
+
+                anchors {
+                    top: parent.top
+                    bottom: parent.bottom
+                    left: parent.left
+                    margins: units.gu(2)
+                }
+
+                width: height
+
+                MouseArea {
+                    anchors.fill: parent
+
+                    onClicked: privacyItem.visible = false;
+                }
+            }
+
+            Label {
+                anchors {
+                    top: parent.top
+                    bottom: parent.bottom
+                    left: privacyBackButton.right
+                    margins: units.gu(2)
+                }
+                text: i18n.tr("Privacy")
+            }
+        }
+
+        Column {
+            anchors {
+                top: privacyTitle.bottom
+                left: parent.left
+                right: parent.right
+                bottom: parent.bottom
+            }
+
+            ListItem.Standard {
+                text: i18n.tr("Clear Browsing History")
+                onClicked: {
+                    settings.historyRemoved();
+                    opacity = 0.5
+                }
+            }
+        }
+    }
+
+    Component {
+        id: homepageDialog
+        Dialog {
+            id: dialogue
+            title: i18n.tr("Homepage")
+
+            TextField {
+                id: homepageTextField
+                text: browser.homepage
+            }
+
+            Button {
+                anchors { left: parent.left; right: parent.right }
+                text: i18n.tr("Cancel")
+                onClicked: PopupUtils.close(dialogue);
+            }
+
+            Button {
+                anchors { left: parent.left; right: parent.right }
+                text: i18n.tr("Save")
+                color: "#3fb24f"
+                onClicked: {
+                    browser.homepage = UrlManagement.fixUrl(homepageTextField.text);
+                    PopupUtils.close(dialogue);
+                }
+            }
+        }
+    }
+}
+

=== modified file 'src/app/webbrowser/searchengine.cpp'
--- src/app/webbrowser/searchengine.cpp	2014-06-30 11:01:27 +0000
+++ src/app/webbrowser/searchengine.cpp	2015-03-24 15:51:06 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Canonical Ltd.
+ * Copyright 2014-2015 Canonical Ltd.
  *
  * This file is part of webbrowser-app.
  *
@@ -17,41 +17,71 @@
  */
 
 // local
+#include "config.h"
 #include "searchengine.h"
 
 // Qt
-#include <QtCore/QDir>
 #include <QtCore/QFile>
 #include <QtCore/QStandardPaths>
 #include <QtCore/QXmlStreamReader>
 
-SearchEngine::SearchEngine(const QString& name, QObject* parent)
+SearchEngine::SearchEngine(QObject* parent)
     : QObject(parent)
     , m_name(DEFAULT_SEARCH_NAME)
     , m_description(DEFAULT_SEARCH_DESC)
     , m_template(DEFAULT_SEARCH_TEMPLATE)
 {
-    QString searchenginesSubDir("searchengines");
-    QString filename = searchenginesSubDir + "/" + name + ".xml";
-    m_path = QStandardPaths::locate(QStandardPaths::DataLocation, filename);
-    if (!m_path.isEmpty()) {
-        parseOpenSearchDescription();
+}
+
+const QString& SearchEngine::filename() const
+{
+    return m_filename;
+}
+
+void SearchEngine::setFilename(const QString& filename)
+{
+    if (filename != m_filename) {
+        m_filename = filename;
+        Q_EMIT filenameChanged();
+
+        m_name = DEFAULT_SEARCH_NAME;
+        m_description = DEFAULT_SEARCH_DESC;
+        m_template = DEFAULT_SEARCH_TEMPLATE;
+
+        if (!filename.isEmpty()) {
+            QString filepath = QStandardPaths::locate(QStandardPaths::DataLocation,
+                                                      "searchengines/" + filename + ".xml");
+            if (!filepath.isEmpty()) {
+                QFile file(filepath);
+                if (file.open(QIODevice::ReadOnly)) {
+                    // Parse OpenSearch description file
+                    // (http://www.opensearch.org/Specifications/OpenSearch/1.1)
+                    QXmlStreamReader parser(&file);
+                    while (!parser.atEnd()) {
+                        parser.readNext();
+                        if (parser.isStartElement()) {
+                            QStringRef name = parser.name();
+                            if (name == "ShortName") {
+                                m_name = parser.readElementText();
+                            } else if (name == "Description") {
+                                m_description = parser.readElementText();
+                            } else if (name == "Url") {
+                                if (parser.attributes().value("type") == "text/html") {
+                                    m_template = parser.attributes().value("template").toString();
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        Q_EMIT nameChanged();
+        Q_EMIT descriptionChanged();
+        Q_EMIT urlTemplateChanged();
     }
 }
 
-SearchEngine::SearchEngine(const SearchEngine& other)
-{
-    m_path = other.m_path;
-    m_name = other.m_name;
-    m_description = other.m_description;
-    m_template = other.m_template;
-}
-
-bool SearchEngine::isValid() const
-{
-    return (!m_name.isEmpty() && !m_template.isEmpty());
-}
-
 const QString& SearchEngine::name() const
 {
     return m_name;
@@ -66,27 +96,3 @@
 {
     return m_template;
 }
-
-void SearchEngine::parseOpenSearchDescription()
-{
-    QFile file(m_path);
-    if (!file.open(QIODevice::ReadOnly)) {
-        return;
-    }
-    QXmlStreamReader parser(&file);
-    while (!parser.atEnd()) {
-        parser.readNext();
-        if (parser.isStartElement()) {
-            QStringRef name = parser.name();
-            if (name == "ShortName") {
-                m_name = parser.readElementText();
-            } else if (name == "Description") {
-                m_description = parser.readElementText();
-            } else if (name == "Url") {
-                if (parser.attributes().value("type") == "text/html") {
-                    m_template = parser.attributes().value("template").toString();
-                }
-            }
-        }
-    }
-}

=== modified file 'src/app/webbrowser/searchengine.h'
--- src/app/webbrowser/searchengine.h	2014-06-30 10:40:59 +0000
+++ src/app/webbrowser/searchengine.h	2015-03-24 15:51:06 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Canonical Ltd.
+ * Copyright 2014-2015 Canonical Ltd.
  *
  * This file is part of webbrowser-app.
  *
@@ -19,11 +19,7 @@
 #ifndef __SEARCH_ENGINE_H__
 #define __SEARCH_ENGINE_H__
 
-// local
-#include "config.h"
-
 // Qt
-#include <QtCore/QMetaType>
 #include <QtCore/QObject>
 #include <QtCore/QString>
 
@@ -31,28 +27,32 @@
 {
     Q_OBJECT
 
-    Q_PROPERTY(QString name READ name CONSTANT)
-    Q_PROPERTY(QString description READ description CONSTANT)
-    Q_PROPERTY(QString template READ urlTemplate CONSTANT)
+    Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged)
+    Q_PROPERTY(QString name READ name NOTIFY nameChanged)
+    Q_PROPERTY(QString description READ description NOTIFY descriptionChanged)
+    Q_PROPERTY(QString urlTemplate READ urlTemplate NOTIFY urlTemplateChanged)
 
 public:
-    SearchEngine(const QString& name=DEFAULT_SEARCH_ENGINE, QObject* parent=0);
-    SearchEngine(const SearchEngine& other);
-
-    bool isValid() const;
+    SearchEngine(QObject* parent=0);
+
+    const QString& filename() const;
+    void setFilename(const QString& filename);
+
     const QString& name() const;
     const QString& description() const;
     const QString& urlTemplate() const;
 
+Q_SIGNALS:
+    void filenameChanged() const;
+    void nameChanged() const;
+    void descriptionChanged() const;
+    void urlTemplateChanged() const;
+
 private:
-    QString m_path;
+    QString m_filename;
     QString m_name;
     QString m_description;
     QString m_template;
-
-    void parseOpenSearchDescription();
 };
 
-Q_DECLARE_METATYPE(SearchEngine);
-
 #endif // __SEARCH_ENGINE_H__

=== removed file 'src/app/webbrowser/settings.cpp'
--- src/app/webbrowser/settings.cpp	2015-02-09 10:16:16 +0000
+++ src/app/webbrowser/settings.cpp	1970-01-01 00:00:00 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright 2013-2015 Canonical Ltd.
- *
- * This file is part of webbrowser-app.
- *
- * webbrowser-app is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * webbrowser-app is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-// local
-#include "settings.h"
-#include "config.h"
-#include "searchengine.h"
-
-// Qt
-#include <QtCore/QSettings>
-
-Settings::Settings(QObject* parent)
-    : QObject(parent)
-    , m_searchengine(NULL)
-{
-    QSettings settings(QCoreApplication::applicationName(), "settings");
-    m_homepage = settings.value("homepage", QUrl(DEFAULT_HOMEPAGE)).toUrl();
-    QString name = settings.value("searchengine", QString(DEFAULT_SEARCH_ENGINE)).toString();
-    m_searchengine = new SearchEngine(name, this);
-    m_allowOpenInBackgroundTab = settings.value("allowOpenInBackgroundTab", "default").toString().toLower();
-    m_restoreSession = settings.value("restoreSession", true).toBool();
-}
-
-const QUrl& Settings::homepage() const
-{
-    return m_homepage;
-}
-
-SearchEngine* Settings::searchEngine() const
-{
-    return m_searchengine;
-}
-
-const QString& Settings::allowOpenInBackgroundTab() const
-{
-    return m_allowOpenInBackgroundTab;
-}
-
-bool Settings::restoreSession() const
-{
-    return m_restoreSession;
-}

=== removed file 'src/app/webbrowser/settings.h'
--- src/app/webbrowser/settings.h	2015-02-09 10:16:16 +0000
+++ src/app/webbrowser/settings.h	1970-01-01 00:00:00 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright 2013-2015 Canonical Ltd.
- *
- * This file is part of webbrowser-app.
- *
- * webbrowser-app is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * webbrowser-app is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __SETTINGS_H__
-#define __SETTINGS_H__
-
-// Qt
-#include <QtCore/QObject>
-#include <QtCore/QUrl>
-
-class SearchEngine;
-
-/*
- * Temporary helper class for read-only settings
- * until Settings support lands in the SDK.
- */
-class Settings : public QObject
-{
-    Q_OBJECT
-
-public:
-    Settings(QObject* parent=0);
-
-    const QUrl& homepage() const;
-    SearchEngine* searchEngine() const;
-    const QString& allowOpenInBackgroundTab() const;
-    bool restoreSession() const;
-
-private:
-    QUrl m_homepage;
-    SearchEngine* m_searchengine;
-    QString m_allowOpenInBackgroundTab; //"true" for enabled, "default" for form factor dependend behaviour (currently desktop only), anything else disables the option
-    bool m_restoreSession; // true by default
-};
-
-#endif // __SETTINGS_H__

=== added file 'src/app/webbrowser/urlManagement.js'
--- src/app/webbrowser/urlManagement.js	1970-01-01 00:00:00 +0000
+++ src/app/webbrowser/urlManagement.js	2015-03-24 15:51:06 +0000
@@ -0,0 +1,12 @@
+'use strict'
+
+function fixUrl(address) {
+    var url = address
+    if (address.substr(0, 1) == "/") {
+        url = "file://" + address
+    } else if (address.indexOf("://") == -1) {
+        url = "http://" + address
+    }
+    return url
+}
+

=== modified file 'src/app/webbrowser/webbrowser-app.cpp'
--- src/app/webbrowser/webbrowser-app.cpp	2015-02-27 09:28:41 +0000
+++ src/app/webbrowser/webbrowser-app.cpp	2015-03-24 15:51:06 +0000
@@ -27,7 +27,6 @@
 #include "history-domainlist-chronological-model.h"
 #include "limit-proxy-model.h"
 #include "searchengine.h"
-#include "settings.h"
 #include "tabs-model.h"
 #include "webbrowser-app.h"
 
@@ -92,16 +91,10 @@
     qmlRegisterType<TabsModel>(uri, 0, 1, "TabsModel");
     qmlRegisterType<BookmarksModel>(uri, 0, 1, "BookmarksModel");
     qmlRegisterSingletonType<FileOperations>(uri, 0, 1, "FileOperations", FileOperations_singleton_factory);
+    qmlRegisterType<SearchEngine>(uri, 0, 1, "SearchEngine");
 
     if (BrowserApplication::initialize("webbrowser/webbrowser-app.qml")) {
-        Settings settings;
-        SearchEngine* searchEngine = settings.searchEngine();
-        searchEngine->setParent(m_window);
-        m_window->setProperty("homepage", settings.homepage());
-        m_window->setProperty("searchEngine", QVariant::fromValue(searchEngine));
-        m_window->setProperty("allowOpenInBackgroundTab", settings.allowOpenInBackgroundTab());
-        m_window->setProperty("restoreSession", settings.restoreSession() &&
-                                                !m_arguments.contains("--new-session"));
+        m_window->setProperty("newSession", m_arguments.contains("--new-session"));
         QVariantList urls;
         Q_FOREACH(const QUrl& url, this->urls()) {
             urls.append(url);

=== modified file 'src/app/webbrowser/webbrowser-app.qml'
--- src/app/webbrowser/webbrowser-app.qml	2015-01-29 22:25:54 +0000
+++ src/app/webbrowser/webbrowser-app.qml	2015-03-24 15:51:06 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013-2014 Canonical Ltd.
+ * Copyright 2013-2015 Canonical Ltd.
  *
  * This file is part of webbrowser-app.
  *
@@ -23,12 +23,8 @@
 BrowserWindow {
     id: window
 
-    property alias searchEngine: browser.searchEngine
-    property alias restoreSession: browser.restoreSession
-    property alias allowOpenInBackgroundTab: browser.allowOpenInBackgroundTab
-
-    property alias homepage: browser.homepage
     property alias urls: browser.initialUrls
+    property alias newSession: browser.newSession
 
     currentWebview: browser.currentWebview
 

