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

qgpgme

eventloopinteractor_unix.cpp

00001 /* qeventloopinteractor.cpp
00002    Copyright (C) 2003, 2007 Klarälvdalens Datakonsult AB
00003 
00004    This file is part of QGPGME.
00005 
00006    QGPGME is free software; you can redistribute it and/or modify it
00007    under the terms of the GNU Library General Public License as published
00008    by the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010 
00011    QGPGME is distributed in the hope that it will be useful, but
00012    WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with QGPGME; see the file COPYING.LIB.  If not, write to the
00018    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA. */
00020 
00021 // -*- c++ -*-
00022 
00023 #include <qgpgme/eventloopinteractor.h>
00024 
00025 #include <QSocketNotifier>
00026 
00027 void * QGpgME::EventLoopInteractor::registerWatcher( int fd, Direction dir, bool & ok ) {
00028     QSocketNotifier * const sn = new QSocketNotifier( fd, dir == Read ? QSocketNotifier::Read : QSocketNotifier::Write );
00029     if( dir == Read )
00030         connect( sn, SIGNAL(activated(int)), this, SLOT(slotReadActivity(int)) );
00031     else
00032         connect( sn, SIGNAL(activated(int)), this, SLOT(slotWriteActivity(int)) );
00033     ok = true; // Can above operations fails?
00034     return sn;
00035 }
00036 
00037 void QGpgME::EventLoopInteractor::unregisterWatcher( void * tag ) {
00038     static_cast<QSocketNotifier*>( tag )->deleteLater();
00039 }

qgpgme

Skip menu "qgpgme"
  • Main Page
  • File List

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.6
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