~tiagosh/unity-2d/unity-2d-shell-homelens

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/abstractdbusservicemonitor.cpp

  • Committer: Tiago Salem Herrmann
  • Date: 2012-02-10 14:33:11 UTC
  • mfrom: (943.2.60 shell)
  • Revision ID: tiago.herrmann@canonical.com-20120210143311-3b4vqnd0oe94qaor
* New upstream release
  - unity-2d-launcher crashed with SIGSEGV  when opening a folder on a CD
    (LP: #831868)
  - unity-2d-places crashed with SIGSEGV in QScriptValue::call()
    (LP: #836498)
  - unity-2d-launcher crashed with SIGSEGV in geis_finish() (LP: #850893)
  - unity-2d-places crashed with SIGABRT in raise() (LP: #857575)
  - unity-2d-launcher crashed with SIGSEGV in exit() (LP: #859596)
  - [spread] layout broken since bzr revision 799 of lp:unity-2d
    (LP: #900895)
  - [workspace switcher] keyboard navigation of workspace switcher broken
    for accessibility (LP: #744978)
  - [spread] workspace switcher performance is poor, especially on low
    powered CPUs (LP: #745764)
  - Launcher - the rendering of the BFB and Lens squircle does not match the
    design (LP: #838708)
  - [dash] Huge performance hit when scrolling search results with
    accessibility enabled (LP: #862956)
  - DBUS_STARTER_ADDRESS and DBUS_STARTER_BUS_TYPE aren't always unset from
    environment making gedit and possibly others fail to start (LP: #873027)
  - Win Key can not be disabled in Unity-2d (LP: #873580)
  - [dash] Unity-2d dash very slow to open (LP: #881756)
  - [tests] LauncherViewTest hanging (LP: #894380)
  - [tests] Unit tests failing due to lack of Xserver (LP: #894381)
  - [launcher] Alt+F1 broken: does not give the focus to the launcher's
    content (LP: #901505)
  - [tests] Add Automated User Experience testing (LP: #903495)
  - [workspace switcher] Performance can be poor when using the opengl
    backend because of window texture sizes that are not limited
    (LP: #808716)
  - [dash] no way to unmaximize (LP: #860400)
  - [launcher] In non-composite mode, background is black (LP: #879288)
  - [dash] Unity 2D shows 'Search' instead of 'Run Command' on ALT + F2
    (LP: #883392)
  - [launcher] Removing icon from launcher makes it hide immediately
    (LP: #884410)
  - OpenGL disabled regardless of use-opengl setting (LP: #887957)
  - if libdir does not equal lib (LP: #888164)
  - [launcher] Launcher stuck open while mouse moved to left corner of panel
    (LP: #892004)
  - [dash] Long results label are truncated instead of elided and a few
    pixels of the next line is visible (LP: #901491)
  - [launcher] Dash icon missing in PPA (LP: #903182)
  - [launcher] Tile context menu should appear at mouse click down event
    (LP: #813036)
  - [launcher] Trash tile highlight is truncated top and bottom
    (LP: #876589)
  - [dash] Text highlighting color is wrong (LP: #880222)
  - [launcher] left edge of panel should not reveal launcher (LP: #891636)
  - [dash] Word "Filter results" has underline when highlighted
    (LP: #893061)
  - [launcher] Alt+F1, change desktop, Alt+F1, hit Esc: launcher doesn't
    give away focus (LP: #897640)
  - Top Bar - rename the "Desktop" title in the Top Bar (displayed when no
    window has focus)  to "Ubuntu Desktop" (LP: #869873)
  - [launcher] Show desktop doesn't show launcher (LP: #898161)
  - [launcher] Context menu/tooltip not positioned at Tile center
    (LP: #898349)
  - The QT_LAYOUT_DIRECTION string needs a translator comment (LP: #863058)
  - unity panel menus don't stay open when clicked on second monitor
    (LP: #869196)
  - Dash- More fixes to layout and alignments (LP: #906235)
* debian/control:
  - build-dep on latest libunity-core-5.0-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
AbstractDBusServiceMonitor::AbstractDBusServiceMonitor(QString service, QString path,
27
27
                                                       QString interface, QObject *parent)
28
28
    : QObject(parent)
29
 
    , m_enabled(false)
30
29
    , m_service(service)
31
30
    , m_path(path)
32
31
    , m_interface(interface)
33
32
    , m_watcher(new QDBusServiceWatcher(service, QDBusConnection::sessionBus()))
34
33
    , m_dbusInterface(0)
35
34
{
 
35
    connect(m_watcher, SIGNAL(serviceRegistered(QString)), SLOT(createInterface()));
 
36
    connect(m_watcher, SIGNAL(serviceUnregistered(QString)), SLOT(destroyInterface()));
 
37
 
 
38
    // Connect to the service if it's up already
 
39
    QDBusConnectionInterface* sessionBus = QDBusConnection::sessionBus().interface();
 
40
    QDBusReply<bool> reply = sessionBus->isServiceRegistered(m_service);
 
41
    if (reply.isValid() && reply.value()) {
 
42
        createInterface();
 
43
    }
36
44
}
37
45
 
38
46
AbstractDBusServiceMonitor::~AbstractDBusServiceMonitor()
43
51
    }
44
52
}
45
53
 
46
 
bool AbstractDBusServiceMonitor::enabled() const
47
 
{
48
 
    return m_enabled;
49
 
}
50
 
 
51
 
/* We don't do this in the constructor because if the service is already up we emit the
52
 
   serviceStateChanged() signal during the constructor and we lose it since we can't have any slot
53
 
   connected to it already */
54
 
 
55
 
void AbstractDBusServiceMonitor::setEnabled(bool enabled)
56
 
{
57
 
    if (m_enabled != enabled) {
58
 
        if (enabled) {
59
 
            connect(m_watcher, SIGNAL(serviceRegistered(QString)), SLOT(createInterface(QString)));
60
 
            connect(m_watcher, SIGNAL(serviceUnregistered(QString)), SLOT(destroyInterface(QString)));
61
 
 
62
 
            // Connect to the service if it's up already
63
 
            QDBusConnectionInterface* sessionBus = QDBusConnection::sessionBus().interface();
64
 
            QDBusReply<bool> reply = sessionBus->isServiceRegistered(m_service);
65
 
            if (reply.isValid() && reply.value()) {
66
 
                createInterface(m_service);
67
 
            }
68
 
        } else {
69
 
            if (m_dbusInterface != 0) {
70
 
                delete m_dbusInterface;
71
 
                m_dbusInterface = 0;
72
 
            }
73
 
            m_watcher->disconnect(this);
74
 
        }
75
 
 
76
 
        m_enabled = enabled;
77
 
    }
78
 
}
79
 
 
80
 
void AbstractDBusServiceMonitor::createInterface(QString service)
 
54
void AbstractDBusServiceMonitor::createInterface()
81
55
{
82
56
    if (m_dbusInterface != 0) {
83
57
        delete m_dbusInterface;
84
58
        m_dbusInterface = 0;
85
59
    }
86
60
 
87
 
    m_dbusInterface = new QDBusInterface(service, m_path, m_interface,
 
61
    m_dbusInterface = new QDBusInterface(m_service, m_path, m_interface,
88
62
                                         QDBusConnection::sessionBus());
89
 
    Q_EMIT serviceStateChanged(true);
 
63
    Q_EMIT serviceAvailableChanged(true);
90
64
}
91
65
 
92
 
void AbstractDBusServiceMonitor::destroyInterface(QString service)
 
66
void AbstractDBusServiceMonitor::destroyInterface()
93
67
{
94
 
    Q_UNUSED(service);
95
 
 
96
68
    if (m_dbusInterface != 0) {
97
69
        delete m_dbusInterface;
98
70
        m_dbusInterface = 0;
99
71
    }
100
72
 
101
 
    Q_EMIT serviceStateChanged(false);
 
73
    Q_EMIT serviceAvailableChanged(false);
102
74
}
103
75
 
104
76
QDBusInterface* AbstractDBusServiceMonitor::dbusInterface() const
106
78
    return m_dbusInterface;
107
79
}
108
80
 
 
81
bool AbstractDBusServiceMonitor::serviceAvailable() const
 
82
{
 
83
    return m_dbusInterface != 0;
 
84
}
 
85
 
109
86
#include "abstractdbusservicemonitor.moc"