~ubuntu-branches/ubuntu/trusty/autopilot-qt/trusty

« back to all changes in this revision

Viewing changes to driver/rootnode.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Michael Zanetti, Christopher Lee, Olivier Tilloy, Ubuntu daily release
  • Date: 2013-06-05 07:08:47 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130605070847-cm5heug9bku0q19d
Tags: 1.3daily13.06.05-0ubuntu1
[ Michael Zanetti ]
* update tests to work with AP 1.3.
* make it work with Qt 5.0.2.

[ Christopher Lee ]
* Adding GetVersion so we can check that the version of the DBus
  protocol is as expected.

[ Olivier Tilloy ]
* Do not override an existing property with the value of a parent
  object. (LP: #1170764)

[ Ubuntu daily release ]
* Automatic snapshot from revision 61

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#include <QStringList>
6
6
 
7
7
RootNode::RootNode(QCoreApplication* application)
8
 
    : QtNode(application)
 
8
    : QtNode(application, std::string())
9
9
    , application_(application)
10
10
{
11
11
}
13
13
QVariant RootNode::IntrospectNode() const
14
14
{
15
15
    // return must be (name, state_map)
16
 
    QString object_name = QString::fromStdString(GetName());
 
16
    QString object_name = QString::fromStdString(GetPath());
17
17
    QStringList child_names;
18
18
    foreach(QObject* child, children_)
19
19
    {
43
43
    return appName.isEmpty() ? "Root" : appName.toStdString();
44
44
}
45
45
 
 
46
std::string RootNode::GetPath() const
 
47
{
 
48
    return "/" + GetName();
 
49
}
 
50
 
46
51
bool RootNode::MatchProperty(const std::string& name, const std::string& value) const
47
52
{
48
53
    if (name == "id")
55
60
{
56
61
    xpathselect::NodeList children;
57
62
    foreach(QObject* child, children_)
58
 
        children.push_back(std::make_shared<QtNode>(child));
 
63
        children.push_back(std::make_shared<QtNode>(child, GetPath()));
59
64
    return children;
60
65
}