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

Nepomuk-Core

  • sources
  • kde-4.12
  • kdelibs
  • nepomuk-core
  • libnepomukcore
  • service
servicecontrol2.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE Project
2  Copyright (c) 2008-2011 Sebastian Trueg <trueg@kde.org>
3  Copyright (c) 2013 Vishesh Handa <me@vhanda.in>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "servicecontrol2.h"
21 #include "servicecontroladaptor.h"
22 
23 #include <QtCore/QCoreApplication>
24 #include <QtCore/QTextStream>
25 
26 #include "nepomukservice.h"
27 #include "service2.h"
28 
29 using namespace Nepomuk2;
30 
31 ServiceControl2::ServiceControl2(Service2* service)
32  : QObject(service)
33  , m_service( service )
34  , m_initialized( false )
35  , m_failed( false )
36 {
37  QTextStream s( stderr );
38 
39  (void)new ServiceControlAdaptor( this );
40  QDBusConnection bus = QDBusConnection::sessionBus();
41  if( !bus.registerObject( "/servicecontrol", this ) ) {
42  s << "Failed to register dbus service " << service->dbusServiceName() << "." << endl;
43  m_failed = true;
44  return;
45  }
46 }
47 
48 
49 ServiceControl2::~ServiceControl2()
50 {
51 }
52 
53 
54 void ServiceControl2::setServiceInitialized( bool success )
55 {
56  m_initialized = success;
57  emit serviceInitialized( success );
58 }
59 
60 
61 bool ServiceControl2::isInitialized() const
62 {
63  return m_initialized;
64 }
65 
66 QString ServiceControl2::name() const
67 {
68  return m_service->name();
69 }
70 
71 QString ServiceControl2::description() const
72 {
73  return m_service->description();
74 }
75 
76 bool ServiceControl2::failedToStart()
77 {
78  return m_failed;
79 }
80 
81 void ServiceControl2::shutdown()
82 {
83  QCoreApplication::instance()->quit();
84 }
85 
86 #include "servicecontrol2.moc"
Nepomuk2::ServiceControl2::ServiceControl2
ServiceControl2(Service2 *service)
Definition: servicecontrol2.cpp:31
Nepomuk2::Service2::dbusServiceName
static QString dbusServiceName(const QString &serviceName)
Gives the dbus service name for the service with name serviceName.
Definition: service2.cpp:171
Nepomuk2::ServiceControl2::failedToStart
bool failedToStart()
Definition: servicecontrol2.cpp:76
Nepomuk2::ServiceControl2::description
QString description() const
Definition: servicecontrol2.cpp:71
Nepomuk2::Service2::name
QString name()
Return the generic service name.
Definition: service2.cpp:95
QObject
Nepomuk2::Service2::description
QString description()
Returns the description of the service.
Definition: service2.cpp:100
Nepomuk2::ServiceControl2::setServiceInitialized
void setServiceInitialized(bool success)
Definition: servicecontrol2.cpp:54
Nepomuk2::ServiceControl2::shutdown
void shutdown()
Definition: servicecontrol2.cpp:81
Nepomuk2::Service2
New Base class for all Nepomuk services.
Definition: service2.h:88
service2.h
Nepomuk2::ServiceControl2::~ServiceControl2
~ServiceControl2()
Definition: servicecontrol2.cpp:49
Nepomuk2::ServiceControl2::name
QString name() const
Definition: servicecontrol2.cpp:66
servicecontrol2.h
Nepomuk2::ServiceControl2::isInitialized
bool isInitialized() const
Definition: servicecontrol2.cpp:61
Nepomuk2::ServiceControl2::serviceInitialized
void serviceInitialized(bool success)
nepomukservice.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk-Core

Skip menu "Nepomuk-Core"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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