~chris.gagnon/ubuntu-ui-toolkit/autopilot-emulator-bug-picker-hover

« back to all changes in this revision

Viewing changes to modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.cpp

  • Committer: Tarmac
  • Author(s): Andrea Cimitan
  • Date: 2013-10-03 22:46:09 UTC
  • mfrom: (750.6.2 ubuntu-ui-toolkit)
  • Revision ID: tarmac-20131003224609-vgkc8h0kef6zmppb
Export a position value of the toolbar through dbus, setting the value of the dbus service created by the shell. Fixes: https://bugs.launchpad.net/bugs/1224480.

Approved by Michał Sawicz, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
BottomBarVisibilityCommunicator::BottomBarVisibilityCommunicator()
37
37
 : m_shellDbusIface(NULL),
38
 
   m_forceHidden(false)
 
38
   m_forceHidden(false),
 
39
   m_position(0)
39
40
{
40
41
    m_shellDbusIface = new QDBusInterface(DBUS_SERVICE, BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_PATH, BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_INTERFACE, QDBusConnection::sessionBus(), this);
41
42
    if (m_shellDbusIface->isValid()) {
51
52
    return m_forceHidden;
52
53
}
53
54
 
 
55
double BottomBarVisibilityCommunicator::position() const
 
56
{
 
57
    return m_position;
 
58
}
 
59
 
 
60
void BottomBarVisibilityCommunicator::setPosition(double position)
 
61
{
 
62
    if (position != m_position) {
 
63
        m_position = position;
 
64
        m_shellDbusIface->setProperty("position", position);
 
65
        Q_EMIT positionChanged(position);
 
66
    }
 
67
}
 
68
 
54
69
void BottomBarVisibilityCommunicator::onShellForceHiddenChanged(bool forceHidden)
55
70
{
56
71
    if (forceHidden != m_forceHidden) {