• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.9.4 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 #if defined (WITH_SOLID_UDISKS2)
34 #include "backends/udisks2/udisksmanager.h"
35 #else
36 #include "backends/udisks/udisksmanager.h"
37 #endif
38 #include "backends/upower/upowermanager.h"
39 
40 #if defined (HUPNP_FOUND)
41 #include "backends/upnp/upnpdevicemanager.h"
42 #endif
43 
44 #if defined (UDEV_FOUND)
45 #include "backends/udev/udevmanager.h"
46 #endif
47 
48 #include "backends/fstab/fstabmanager.h"
49 
50 #elif defined (Q_WS_WIN) && defined(HAVE_WBEM) && !defined(_WIN32_WCE)
51 #include "backends/wmi/wmimanager.h"
52 #endif
53 
54 
55 Solid::ManagerBasePrivate::ManagerBasePrivate()
56 {
57 }
58 
59 Solid::ManagerBasePrivate::~ManagerBasePrivate()
60 {
61  qDeleteAll(m_backends);
62 }
63 
64 void Solid::ManagerBasePrivate::loadBackends()
65 {
66  QString solidFakeXml(QString::fromLocal8Bit(qgetenv("SOLID_FAKEHW")));
67 
68  if (!solidFakeXml.isEmpty()) {
69  m_backends << new Solid::Backends::Fake::FakeManager(0, solidFakeXml);
70  } else {
71 # if defined(Q_OS_MAC)
72  m_backends << new Solid::Backends::IOKit::IOKitManager(0);
73 
74 # elif defined(Q_WS_WIN) && defined(HAVE_WBEM) && !defined(_WIN32_WCE)
75  m_backends << new Solid::Backends::Wmi::WmiManager(0);
76 
77 # elif defined(Q_OS_LINUX)
78 # if defined(UDEV_FOUND)
79  m_backends << new Solid::Backends::UDev::UDevManager(0);
80 # endif
81 # if defined(WITH_SOLID_UDISKS2)
82  m_backends << new Solid::Backends::UDisks2::Manager(0)
83 # else
84  m_backends << new Solid::Backends::UDisks::UDisksManager(0)
85 # endif
86  << new Solid::Backends::UPower::UPowerManager(0)
87  << new Solid::Backends::Fstab::FstabManager(0);
88 # endif
89 
90 # if defined (HUPNP_FOUND)
91  bool solidUpnpEnabled
92  = QString::fromLocal8Bit(qgetenv("SOLID_UPNP")).toInt()==1;
93  if (solidUpnpEnabled) {
94  m_backends << new Solid::Backends::UPnP::UPnPDeviceManager(0);
95  }
96 # endif
97  }
98 }
99 
100 QList<QObject*> Solid::ManagerBasePrivate::managerBackends() const
101 {
102  return m_backends;
103 }
104 
105 
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Dec 10 2012 13:47:17 by doxygen 1.8.1.2 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.4 API Reference

Skip menu "kdelibs-4.9.4 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