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

KIO

  • kio
  • kio
kpasswdserverloop.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the KDE libraries
3 * Copyright (c) 2009 Michael Leupold <lemma@confuego.org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) version 3, or any
9 * later version accepted by the membership of KDE e.V. (or its
10 * successor approved by the membership of KDE e.V.), which shall
11 * act as a proxy defined in Section 6 of version 3 of the license.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#include "kpasswdserverloop_p.h"
23
24#include <QtDBus/QDBusConnection>
25#include <QtDBus/QDBusServiceWatcher>
26
27namespace KIO
28{
29
30KPasswdServerLoop::KPasswdServerLoop() : m_seqNr(-1)
31{
32 QDBusServiceWatcher *watcher = new QDBusServiceWatcher("org.kde.kded", QDBusConnection::sessionBus(),
33 QDBusServiceWatcher::WatchForUnregistration, this);
34 connect(watcher, SIGNAL(serviceUnregistered(QString)),
35 this, SLOT(kdedServiceUnregistered()));
36}
37
38KPasswdServerLoop::~KPasswdServerLoop()
39{
40}
41
42bool KPasswdServerLoop::waitForResult(qlonglong requestId)
43{
44 m_requestId = requestId;
45 m_seqNr = -1;
46 m_authInfo = AuthInfo();
47 return (exec() == 0);
48}
49
50qlonglong KPasswdServerLoop::seqNr() const
51{
52 return m_seqNr;
53}
54
55const AuthInfo &KPasswdServerLoop::authInfo() const
56{
57 return m_authInfo;
58}
59
60void KPasswdServerLoop::slotQueryResult(qlonglong requestId, qlonglong seqNr,
61 const KIO::AuthInfo &authInfo)
62{
63 if (m_requestId == requestId) {
64 m_seqNr = seqNr;
65 m_authInfo = authInfo;
66 exit(0);
67 }
68}
69
70void KPasswdServerLoop::kdedServiceUnregistered()
71{
72 exit(-1);
73}
74
75}
76
77#include "kpasswdserverloop_p.moc"
KIO::AuthInfo
This class is intended to make it easier to prompt for, cache and retrieve authorization information.
Definition: authinfo.h:58
KIO::KPasswdServerLoop::KPasswdServerLoop
KPasswdServerLoop()
Definition: kpasswdserverloop.cpp:30
KIO::KPasswdServerLoop::waitForResult
bool waitForResult(qlonglong requestId)
Definition: kpasswdserverloop.cpp:42
KIO::KPasswdServerLoop::seqNr
qlonglong seqNr() const
Definition: kpasswdserverloop.cpp:50
KIO::KPasswdServerLoop::~KPasswdServerLoop
virtual ~KPasswdServerLoop()
Definition: kpasswdserverloop.cpp:38
KIO::KPasswdServerLoop::slotQueryResult
void slotQueryResult(qlonglong requestId, qlonglong seqNr, const KIO::AuthInfo &authInfo)
Definition: kpasswdserverloop.cpp:60
KIO::KPasswdServerLoop::authInfo
const AuthInfo & authInfo() const
Definition: kpasswdserverloop.cpp:55
kpasswdserverloop_p.h
KIO
A namespace for KIO globals.
Definition: kbookmarkmenu.h:55
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

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

kdelibs-4.14.38 API Reference

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