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

KIO

kpasswdserverloop.cpp

Go to the documentation of this file.
00001 /*
00002  *  This file is part of the KDE libraries
00003  *  Copyright (c) 2009 Michael Leupold <lemma@confuego.org>
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Lesser General Public
00007  *  License as published by the Free Software Foundation; either
00008  *  version 2.1 of the License, or (at your option) version 3, or any
00009  *  later version accepted by the membership of KDE e.V. (or its
00010  *  successor approved by the membership of KDE e.V.), which shall
00011  *  act as a proxy defined in Section 6 of version 3 of the license.
00012  *
00013  *  This library is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  *  Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public
00019  *  License along with this library.  If not, see <http://www.gnu.org/licenses/>.
00020  */
00021 
00022 #include <QtDBus/QDBusConnection>
00023 #include <QtDBus/QDBusConnectionInterface>
00024 
00025 #include "kpasswdserverloop_p.h"
00026 
00027 namespace KIO
00028 {
00029 
00030 KPasswdServerLoop::KPasswdServerLoop() : m_seqNr(-1)
00031 {
00032     connect(QDBusConnection::sessionBus().interface(),
00033             SIGNAL(serviceOwnerChanged(QString, QString, QString)),
00034             this,
00035             SLOT(slotServiceOwnerChanged(QString, QString, QString)));
00036 }
00037 
00038 KPasswdServerLoop::~KPasswdServerLoop()
00039 {
00040 }
00041 
00042 bool KPasswdServerLoop::waitForResult(qlonglong requestId)
00043 {
00044     m_requestId = requestId;
00045     m_seqNr = -1;
00046     m_authInfo = AuthInfo();
00047     return (exec() == 0);
00048 }
00049 
00050 qlonglong KPasswdServerLoop::seqNr() const
00051 {
00052     return m_seqNr;
00053 }
00054 
00055 const AuthInfo &KPasswdServerLoop::authInfo() const
00056 {
00057     return m_authInfo;
00058 }
00059 
00060 void KPasswdServerLoop::slotQueryResult(qlonglong requestId, qlonglong seqNr,
00061                                        const KIO::AuthInfo &authInfo)
00062 {
00063     if (m_requestId == requestId) {
00064         m_seqNr = seqNr;
00065         m_authInfo = authInfo;
00066         exit(0);
00067     }
00068 }
00069 
00070 void KPasswdServerLoop::slotServiceOwnerChanged(const QString &name, const QString &oldOwner,
00071                                                const QString &newOwner)
00072 {
00073     Q_UNUSED(oldOwner);
00074 
00075     if (newOwner.isEmpty() && name == "org.kde.kded") {
00076         exit(-1);
00077     }
00078 }
00079 
00080 }
00081 
00082 #include "kpasswdserverloop_p.moc"

KIO

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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