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

kioslave

  • sources
  • kde-4.14
  • kdepimlibs
  • kioslave
common.h
1 /* This file is part of the KDE project
2  Copyright (C) 2008 JarosÅ‚aw Staniek <staniek@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef _KIOSLAVE_COMMON_H
21 #define _KIOSLAVE_COMMON_H
22 
23 
24 #include <stdio.h>
25 #include <QFile>
26 #include <QDir>
27 #include <KStandardDirs>
28 
29 extern "C" {
30 #include <sasl/sasl.h>
31 }
32 
33 inline bool initSASL()
34 {
35 #ifdef Q_OS_WIN32 //krazy:exclude=cpp
36  QByteArray libInstallPath( QFile::encodeName( QDir::toNativeSeparators( KGlobal::dirs()->installPath( "lib" ) + QLatin1String( "sasl2" ) ) ) );
37  QByteArray configPath( QFile::encodeName( QDir::toNativeSeparators( KGlobal::dirs()->installPath( "config" ) + QLatin1String( "sasl2" ) ) ) );
38  if ( sasl_set_path( SASL_PATH_TYPE_PLUGIN, libInstallPath.data() ) != SASL_OK ||
39  sasl_set_path( SASL_PATH_TYPE_CONFIG, configPath.data() ) != SASL_OK ) {
40  fprintf( stderr, "SASL path initialization failed!\n" );
41  return false;
42  }
43 #endif
44 
45  if ( sasl_client_init( NULL ) != SASL_OK ) {
46  fprintf( stderr, "SASL library initialization failed!\n" );
47  return false;
48  }
49  return true;
50 }
51 
52 #endif
QDir::toNativeSeparators
QString toNativeSeparators(const QString &pathName)
QByteArray
QLatin1String
QFile::encodeName
QByteArray encodeName(const QString &fileName)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kioslave

Skip menu "kioslave"
  • Main Page
  • File List

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

Search



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