• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.5 API Reference
  • KDE Home
  • 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 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:24:58 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

qgpgme

Skip menu "qgpgme"
  • Main Page
  • File List

kdepimlibs-4.8.5 API Reference

Skip menu "kdepimlibs-4.8.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
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