~dandrader/qtmir/frozenApps-lp1295623

« back to all changes in this revision

Viewing changes to src/platforms/mirserver/mirserverconfiguration.cpp

  • Committer: CI bot
  • Author(s): Alan Griffiths
  • Date: 2014-09-07 19:42:23 UTC
  • mfrom: (239.2.2 qtmir)
  • Revision ID: ps-jenkins@lists.canonical.com-20140907194223-yok7osexyba9yb28
Provide Mir with a handler for any command-line arguments it fails to parse. For the moment, these are simply ignored.

This overrides Mir's default behavior of reporting an error. Fixes: 1361210
Approved by: Gerry Boland, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include "logging.h"
32
32
#include "unityprotobufservice.h"
33
33
 
 
34
// mir
 
35
#include <mir/options/default_configuration.h>
 
36
 
34
37
// Qt
35
38
#include <QDebug>
36
39
 
37
40
// egl
38
41
#include <EGL/egl.h>
39
42
 
 
43
namespace mo  = mir::options;
40
44
namespace msh = mir::shell;
41
45
namespace ms = mir::scene;
42
46
 
 
47
namespace
 
48
{
 
49
void ignore_unparsed_arguments(int /*argc*/, char const* const/*argv*/[])
 
50
{
 
51
}
 
52
}
 
53
 
43
54
Q_LOGGING_CATEGORY(QTMIR_MIR_MESSAGES, "qtmir.mir")
44
55
 
45
56
MirServerConfiguration::MirServerConfiguration(int argc, char const* argv[], QObject* parent)
46
57
    : QObject(parent)
47
 
    , DefaultServerConfiguration(argc, argv)
 
58
    , DefaultServerConfiguration(std::make_shared<mo::DefaultConfiguration>(argc, argv, &ignore_unparsed_arguments))
48
59
    , m_unityService(std::make_shared<UnityProtobufService>())
49
60
{
50
61
    qCDebug(QTMIR_MIR_MESSAGES) << "MirServerConfiguration created";