• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

SolidModules

bluezcalljob.cpp

Go to the documentation of this file.
00001 /*  This file is part of the KDE project
00002     Copyright (C) 2006 Kevin Ottens <ervin@kde.org>
00003     Copyright (C) 2007 Daniel Gollub <dgollub@suse.de>
00004 
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License version 2 as published by the Free Software Foundation.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018     Boston, MA 02110-1301, USA.
00019 
00020 */
00021 
00022 
00023 #include "bluezcalljob.h"
00024 
00025 #include <QTimer>
00026 #include <QStringList>
00027 #include <kdebug.h>
00028 
00029 
00030 BluezCallJob::BluezCallJob(const QDBusConnection &connection, const QString &dest,
00031                            const QString &path, const QString &interface,
00032                            const QString &methodName, const QList<QVariant> &params)
00033         : KJob(), m_connection(connection), m_dest(dest), m_path(path),
00034         m_iface(interface), m_method(methodName),
00035         m_params(params)
00036 {}
00037 
00038 BluezCallJob::~BluezCallJob()
00039 {}
00040 
00041 void BluezCallJob::start()
00042 {
00043     QTimer::singleShot(0, this, SLOT(doStart()));
00044 }
00045 
00046 void BluezCallJob::kill(bool /*quietly */)
00047 {}
00048 
00049 void BluezCallJob::doStart()
00050 {
00051     QDBusMessage msg = QDBusMessage::createMethodCall(m_dest, m_path,
00052                        m_iface, m_method);
00053     msg.setArguments(m_params);
00054 
00055     if (!m_connection.callWithCallback(msg, this, SLOT(callReply(const QDBusMessage &)), SLOT(callError(const QDBusError &)))) {
00056         setError(1);
00057         setErrorText(m_connection.lastError().name() + ": " + m_connection.lastError().message());
00058         emitResult();
00059     }
00060 }
00061 
00062 void BluezCallJob::callError(const QDBusError &error)
00063 {
00064     setError(1);
00065     setErrorText(error.name() + ": " + error.message());
00066 
00067     emitResult();
00068 }
00069 
00070 void BluezCallJob::callReply(const QDBusMessage  & /*reply */)
00071 {
00072     setError(0);
00073     emitResult();
00074 }
00075 
00076 #include "bluezcalljob.moc"

SolidModules

Skip menu "SolidModules"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal