• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.3 API Reference
  • KDE Home
  • Contact Us
 

KIMAP Library

sessionlogger.cpp
00001 /*
00002     Copyright (c) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
00003     Author: Kevin Ottens <kevin@kdab.com>
00004 
00005     This library is free software; you can redistribute it and/or modify it
00006     under the terms of the GNU Library General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or (at your
00008     option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful, but WITHOUT
00011     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013     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 the
00017     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018     02110-1301, USA.
00019 */
00020 
00021 #include "sessionlogger_p.h"
00022 
00023 #include <unistd.h>
00024 
00025 using namespace KIMAP;
00026 
00027 SessionLogger::SessionLogger()
00028   : m_id( 0 )
00029 {
00030   static qint64 nextId = 0;
00031   m_id = ++nextId;
00032 
00033   m_file.setFileName( qgetenv( "KIMAP_LOGFILE" )
00034                     + '.' + QString::number( getpid() )
00035                     + '.' + QString::number( m_id ) );
00036   m_file.open( QFile::WriteOnly );
00037 }
00038 
00039 SessionLogger::~SessionLogger()
00040 {
00041   m_file.close();
00042 }
00043 
00044 void SessionLogger::dataSent( const QByteArray &data )
00045 {
00046   m_file.write( "C: "+data.trimmed()+'\n' );
00047   m_file.flush();
00048 }
00049 
00050 void SessionLogger::dataReceived( const QByteArray &data )
00051 {
00052   m_file.write( "S: "+data.trimmed()+'\n' );
00053   m_file.flush();
00054 }
00055 
00056 void SessionLogger::disconnectionOccured()
00057 {
00058   m_file.write( "X\n" );
00059 }
00060 
00061 
00062 
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Apr 30 2012 21:48:32 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIMAP Library

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

kdepimlibs-4.8.3 API Reference

Skip menu "kdepimlibs-4.8.3 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