• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.9.1 API Reference
  • KDE Home
  • Contact Us
 

Solid

  • solid
  • solid
managerbase.cpp
Go to the documentation of this file.
1 /*
2  Copyright 2006-2007 Kevin Ottens <ervin@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) version 3, or any
8  later version accepted by the membership of KDE e.V. (or its
9  successor approved by the membership of KDE e.V.), which shall
10  act as a proxy defined in Section 6 of version 3 of the license.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #include "managerbase_p.h"
22 
23 #include <stdlib.h>
24 #if !defined (Q_WS_WIN) && !defined (Q_OS_MAC)
25 #include <config-solid.h>
26 #endif
27 
28 #include "backends/fakehw/fakemanager.h"
29 
30 #if defined (Q_OS_MAC)
31 #include "backends/iokit/iokitmanager.h"
32 #elif defined (Q_OS_UNIX)
33 #include "backends/udisks/udisksmanager.h"
34 #include "backends/upower/upowermanager.h"
35 
36 #if defined (HUPNP_FOUND)
37 #include "backends/upnp/upnpdevicemanager.h"
38 #endif
39 
40 #if defined (UDEV_FOUND)
41 #include "backends/udev/udevmanager.h"
42 #endif
43 
44 #include "backends/fstab/fstabmanager.h"
45 
46 #elif defined (Q_WS_WIN) && defined(HAVE_WBEM) && !defined(_WIN32_WCE)
47 #include "backends/wmi/wmimanager.h"
48 #endif
49 
50 
51 Solid::ManagerBasePrivate::ManagerBasePrivate()
52 {
53 }
54 
55 Solid::ManagerBasePrivate::~ManagerBasePrivate()
56 {
57  qDeleteAll(m_backends);
58 }
59 
60 void Solid::ManagerBasePrivate::loadBackends()
61 {
62  QString solidFakeXml(QString::fromLocal8Bit(qgetenv("SOLID_FAKEHW")));
63 
64  if (!solidFakeXml.isEmpty()) {
65  m_backends << new Solid::Backends::Fake::FakeManager(0, solidFakeXml);
66  } else {
67 # if defined(Q_OS_MAC)
68  m_backends << new Solid::Backends::IOKit::IOKitManager(0);
69 
70 # elif defined(Q_WS_WIN) && defined(HAVE_WBEM) && !defined(_WIN32_WCE)
71  m_backends << new Solid::Backends::Wmi::WmiManager(0);
72 
73 # elif defined(Q_OS_LINUX)
74 # if defined(UDEV_FOUND)
75  m_backends << new Solid::Backends::UDev::UDevManager(0);
76 # endif
77  m_backends << new Solid::Backends::UDisks::UDisksManager(0)
78  << new Solid::Backends::UPower::UPowerManager(0)
79  << new Solid::Backends::Fstab::FstabManager(0);
80 # endif
81 
82 # if defined (HUPNP_FOUND)
83  bool solidUpnpEnabled
84  = QString::fromLocal8Bit(qgetenv("SOLID_UPNP")).toInt()==1;
85  if (solidUpnpEnabled) {
86  m_backends << new Solid::Backends::UPnP::UPnPDeviceManager(0);
87  }
88 # endif
89  }
90 }
91 
92 QList<QObject*> Solid::ManagerBasePrivate::managerBackends() const
93 {
94  return m_backends;
95 }
96 
97 
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Sep 24 2012 11:22:34 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Solid

Skip menu "Solid"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.9.1 API Reference

Skip menu "kdelibs-4.9.1 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal