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

KIMAP Library

  • kimap
sessionlogger.cpp
1 /*
2  Copyright (c) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
3  Author: Kevin Ottens <kevin@kdab.com>
4 
5  This library is free software; you can redistribute it and/or modify it
6  under the terms of the GNU Library General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or (at your
8  option) any later version.
9 
10  This library is distributed in the hope that it will be useful, but WITHOUT
11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13  License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to the
17  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  02110-1301, USA.
19 */
20 
21 #include "sessionlogger_p.h"
22 
23 #include <unistd.h>
24 
25 using namespace KIMAP;
26 
27 SessionLogger::SessionLogger()
28  : m_id( 0 )
29 {
30  static qint64 nextId = 0;
31  m_id = ++nextId;
32 
33  m_file.setFileName( qgetenv( "KIMAP_LOGFILE" )
34  + '.' + QString::number( getpid() )
35  + '.' + QString::number( m_id ) );
36  m_file.open( QFile::WriteOnly );
37 }
38 
39 SessionLogger::~SessionLogger()
40 {
41  m_file.close();
42 }
43 
44 void SessionLogger::dataSent( const QByteArray &data )
45 {
46  m_file.write( "C: "+data.trimmed()+'\n' );
47  m_file.flush();
48 }
49 
50 void SessionLogger::dataReceived( const QByteArray &data )
51 {
52  m_file.write( "S: "+data.trimmed()+'\n' );
53  m_file.flush();
54 }
55 
56 void SessionLogger::disconnectionOccured()
57 {
58  m_file.write( "X\n" );
59 }
60 
61 
62 
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Sep 24 2012 09:02:26 by doxygen 1.8.1.1 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.9.1 API Reference

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