~daker/webbrowser-app/fix.1317428

« back to all changes in this revision

Viewing changes to src/app/webbrowser/settings.cpp

  • Committer: CI bot
  • Author(s): Olivier Tilloy
  • Date: 2014-06-30 20:47:15 UTC
  • mfrom: (586.1.3 opensearch)
  • Revision ID: ps-jenkins@lists.canonical.com-20140630204715-2fl7qm5seprr0o2d
Add support for custom search engines defined by the OpenSearch description document format
(http://www.opensearch.org/Specifications/OpenSearch/1.1). Fixes: 1277637, 1334546

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
// local
20
20
#include "settings.h"
21
21
#include "config.h"
 
22
#include "searchengine.h"
22
23
 
23
24
// Qt
24
25
#include <QtCore/QSettings>
25
26
 
26
27
Settings::Settings(QObject* parent)
27
28
    : QObject(parent)
 
29
    , m_searchengine(NULL)
28
30
{
29
31
    QSettings settings(QCoreApplication::applicationName(), "settings");
30
32
    m_homepage = settings.value("homepage", QUrl(DEFAULT_HOMEPAGE)).toUrl();
 
33
    QString name = settings.value("searchengine", QString(DEFAULT_SEARCH_ENGINE)).toString();
 
34
    m_searchengine = new SearchEngine(name, this);
31
35
}
32
36
 
33
37
const QUrl& Settings::homepage() const
34
38
{
35
39
    return m_homepage;
36
40
}
 
41
 
 
42
SearchEngine* Settings::searchEngine() const
 
43
{
 
44
    return m_searchengine;
 
45
}