• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • 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 <KDE/KGlobal>
00024 
00025 namespace KIMAP
00026 {
00027   class SessionLoggerPrivate
00028   {
00029   public:
00030     SessionLogger instance;
00031   };
00032 }
00033 
00034 using namespace KIMAP;
00035 
00036 K_GLOBAL_STATIC(SessionLoggerPrivate, globalLogger)
00037 
00038 SessionLogger::SessionLogger()
00039   : m_file( qgetenv( "KIMAP_LOGFILE" ) )
00040 {
00041   m_file.open( QFile::WriteOnly );
00042 }
00043 
00044 SessionLogger::~SessionLogger()
00045 {
00046   m_file.close();
00047 }
00048 
00049 SessionLogger *SessionLogger::self()
00050 {
00051   return &globalLogger->instance;
00052 }
00053 
00054 void SessionLogger::dataSent( const QByteArray &data )
00055 {
00056   m_file.write( "C: "+data.trimmed()+'\n' );
00057   m_file.flush();
00058 }
00059 
00060 void SessionLogger::dataReceived( const QByteArray &data )
00061 {
00062   m_file.write( "S: "+data.trimmed()+'\n' );
00063   m_file.flush();
00064 }
00065 
00066 void SessionLogger::disconnectionOccured()
00067 {
00068   m_file.write( "X\n" );
00069 }
00070 
00071 
00072 

KIMAP Library

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

KDE-PIM Libraries

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