~ubuntu-branches/ubuntu/jaunty/psi/jaunty

« back to all changes in this revision

Viewing changes to src/tools/systemwatch/systemwatch.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-04-14 18:57:30 UTC
  • mfrom: (2.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080414185730-528re3zp0m2hdlhi
Tags: 0.11-8
* added CONFIG -= link_prl to .pro files and removed dependencies
  which are made unnecessary by this change
* Fix segfault when closing last chat tab with qt4.4
  (This is from upstream svn, rev. 1101) (Closes: Bug#476122)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
        #include "systemwatch_unix.h"
28
28
#endif
29
29
 
30
 
 
31
 
SystemWatch::SystemWatch()
32
 
{
33
 
        SystemWatchImpl* impl;
 
30
#include <QApplication>
 
31
 
 
32
SystemWatch::SystemWatch() : QObject(qApp)
 
33
{
 
34
}
 
35
 
 
36
SystemWatch* SystemWatch::instance()
 
37
{
 
38
        if (!instance_) {
34
39
#if defined(Q_WS_MAC)
35
 
        impl = MacSystemWatch::instance();
 
40
                instance_ = new MacSystemWatch();
36
41
#elif defined(Q_WS_WIN)
37
 
        impl = WinSystemWatch::instance();
 
42
                instance_ = new WinSystemWatch();
38
43
#else
39
 
        impl = UnixSystemWatch::instance();
 
44
                instance_ = new UnixSystemWatch();
40
45
#endif
41
 
        connect(impl,SIGNAL(sleep()),this,SIGNAL(sleep()));
42
 
        connect(impl,SIGNAL(idleSleep()),this,SIGNAL(idleSleep()));
43
 
        connect(impl,SIGNAL(wakeup()),this,SIGNAL(wakeup()));
44
 
}
45
 
 
46
 
 
47
 
SystemWatch* SystemWatch::instance()
48
 
{
49
 
        if (!instance_) 
50
 
                instance_ = new SystemWatch();
51
 
 
 
46
        }
52
47
        return instance_;
53
48
}
54
49