not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / libs / solid / control / frontendobject.cpp
blobdfd995920a423513fe807343d1a6def9813e320c
1 /* This file is part of the KDE project
2 Copyright (C) 2006-2007 Kevin Ottens <ervin@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
20 #include "frontendobject_p.h"
22 #include <QtCore/QObject>
24 Solid::Control::FrontendObjectPrivate::FrontendObjectPrivate(QObject *parent)
25 : m_parent(parent), m_backendObject(0)
29 Solid::Control::FrontendObjectPrivate::~FrontendObjectPrivate()
33 QObject *Solid::Control::FrontendObjectPrivate::parent() const
35 return m_parent;
38 QObject *Solid::Control::FrontendObjectPrivate::backendObject() const
40 return m_backendObject;
43 void Solid::Control::FrontendObjectPrivate::setBackendObject(QObject *object)
45 if (m_backendObject)
47 QObject::disconnect(m_parent, 0, m_backendObject, 0);
48 m_backendObject->disconnect(m_parent);
51 m_backendObject = object;
53 if (m_backendObject)
55 QObject::connect(m_backendObject, SIGNAL(destroyed(QObject *)),
56 m_parent, SLOT(_k_destroyed(QObject *)));
60 void Solid::Control::FrontendObjectPrivate::_k_destroyed(QObject *object)
62 if (m_backendObject == object) {
63 m_backendObject = 0;