summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2012-06-26 11:02:20 (GMT)
committerChristian Mollekopf <chrigi_1@fastmail.fm>2012-06-26 11:02:20 (GMT)
commit76178c821932ada88863877e9652056a84cb1018 (patch)
tree70c54204b73c7e282b6b27fc437e4bd5f712071a
parent3a2a3c681b88e331a4925e6edf8d8e5dbff05f6e (diff)
downloadlibcalendaring-76178c821932ada88863877e9652056a84cb1018.tar.gz
made kimap build
-rw-r--r--kimap/CMakeLists.txt72
-rw-r--r--kimap/cmake/CMakeLists.txt3
-rw-r--r--kimap/cmake/modules/CMakeLists.txt8
-rw-r--r--kimap/cmake/modules/CheckTimezone.cmake35
-rw-r--r--kimap/cmake/modules/FindGpgme.cmake412
-rw-r--r--kimap/cmake/modules/FindLdap.cmake46
-rw-r--r--kimap/cmake/modules/FindLibical.cmake95
-rw-r--r--kimap/cmake/modules/FindQGpgme.cmake46
-rw-r--r--kimap/cmake/modules/FindSasl2.cmake26
-rw-r--r--kimap/common.h54
-rw-r--r--kimap/expungejob.cpp2
-rw-r--r--kimap/fetchjob.cpp2
-rw-r--r--kimap/getacljob.cpp2
-rw-r--r--kimap/getmetadatajob.cpp4
-rw-r--r--kimap/idlejob.cpp2
-rw-r--r--kimap/job.cpp2
-rw-r--r--kimap/listjob.cpp2
-rw-r--r--kimap/loginjob.cpp18
-rw-r--r--kimap/rfccodecs.cpp12
-rw-r--r--kimap/searchjob.cpp8
-rw-r--r--kimap/session.cpp7
-rw-r--r--kimap/sessionthread.cpp6
-rw-r--r--kimap/setmetadatajob.cpp4
-rw-r--r--kimap/setquotajob.cpp2
-rw-r--r--kimap/tests/listjobtest.cpp4
-rw-r--r--kimap/tests/testimapidle.cpp32
-rw-r--r--kimap/tests/testimapserver.cpp166
27 files changed, 923 insertions, 149 deletions
diff --git a/kimap/CMakeLists.txt b/kimap/CMakeLists.txt
index ab3a5ca..d5ed81d 100644
--- a/kimap/CMakeLists.txt
+++ b/kimap/CMakeLists.txt
@@ -1,8 +1,55 @@
project(kimap)
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
+cmake_minimum_required(VERSION 2.6)
+
+# only available from cmake-2.8.0
+if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 7)
+ cmake_policy(SET CMP0012 NEW)
+endif()
+
+# only available from cmake-2.8.4
+if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 7 AND
+ ${CMAKE_PATCH_VERSION} GREATER 3)
+ cmake_policy(SET CMP0017 NEW)
+endif()
+
+# In CMake >= 2.8.6, FindBoost.cmake tries to find BoostConfig.cmake which is
+# not compatible with CMake's FindBoost. Disable this function.
+set(Boost_NO_BOOST_CMAKE TRUE)
+
+set(Boost_MINIMUM_VERSION 1.34.0)
+find_package(Boost ${Boost_MINIMUM_VERSION} COMPONENTS graph)
+# set_package_properties(Boost PROPERTIES
+# URL "http://www.boost.org"
+# DESCRIPTION "The Boost C++ Libraries (incl. the boost-graph library)"
+# TYPE REQUIRED
+# PURPOSE "Required by core components"
+# )
+
+find_package(Sasl2)
+# set_package_properties(Sasl2 PROPERTIES
+# URL "http://asg.web.cmu.edu/sasl/sasl-library.html"
+# DESCRIPTION "The Cyrus SASL API implentation"
+# TYPE REQUIRED
+# PURPOSE "Login authentication for IMAP and Sieve"
+# )
+find_package(Qt4 4.6.0 REQUIRED)
+
+include_directories(${QT_INCLUDES})
+
+include(GenerateExportHeader)
+
+
+include_directories( ../kdecore ../ ${CMAKE_CURRENT_BINARY_DIR})
+
+
+
+
+###########################################################
add_definitions( -DKDE_DEFAULT_DEBUG_AREA=5327 )
-add_subdirectory( tests )
+# add_subdirectory( tests )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
@@ -49,19 +96,22 @@ set(kimap_LIB_SRCS
getmetadatajob.cpp
)
-kde4_add_library(kimap ${LIBRARY_TYPE} ${kimap_LIB_SRCS})
+# QT4_AUTOMOC(${kimap_LIB_SRCS})
+QT4_WRAP_CPP(MOC ${kimap_LIB_SRCS})
+
+add_library(calendaring-kimap ${LIBRARY_TYPE} ${kimap_LIB_SRCS} ${MOC})
-target_link_libraries(kimap ${KDE4_KDECORE_LIBS} ${QT_QTNETWORK_LIBRARY} kmime ${SASL2_LIBRARIES})
+target_link_libraries(calendaring-kimap kdecore ${QT_QTNETWORK_LIBRARY} calendaring-kmime ${SASL2_LIBRARIES})
-include_directories( ${CMAKE_SOURCE_DIR}/kioslave ${SASL2_INCLUDE_DIR} ${Boost_INCLUDE_DIR} )
+include_directories( ${SASL2_INCLUDE_DIR} ${Boost_INCLUDE_DIR} )
-set_target_properties(kimap PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
-install(TARGETS kimap EXPORT kdepimlibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
+set_target_properties(calendaring-kimap PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
+# install(TARGETS kimap EXPORT kdepimlibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
-install( FILES kimap_export.h acl.h imapset.h job.h appendjob.h capabilitiesjob.h fetchjob.h idlejob.h listjob.h loginjob.h logoutjob.h namespacejob.h rfccodecs.h
- selectjob.h closejob.h expungejob.h deletejob.h createjob.h subscribejob.h unsubscribejob.h renamejob.h
- session.h sessionuiproxy.h storejob.h copyjob.h searchjob.h acljobbase.h setacljob.h getacljob.h deleteacljob.h
- myrightsjob.h listrightsjob.h quotajobbase.h setquotajob.h getquotajob.h getquotarootjob.h metadatajobbase.h setmetadatajob.h getmetadatajob.h
- DESTINATION ${INCLUDE_INSTALL_DIR}/kimap COMPONENT Devel)
+# install( FILES kimap_export.h acl.h imapset.h job.h appendjob.h capabilitiesjob.h fetchjob.h idlejob.h listjob.h loginjob.h logoutjob.h namespacejob.h rfccodecs.h
+# selectjob.h closejob.h expungejob.h deletejob.h createjob.h subscribejob.h unsubscribejob.h renamejob.h
+# session.h sessionuiproxy.h storejob.h copyjob.h searchjob.h acljobbase.h setacljob.h getacljob.h deleteacljob.h
+# myrightsjob.h listrightsjob.h quotajobbase.h setquotajob.h getquotajob.h getquotarootjob.h metadatajobbase.h setmetadatajob.h getmetadatajob.h
+# DESTINATION ${INCLUDE_INSTALL_DIR}/kimap COMPONENT Devel)
diff --git a/kimap/cmake/CMakeLists.txt b/kimap/cmake/CMakeLists.txt
new file mode 100644
index 0000000..38a9971
--- /dev/null
+++ b/kimap/cmake/CMakeLists.txt
@@ -0,0 +1,3 @@
+
+add_subdirectory(modules)
+
diff --git a/kimap/cmake/modules/CMakeLists.txt b/kimap/cmake/modules/CMakeLists.txt
new file mode 100644
index 0000000..e0152e6
--- /dev/null
+++ b/kimap/cmake/modules/CMakeLists.txt
@@ -0,0 +1,8 @@
+# install the cmake files
+
+file(GLOB cmakeFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.cmake")
+
+set(module_install_dir ${DATA_INSTALL_DIR}/cmake/modules )
+
+install( FILES ${cmakeFiles} DESTINATION ${module_install_dir} )
+
diff --git a/kimap/cmake/modules/CheckTimezone.cmake b/kimap/cmake/modules/CheckTimezone.cmake
new file mode 100644
index 0000000..88d3104
--- /dev/null
+++ b/kimap/cmake/modules/CheckTimezone.cmake
@@ -0,0 +1,35 @@
+# Discover the type of the timezone variable,
+# set HAVE_TIMEZONE if found for config.h
+
+INCLUDE (CheckCXXSourceCompiles)
+
+CHECK_CXX_SOURCE_COMPILES("
+#include <stdlib.h>
+#include <ctype.h>
+#include <time.h>
+#include <unistd.h>
+int main() { timezone = 1; return 0;}
+"
+ HAVE_TIMEZONE)
+
+IF (NOT HAVE_TIMEZONE)
+ # Then it's probably this variant, just to be sure
+ CHECK_CXX_SOURCE_COMPILES("
+#include <stdlib.h>
+#include <ctype.h>
+#include <time.h>
+#include <unistd.h>
+int main() { const char *p = timezone(0,0); return 0;}
+"
+ HAVE_BSD_TIMEZONE)
+endif()
+
+CHECK_CXX_SOURCE_COMPILES("
+#include <stdlib.h>
+#include <ctype.h>
+#include <time.h>
+#include <unistd.h>
+int main() { struct tm tm; tm.tm_gmtoff=1; return 0; }
+"
+ HAVE_TM_GMTOFF)
+
diff --git a/kimap/cmake/modules/FindGpgme.cmake b/kimap/cmake/modules/FindGpgme.cmake
new file mode 100644
index 0000000..872c045
--- /dev/null
+++ b/kimap/cmake/modules/FindGpgme.cmake
@@ -0,0 +1,412 @@
+# - Try to find the gpgme library
+#
+# Algorithm:
+# - Windows:
+# On Windows, there's three gpgme variants: gpgme{,-glib,-qt}.
+# - The variant used determines the event loop integration possible:
+# - gpgme: no event loop integration possible, only synchronous operations supported
+# - gpgme-glib: glib event loop integration possible, only asynchronous operations supported
+# - gpgme-qt: qt event loop integration possible, only asynchronous operations supported
+# - GPGME_{VANILLA,GLIB,QT}_{FOUND,LIBRARIES} will be set for each of the above
+# - GPGME_INCLUDES is the same for all of the above
+# - GPGME_FOUND is set if any of the above was found
+# - *nix:
+# There's also three variants: gpgme{,-pthread,-pth}.
+# - The variant used determines the multithreaded use possible:
+# - gpgme: no multithreading support available
+# - gpgme-pthread: multithreading available using POSIX threads
+# - gpgme-pth: multithreading available using GNU PTH (cooperative multithreading)
+# - GPGME_{VANILLA,PTH,PTHREAD}_{FOUND,LIBRARIES} will be set for each of the above
+# - GPGME_INCLUDES is the same for all of the above
+# - GPGME_FOUND is set if any of the above was found
+#
+# GPGME_LIBRARY_DIR - the directory where the libraries are located
+
+#
+# THIS IS ALMOST A 1:1 COPY OF FindAssuan.cmake in kdepim.
+# Any changes here likely apply there, too.
+#
+
+# do away with crappy condition repetition on else/endfoo
+set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS_gpgme_saved ${CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS} )
+set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
+
+#if this is built-in, please replace, if it isn't, export into a MacroToBool.cmake of it's own
+macro( macro_bool_to_bool FOUND_VAR )
+ foreach( _current_VAR ${ARGN} )
+ if ( ${FOUND_VAR} )
+ set( ${_current_VAR} TRUE )
+ else()
+ set( ${_current_VAR} FALSE )
+ endif()
+ endforeach()
+endmacro()
+
+#HACK: local copy...
+MACRO(MACRO_BOOL_TO_01 FOUND_VAR )
+ FOREACH (_current_VAR ${ARGN})
+ IF(${FOUND_VAR})
+ SET(${_current_VAR} 1)
+ ELSE(${FOUND_VAR})
+ SET(${_current_VAR} 0)
+ ENDIF(${FOUND_VAR})
+ ENDFOREACH(_current_VAR)
+ENDMACRO(MACRO_BOOL_TO_01)
+
+
+if ( WIN32 )
+
+ # On Windows, we don't have a gpgme-config script, so we need to
+ # look for the stuff ourselves:
+
+ # in cmake, AND and OR have the same precedence, there's no
+ # subexpressions, and expressions are evaluated short-circuit'ed
+ # IOW: CMake if() suxx.
+ # Starting with CMake 2.6.3 you can group if expressions with (), but we
+ # don't require 2.6.3 but 2.6.2, we can't use it. Alex
+ set( _seem_to_have_cached_gpgme false )
+ if ( GPGME_INCLUDES )
+ if ( GPGME_VANILLA_LIBRARIES OR GPGME_QT_LIBRARIES OR GPGME_GLIB_LIBRARIES )
+ set( _seem_to_have_cached_gpgme true )
+ endif()
+ endif()
+
+ if ( _seem_to_have_cached_gpgme )
+
+ macro_bool_to_bool( GPGME_VANILLA_LIBRARIES GPGME_VANILLA_FOUND )
+ macro_bool_to_bool( GPGME_GLIB_LIBRARIES GPGME_GLIB_FOUND )
+ macro_bool_to_bool( GPGME_QT_LIBRARIES GPGME_QT_FOUND )
+ # this would have been preferred:
+ #set( GPGME_*_FOUND macro_bool_to_bool(GPGME_*_LIBRARIES) )
+
+ if ( GPGME_VANILLA_FOUND OR GPGME_GLIB_FOUND OR GPGME_QT_FOUND )
+ set( GPGME_FOUND true )
+ else()
+ set( GPGME_FOUND false )
+ endif()
+
+ else()
+
+ # is this needed, of just unreflected cut'n'paste?
+ # this isn't a KDE library, after all!
+ if( NOT KDEWIN_FOUND )
+ find_package( KDEWIN REQUIRED )
+ endif()
+
+ set( GPGME_FOUND false )
+ set( GPGME_VANILLA_FOUND false )
+ set( GPGME_GLIB_FOUND false )
+ set( GPGME_QT_FOUND false )
+
+ find_path( GPGME_INCLUDES gpgme.h
+ ${CMAKE_INCLUDE_PATH}
+ ${CMAKE_INSTALL_PREFIX}/include
+ )
+
+ if (NOT WINCE)
+ find_library( _gpgme_vanilla_library NAMES gpgme libgpgme gpgme-11 libgpgme-11
+ PATHS
+ ${CMAKE_LIBRARY_PATH}
+ ${CMAKE_INSTALL_PREFIX}/lib
+ )
+ else (NOT WINCE)
+ find_library( _gpgme_vanilla_library NAMES libgpgme-11-msc
+ PATHS
+ ${CMAKE_LIBRARY_PATH}
+ ${CMAKE_INSTALL_PREFIX}/lib
+ )
+ endif()
+
+ find_library( _gpgme_glib_library NAMES gpgme-glib libgpgme-glib gpgme-glib-11 libgpgme-glib-11
+ PATHS
+ ${CMAKE_LIBRARY_PATH}
+ ${CMAKE_INSTALL_PREFIX}/lib
+ )
+
+ find_library( _gpgme_qt_library NAMES gpgme-qt libgpgme-qt gpgme-qt-11 libgpgme-qt-11
+ PATHS
+ ${CMAKE_LIBRARY_PATH}
+ ${CMAKE_INSTALL_PREFIX}/lib
+ )
+
+ if ( WINCE )
+ set( _gpg_error_library )
+ else()
+ find_library( _gpg_error_library NAMES gpg-error libgpg-error gpg-error-0 libgpg-error-0
+ PATHS
+ ${CMAKE_LIBRARY_PATH}
+ ${CMAKE_INSTALL_PREFIX}/lib
+ )
+ endif()
+
+ set( GPGME_INCLUDES ${GPGME_INCLUDES} )
+
+ if ( _gpgme_vanilla_library AND ( _gpg_error_library OR WINCE ) )
+ set( GPGME_VANILLA_LIBRARIES ${_gpgme_vanilla_library} ${_gpg_error_library} )
+ set( GPGME_VANILLA_FOUND true )
+ set( GPGME_FOUND true )
+ endif()
+
+ if ( _gpgme_glib_library AND ( _gpg_error_library OR WINCE ) )
+ set( GPGME_GLIB_LIBRARIES ${_gpgme_glib_library} ${_gpg_error_library} )
+ set( GPGME_GLIB_FOUND true )
+ set( GPGME_FOUND true )
+ endif()
+
+ if ( _gpgme_qt_library AND ( _gpg_error_library OR WINCE ) )
+ set( GPGME_QT_LIBRARIES ${_gpgme_qt_library} ${_gpg_error_library} )
+ set( GPGME_QT_FOUND true )
+ set( GPGME_FOUND true )
+ endif()
+
+ endif()
+
+ # these are Unix-only:
+ set( GPGME_PTHREAD_FOUND false )
+ set( GPGME_PTH_FOUND false )
+ set( HAVE_GPGME_PTHREAD 0 )
+ set( HAVE_GPGME_PTH 0 )
+
+ macro_bool_to_01( GPGME_FOUND HAVE_GPGME )
+ macro_bool_to_01( GPGME_VANILLA_FOUND HAVE_GPGME_VANILLA )
+ macro_bool_to_01( GPGME_GLIB_FOUND HAVE_GPGME_GLIB )
+ macro_bool_to_01( GPGME_QT_FOUND HAVE_GPGME_QT )
+
+else() # not WIN32
+
+ # On *nix, we have the gpgme-config script which can tell us all we
+ # need to know:
+
+ # see WIN32 case for an explanation of what this does:
+ set( _seem_to_have_cached_gpgme false )
+ if ( GPGME_INCLUDES )
+ if ( GPGME_VANILLA_LIBRARIES OR GPGME_PTHREAD_LIBRARIES OR GPGME_PTH_LIBRARIES )
+ set( _seem_to_have_cached_gpgme true )
+ endif()
+ endif()
+
+ if ( _seem_to_have_cached_gpgme )
+
+ macro_bool_to_bool( GPGME_VANILLA_LIBRARIES GPGME_VANILLA_FOUND )
+ macro_bool_to_bool( GPGME_PTHREAD_LIBRARIES GPGME_PTHREAD_FOUND )
+ macro_bool_to_bool( GPGME_PTH_LIBRARIES GPGME_PTH_FOUND )
+
+ if ( GPGME_VANILLA_FOUND OR GPGME_PTHREAD_FOUND OR GPGME_PTH_FOUND )
+ set( GPGME_FOUND true )
+ else()
+ set( GPGME_FOUND false )
+ endif()
+
+ else()
+
+ set( GPGME_FOUND false )
+ set( GPGME_VANILLA_FOUND false )
+ set( GPGME_PTHREAD_FOUND false )
+ set( GPGME_PTH_FOUND false )
+
+ find_program( _GPGMECONFIG_EXECUTABLE NAMES gpgme-config )
+
+ # if gpgme-config has been found
+ if ( _GPGMECONFIG_EXECUTABLE )
+
+ message( STATUS "Found gpgme-config at ${_GPGMECONFIG_EXECUTABLE}" )
+
+ exec_program( ${_GPGMECONFIG_EXECUTABLE} ARGS --version OUTPUT_VARIABLE GPGME_VERSION )
+
+ set( _GPGME_MIN_VERSION "1.1.7" )
+
+ if ( ${GPGME_VERSION} VERSION_LESS ${_GPGME_MIN_VERSION} )
+
+ message( STATUS "The installed version of gpgme is too old: ${GPGME_VERSION} (required: >= ${_GPGME_MIN_VERSION})" )
+
+ else()
+
+ message( STATUS "Found gpgme v${GPGME_VERSION}, checking for flavours..." )
+
+ exec_program( ${_GPGMECONFIG_EXECUTABLE} ARGS --libs OUTPUT_VARIABLE _gpgme_config_vanilla_libs RETURN_VALUE _ret )
+ if ( _ret )
+ set( _gpgme_config_vanilla_libs )
+ endif()
+
+ exec_program( ${_GPGMECONFIG_EXECUTABLE} ARGS --thread=pthread --libs OUTPUT_VARIABLE _gpgme_config_pthread_libs RETURN_VALUE _ret )
+ if ( _ret )
+ set( _gpgme_config_pthread_libs )
+ endif()
+
+ exec_program( ${_GPGMECONFIG_EXECUTABLE} ARGS --thread=pth --libs OUTPUT_VARIABLE _gpgme_config_pth_libs RETURN_VALUE _ret )
+ if ( _ret )
+ set( _gpgme_config_pth_libs )
+ endif()
+
+ # append -lgpg-error to the list of libraries, if necessary
+ foreach ( _flavour vanilla pthread pth )
+ if ( _gpgme_config_${_flavour}_libs AND NOT _gpgme_config_${_flavour}_libs MATCHES "lgpg-error" )
+ set( _gpgme_config_${_flavour}_libs "${_gpgme_config_${_flavour}_libs} -lgpg-error" )
+ endif()
+ endforeach()
+
+ if ( _gpgme_config_vanilla_libs OR _gpgme_config_pthread_libs OR _gpgme_config_pth_libs )
+
+ exec_program( ${_GPGMECONFIG_EXECUTABLE} ARGS --cflags OUTPUT_VARIABLE _GPGME_CFLAGS )
+
+ if ( _GPGME_CFLAGS )
+ string( REGEX REPLACE "(\r?\n)+$" " " _GPGME_CFLAGS "${_GPGME_CFLAGS}" )
+ string( REGEX REPLACE " *-I" ";" GPGME_INCLUDES "${_GPGME_CFLAGS}" )
+ endif()
+
+ foreach ( _flavour vanilla pthread pth )
+ if ( _gpgme_config_${_flavour}_libs )
+
+ set( _gpgme_library_dirs )
+ set( _gpgme_library_names )
+ string( TOUPPER "${_flavour}" _FLAVOUR )
+
+ string( REGEX REPLACE " +" ";" _gpgme_config_${_flavour}_libs "${_gpgme_config_${_flavour}_libs}" )
+
+ foreach( _flag ${_gpgme_config_${_flavour}_libs} )
+ if ( "${_flag}" MATCHES "^-L" )
+ string( REGEX REPLACE "^-L" "" _dir "${_flag}" )
+ file( TO_CMAKE_PATH "${_dir}" _dir )
+ set( _gpgme_library_dirs ${_gpgme_library_dirs} "${_dir}" )
+ elseif( "${_flag}" MATCHES "^-l" )
+ string( REGEX REPLACE "^-l" "" _name "${_flag}" )
+ set( _gpgme_library_names ${_gpgme_library_names} "${_name}" )
+ endif()
+ endforeach()
+
+ set( GPGME_${_FLAVOUR}_FOUND true )
+
+ foreach( _name ${_gpgme_library_names} )
+ set( _gpgme_${_name}_lib )
+
+ # if -L options were given, look only there
+ if ( _gpgme_library_dirs )
+ find_library( _gpgme_${_name}_lib NAMES ${_name} PATHS ${_gpgme_library_dirs} NO_DEFAULT_PATH )
+ endif()
+
+ # if not found there, look in system directories
+ if ( NOT _gpgme_${_name}_lib )
+ find_library( _gpgme_${_name}_lib NAMES ${_name} )
+ endif()
+
+ # if still not found, then the whole flavour isn't found
+ if ( NOT _gpgme_${_name}_lib )
+ if ( GPGME_${_FLAVOUR}_FOUND )
+ set( GPGME_${_FLAVOUR}_FOUND false )
+ set( _not_found_reason "dependant library ${_name} wasn't found" )
+ endif()
+ endif()
+
+ set( GPGME_${_FLAVOUR}_LIBRARIES ${GPGME_${_FLAVOUR}_LIBRARIES} "${_gpgme_${_name}_lib}" )
+ endforeach()
+
+ #check_c_library_exists_explicit( gpgme gpgme_check_version "${_GPGME_CFLAGS}" "${GPGME_LIBRARIES}" GPGME_FOUND )
+ if ( GPGME_${_FLAVOUR}_FOUND )
+ message( STATUS " Found flavour '${_flavour}', checking whether it's usable...yes" )
+ else()
+ message( STATUS " Found flavour '${_flavour}', checking whether it's usable...no" )
+ message( STATUS " (${_not_found_reason})" )
+ endif()
+ endif()
+
+ endforeach( _flavour )
+
+ # ensure that they are cached
+ # This comment above doesn't make sense, the four following lines seem to do nothing. Alex
+ set( GPGME_INCLUDES ${GPGME_INCLUDES} )
+ set( GPGME_VANILLA_LIBRARIES ${GPGME_VANILLA_LIBRARIES} )
+ set( GPGME_PTHREAD_LIBRARIES ${GPGME_PTHREAD_LIBRARIES} )
+ set( GPGME_PTH_LIBRARIES ${GPGME_PTH_LIBRARIES} )
+
+ if ( GPGME_VANILLA_FOUND OR GPGME_PTHREAD_FOUND OR GPGME_PTH_FOUND )
+ set( GPGME_FOUND true )
+ else()
+ set( GPGME_FOUND false )
+ endif()
+
+ endif()
+
+ endif()
+
+ endif()
+
+ endif()
+
+ # these are Windows-only:
+ set( GPGME_GLIB_FOUND false )
+ set( GPGME_QT_FOUND false )
+ set( HAVE_GPGME_GLIB 0 )
+ set( HAVE_GPGME_QT 0 )
+
+ macro_bool_to_01( GPGME_FOUND HAVE_GPGME )
+ macro_bool_to_01( GPGME_VANILLA_FOUND HAVE_GPGME_VANILLA )
+ macro_bool_to_01( GPGME_PTHREAD_FOUND HAVE_GPGME_PTHREAD )
+ macro_bool_to_01( GPGME_PTH_FOUND HAVE_GPGME_PTH )
+
+endif() # WIN32 | Unix
+
+
+set( _gpgme_flavours "" )
+
+if ( GPGME_VANILLA_FOUND )
+ set( _gpgme_flavours "${_gpgme_flavours} vanilla" )
+endif()
+
+if ( GPGME_GLIB_FOUND )
+ set( _gpgme_flavours "${_gpgme_flavours} Glib" )
+endif()
+
+if ( GPGME_QT_FOUND )
+ set( _gpgme_flavours "${_gpgme_flavours} Qt" )
+endif()
+
+if ( GPGME_PTHREAD_FOUND )
+ set( _gpgme_flavours "${_gpgme_flavours} pthread" )
+endif()
+
+if ( GPGME_PTH_FOUND )
+ set( _gpgme_flavours "${_gpgme_flavours} pth" )
+endif()
+
+# determine the library in one of the found flavours, can be reused e.g. by FindQgpgme.cmake, Alex
+foreach(_currentFlavour vanilla glib qt pth pthread)
+ if(NOT GPGME_LIBRARY_DIR)
+ get_filename_component(GPGME_LIBRARY_DIR "${_gpgme_${_currentFlavour}_lib}" PATH)
+ endif()
+endforeach()
+
+if ( NOT Gpgme_FIND_QUIETLY )
+
+ if ( GPGME_FOUND )
+ message( STATUS "Usable gpgme flavours found: ${_gpgme_flavours}" )
+ else()
+ message( STATUS "No usable gpgme flavours found." )
+ endif()
+
+ macro_bool_to_bool( Gpgme_FIND_REQUIRED _req )
+
+ if ( WIN32 )
+ set( _gpgme_homepage "http://www.gpg4win.org" )
+ else()
+ set( _gpgme_homepage "http://www.gnupg.org/related_software/gpgme" )
+ endif()
+
+ #macro_log_feature(
+ # GPGME_FOUND
+ # "gpgme"
+ # "GNU Privacy Guard (GPG/PGP) support"
+ # ${_gpgme_homepage}
+ # ${_req}
+ # "${_GPGME_MIN_VERSION} or greater"
+ # "Necessary to compile many PIM applications, including KMail"
+ #)
+
+else()
+
+ if ( Gpgme_FIND_REQUIRED AND NOT GPGME_FOUND )
+ message( FATAL_ERROR "Did not find GPGME" )
+ endif()
+
+endif()
+
+set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS_gpgme_saved )
diff --git a/kimap/cmake/modules/FindLdap.cmake b/kimap/cmake/modules/FindLdap.cmake
new file mode 100644
index 0000000..b5428e1
--- /dev/null
+++ b/kimap/cmake/modules/FindLdap.cmake
@@ -0,0 +1,46 @@
+# - Try to find the LDAP client libraries
+# Once done this will define
+#
+# LDAP_FOUND - system has libldap
+# LDAP_INCLUDE_DIR - the ldap include directory
+# LDAP_LIBRARIES - libldap + liblber (if found) library
+# LBER_LIBRARIES - liblber library
+
+if(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES)
+ # Already in cache, be silent
+ set(Ldap_FIND_QUIETLY TRUE)
+endif()
+
+
+FIND_PATH(LDAP_INCLUDE_DIR ldap.h)
+
+if(APPLE)
+ FIND_LIBRARY(LDAP_LIBRARIES NAMES LDAP
+ PATHS
+ /System/Library/Frameworks
+ /Library/Frameworks
+ )
+else(APPLE)
+ FIND_LIBRARY(LDAP_LIBRARIES NAMES ldap)
+
+ FIND_LIBRARY(LBER_LIBRARIES NAMES lber)
+endif()
+
+if(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES)
+ set(LDAP_FOUND TRUE)
+ if(LBER_LIBRARIES)
+ set(LDAP_LIBRARIES ${LDAP_LIBRARIES} ${LBER_LIBRARIES})
+ endif()
+endif()
+
+if(LDAP_FOUND)
+ if(NOT Ldap_FIND_QUIETLY)
+ message(STATUS "Found ldap: ${LDAP_LIBRARIES}")
+ endif()
+else(LDAP_FOUND)
+ if (Ldap_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find ldap")
+ endif()
+endif()
+
+MARK_AS_ADVANCED(LDAP_INCLUDE_DIR LDAP_LIBRARIES LBER_LIBRARIES)
diff --git a/kimap/cmake/modules/FindLibical.cmake b/kimap/cmake/modules/FindLibical.cmake
new file mode 100644
index 0000000..85074cb
--- /dev/null
+++ b/kimap/cmake/modules/FindLibical.cmake
@@ -0,0 +1,95 @@
+# Find Libical
+#
+# LIBICAL_FOUND - system has Libical with the minimum version needed
+# LIBICAL_INCLUDE_DIRS - the Libical include directories
+# LIBICAL_LIBRARIES - The libraries needed to use Libical
+# LIBICAL_VERSION = The value of ICAL_VERSION defined in ical.h
+# LIBICAL_MAJOR_VERSION = The library major version number
+# LIBICAL_MINOR_VERSION = The library minor version number
+
+# Copyright (c) 2008,2010 Allen Winter <winter@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if(NOT LIBICAL_MIN_VERSION)
+ set(LIBICAL_MIN_VERSION "0.33")
+endif()
+
+if (WIN32)
+ file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR)
+endif()
+
+set(LIBICAL_FIND_REQUIRED ${Libical_FIND_REQUIRED})
+if(LIBICAL_INCLUDE_DIRS AND LIBICAL_LIBRARIES)
+
+ # Already in cache, be silent
+ set(LIBICAL_FIND_QUIETLY TRUE)
+
+endif()
+
+#set the root from the LIBICAL_BASE environment
+file(TO_CMAKE_PATH "$ENV{LIBICAL_BASE}" libical_root )
+#override the root from LIBICAL_BASE defined to cmake
+if(DEFINED LIBICAL_BASE)
+ file(TO_CMAKE_PATH "${LIBICAL_BASE}" libical_root )
+endif()
+
+find_path(LIBICAL_INCLUDE_DIRS NAMES libical/ical.h
+ HINTS ${libical_root}/include ${_program_FILES_DIR}/libical/include ${KDE4_INCLUDE_DIR}
+)
+
+find_library(LIBICAL_LIBRARY NAMES ical libical
+ HINTS ${libical_root}/lib ${_program_FILES_DIR}/libical/lib ${KDE4_LIB_DIR}
+)
+find_library(LIBICALSS_LIBRARY NAMES icalss libicalss
+ HINTS ${libical_root}/lib ${_program_FILES_DIR}/libical/lib ${KDE4_LIB_DIR}
+)
+set(LIBICAL_LIBRARIES ${LIBICAL_LIBRARY} ${LIBICALSS_LIBRARY})
+
+if(LIBICAL_INCLUDE_DIRS AND LIBICAL_LIBRARIES)
+ set(FIND_LIBICAL_VERSION_SOURCE
+ "#include <libical/ical.h>\n int main()\n {\n printf(\"%s\",ICAL_VERSION);return 1;\n }\n")
+ set(FIND_LIBICAL_VERSION_SOURCE_FILE ${CMAKE_BINARY_DIR}/CMakeTmp/FindLIBICAL.cxx)
+ file(WRITE "${FIND_LIBICAL_VERSION_SOURCE_FILE}" "${FIND_LIBICAL_VERSION_SOURCE}")
+
+ set(FIND_LIBICAL_VERSION_ADD_INCLUDES
+ "-DINCLUDE_DIRECTORIES:STRING=${LIBICAL_INCLUDE_DIRS}")
+
+ if(NOT CMAKE_CROSSCOMPILING)
+ try_run(RUN_RESULT COMPILE_RESULT
+ ${CMAKE_BINARY_DIR}
+ ${FIND_LIBICAL_VERSION_SOURCE_FILE}
+ CMAKE_FLAGS "${FIND_LIBICAL_VERSION_ADD_INCLUDES}"
+ RUN_OUTPUT_VARIABLE LIBICAL_VERSION)
+ endif()
+
+ if(COMPILE_RESULT AND RUN_RESULT EQUAL 1 AND NOT CMAKE_CROSSCOMPILING)
+ message(STATUS "Found Libical version ${LIBICAL_VERSION}")
+ if(${LIBICAL_VERSION} VERSION_LESS ${LIBICAL_MIN_VERSION})
+ message(STATUS "Libcal version ${LIBICAL_VERSION} is too old. At least version ${LIBICAL_MIN_VERSION} is needed.")
+ set(LIBICAL_INCLUDE_DIRS "")
+ set(LIBICAL_LIBRARIES "")
+ endif()
+ if((LIBICAL_VERSION VERSION_EQUAL 0.46) OR (LIBICAL_VERSION VERSION_GREATER 0.46))
+ set(USE_ICAL_0_46 TRUE)
+ endif()
+ else(COMPILE_RESULT AND RUN_RESULT EQUAL 1 AND NOT CMAKE_CROSSCOMPILING)
+ if(NOT CMAKE_CROSSCOMPILING)
+ message(FATAL_ERROR "Unable to compile or run the libical version detection program.")
+ endif()
+ endif()
+
+ #compute the major and minor version numbers
+ if(NOT CMAKE_CROSSCOMPILING)
+ string(REGEX REPLACE "\\..*$" "" LIBICAL_MAJOR_VERSION ${LIBICAL_VERSION})
+ string(REGEX REPLACE "^.*\\." "" LIBICAL_MINOR_VERSION ${LIBICAL_VERSION})
+ endif()
+
+endif()
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBICAL DEFAULT_MSG LIBICAL_LIBRARIES LIBICAL_INCLUDE_DIRS)
+
+mark_as_advanced(LIBICAL_INCLUDE_DIRS LIBICAL_LIBRARIES)
+
diff --git a/kimap/cmake/modules/FindQGpgme.cmake b/kimap/cmake/modules/FindQGpgme.cmake
new file mode 100644
index 0000000..0355ebe
--- /dev/null
+++ b/kimap/cmake/modules/FindQGpgme.cmake
@@ -0,0 +1,46 @@
+# - Try to find the QGpgME library
+# Once done this will define
+#
+# QGPGME_FOUND
+# QGPGME_LIBRARIES
+# QGPGME_INCLUDE_DIR
+
+# What we do here is a bit simplictic, but it's no worse than what
+# people were using in kdepim up to now...
+
+find_package(Gpgme)
+
+if(GPGME_FOUND)
+
+ if ( WIN32 )
+ find_library(_QGPGME_EXTRA_LIBRARY gpgme++
+ HINTS ${GPGME_LIBRARY_DIR})
+ else ( WIN32 )
+ find_library(_QGPGME_EXTRA_LIBRARY gpgme++-pthread
+ HINTS ${GPGME_LIBRARY_DIR})
+ endif()
+
+ find_library(QGPGME_LIBRARY qgpgme
+ HINTS ${GPGME_LIBRARY_DIR})
+
+ if (QGPGME_LIBRARY)
+ # get the libdirectory and then go one up
+ get_filename_component(_QGPGME_PREFIX "${QGPGME_LIBRARY}" PATH)
+ get_filename_component(_QGPGME_PREFIX "${_QGPGME_PREFIX}" PATH)
+ find_path(QGPGME_INCLUDE_DIR qgpgme/qgpgme_export.h
+ HINTS "${_QGPGME_PREFIX}/include" )
+ endif()
+
+ if ( WIN32 )
+ set(QGPGME_LIBRARIES ${QGPGME_LIBRARY} ${_QGPGME_EXTRA_LIBRARY} ${GPGME_VANILLA_LIBRARIES} ${GPGME_QT_LIBRARIES})
+ else ( WIN32 )
+ set(QGPGME_LIBRARIES ${QGPGME_LIBRARY} ${_QGPGME_EXTRA_LIBRARY} ${GPGME_PTHREAD_LIBRARIES})
+ endif()
+
+endif()
+
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(QGpgme DEFAULT_MSG QGPGME_LIBRARY QGPGME_INCLUDE_DIR _QGPGME_EXTRA_LIBRARY)
+
+mark_as_advanced(QGPGME_LIBRARY _QGPGME_EXTRA_LIBRARY QGPGME_INCLUDE_DIR)
diff --git a/kimap/cmake/modules/FindSasl2.cmake b/kimap/cmake/modules/FindSasl2.cmake
new file mode 100644
index 0000000..9fe12ea
--- /dev/null
+++ b/kimap/cmake/modules/FindSasl2.cmake
@@ -0,0 +1,26 @@
+# - Try to find the sasl2 directory library
+# Once done this will define
+#
+# SASL2_FOUND - system has SASL2
+# SASL2_INCLUDE_DIR - the SASL2 include directory
+# SASL2_LIBRARIES - The libraries needed to use SASL2
+
+# Copyright (c) 2006, 2007 Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+find_path(SASL2_INCLUDE_DIR sasl/sasl.h
+)
+
+# libsasl2 add for windows, because the windows package of cyrus-sasl2
+# contains a libsasl2 also for msvc which is not standard conform
+find_library(SASL2_LIBRARIES NAMES sasl2 libsasl2
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Sasl2 DEFAULT_MSG SASL2_LIBRARIES SASL2_INCLUDE_DIR)
+
+mark_as_advanced(SASL2_INCLUDE_DIR SASL2_LIBRARIES)
+
diff --git a/kimap/common.h b/kimap/common.h
new file mode 100644
index 0000000..4adb605
--- /dev/null
+++ b/kimap/common.h
@@ -0,0 +1,54 @@
+/* This file is part of the KDE project
+ Copyright (C) 2008 Jarosław Staniek <staniek@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KIOSLAVE_COMMON_H
+#define _KIOSLAVE_COMMON_H
+
+
+#include <stdio.h>
+#include <QFile>
+#include <QDir>
+#include <kstandarddirs.h>
+
+extern "C" {
+#include <sasl/sasl.h>
+}
+
+inline bool initSASL()
+{
+#ifdef Q_OS_WIN32 //krazy:exclude=cpp
+ QByteArray libInstallPath( QFile::encodeName(QDir::toNativeSeparators(KGlobal::dirs()->installPath("lib")+QLatin1String("sasl2"))) );
+ QByteArray configPath( QFile::encodeName(QDir::toNativeSeparators(KGlobal::dirs()->installPath("config")+QLatin1String("sasl2"))) );
+ if ( sasl_set_path(SASL_PATH_TYPE_PLUGIN, libInstallPath.data()) != SASL_OK
+ || sasl_set_path(SASL_PATH_TYPE_CONFIG, configPath.data()) != SASL_OK )
+ {
+ fprintf(stderr, "SASL path initialization failed!\n");
+ return false;
+ }
+#endif
+
+ if ( sasl_client_init( NULL ) != SASL_OK ) {
+ fprintf(stderr, "SASL library initialization failed!\n");
+ return false;
+ }
+ return true;
+}
+
+
+#endif
diff --git a/kimap/expungejob.cpp b/kimap/expungejob.cpp
index af380bc..8f7a1b0 100644
--- a/kimap/expungejob.cpp
+++ b/kimap/expungejob.cpp
@@ -76,7 +76,7 @@ void ExpungeJob::handleResponse( const Message &response )
return;
}
}
- kDebug() << "Unhandled response: " << response.toString().constData();
+ qDebug() << "Unhandled response: " << response.toString().constData();
}
}
diff --git a/kimap/fetchjob.cpp b/kimap/fetchjob.cpp
index d513c59..044e4ad 100644
--- a/kimap/fetchjob.cpp
+++ b/kimap/fetchjob.cpp
@@ -528,4 +528,4 @@ void FetchJobPrivate::skipLeadingSpaces( const QByteArray &structure, int &pos )
while ( structure[pos]==' ' && pos<structure.size() ) pos++;
}
-#include "moc_fetchjob.cpp"
+// #include "moc_fetchjob.cpp"
diff --git a/kimap/getacljob.cpp b/kimap/getacljob.cpp
index 9f5d19a..9e51ddb 100644
--- a/kimap/getacljob.cpp
+++ b/kimap/getacljob.cpp
@@ -60,7 +60,7 @@ void GetAclJob::doStart()
void GetAclJob::handleResponse( const Message &response )
{
Q_D(GetAclJob);
-// kDebug() << response.toString();
+// qDebug() << response.toString();
if (handleErrorReplies(response) == NotHandled) {
if ( response.content.size() >= 4
diff --git a/kimap/getmetadatajob.cpp b/kimap/getmetadatajob.cpp
index 2507469..1e41361 100644
--- a/kimap/getmetadatajob.cpp
+++ b/kimap/getmetadatajob.cpp
@@ -112,13 +112,13 @@ void GetMetaDataJob::doStart()
}
d->tags << d->sessionInternal()->sendCommand( command, parameters );
-// kDebug() << "SENT: " << command << " " << parameters;
+// qDebug() << "SENT: " << command << " " << parameters;
}
void GetMetaDataJob::handleResponse( const Message &response )
{
Q_D(GetMetaDataJob);
-// kDebug() << "GOT: " << response.toString();
+// qDebug() << "GOT: " << response.toString();
//TODO: handle NO error messages having [METADATA MAXSIZE NNN], [METADATA TOOMANY], [METADATA NOPRIVATE] (see rfc5464)
// or [ANNOTATEMORE TOOBIG], [ANNOTATEMORE TOOMANY] respectively
diff --git a/kimap/idlejob.cpp b/kimap/idlejob.cpp
index 3fcb91e..720693f 100644
--- a/kimap/idlejob.cpp
+++ b/kimap/idlejob.cpp
@@ -157,4 +157,4 @@ int KIMAP::IdleJob::lastRecentCount() const
return d->lastRecentCount;
}
-#include "moc_idlejob.cpp"
+// #include "moc_idlejob.cpp"
diff --git a/kimap/job.cpp b/kimap/job.cpp
index 790ec0e..f195c52 100644
--- a/kimap/job.cpp
+++ b/kimap/job.cpp
@@ -71,7 +71,7 @@ void Job::connectionLost()
Job::HandlerResponse Job::handleErrorReplies(const Message &response)
{
Q_D(Job);
-// kDebug() << response.toString();
+// qDebug() << response.toString();
if ( !response.content.isEmpty()
&& d->tags.contains( response.content.first().toString() ) ) {
diff --git a/kimap/listjob.cpp b/kimap/listjob.cpp
index 2f805ff..178bfe7 100644
--- a/kimap/listjob.cpp
+++ b/kimap/listjob.cpp
@@ -217,4 +217,4 @@ void ListJob::convertInboxName(KIMAP::MailBoxDescriptor& descriptor)
descriptor.name += descriptor.separator + pathParts.join( descriptor.separator );
}
}
-#include "moc_listjob.cpp"
+// #include "moc_listjob.cpp"
diff --git a/kimap/loginjob.cpp b/kimap/loginjob.cpp
index af0d912..d2d11e3 100644
--- a/kimap/loginjob.cpp
+++ b/kimap/loginjob.cpp
@@ -92,7 +92,7 @@ using namespace KIMAP;
bool LoginJobPrivate::sasl_interact()
{
- kDebug() <<"sasl_interact";
+ qDebug() <<"sasl_interact";
sasl_interact_t *interact = client_interact;
//some mechanisms do not require username && pass, so it doesn't need a popup
@@ -107,16 +107,16 @@ bool LoginJobPrivate::sasl_interact()
interact = client_interact;
while( interact->id != SASL_CB_LIST_END ) {
- kDebug() <<"SASL_INTERACT id:" << interact->id;
+ qDebug() <<"SASL_INTERACT id:" << interact->id;
switch( interact->id ) {
case SASL_CB_USER:
case SASL_CB_AUTHNAME:
- kDebug() <<"SASL_CB_[USER|AUTHNAME]: '" << userName <<"'";
+ qDebug() <<"SASL_CB_[USER|AUTHNAME]: '" << userName <<"'";
interact->result = strdup( userName.toUtf8() );
interact->len = strlen( (const char *) interact->result );
break;
case SASL_CB_PASS:
- kDebug() <<"SASL_CB_PASS: [hidden]";
+ qDebug() <<"SASL_CB_PASS: [hidden]";
interact->result = strdup( password.toUtf8() );
interact->len = strlen( (const char *) interact->result );
break;
@@ -340,7 +340,7 @@ void LoginJob::handleResponse( const Message &response )
authModeSupported = true;
}
}
- kDebug() << "Capabilities after STARTTLS: " << d->capabilities;
+ qDebug() << "Capabilities after STARTTLS: " << d->capabilities;
if (!authModeSupported) {
setError( UserDefinedError );
setErrorText( i18n("Login failed, authentication mode %1 is not supported by the server.", d->authMode) );
@@ -366,7 +366,7 @@ bool LoginJobPrivate::startAuthentication()
int result = sasl_client_new( "imap", m_session->hostName().toLatin1(), 0, 0, callbacks, 0, &conn );
if ( result != SASL_OK ) {
- kDebug() <<"sasl_client_new failed with:" << result;
+ qDebug() <<"sasl_client_new failed with:" << result;
q->setError( LoginJob::UserDefinedError );
q->setErrorText( QString::fromUtf8( sasl_errdetail( conn ) ) );
return false;
@@ -385,7 +385,7 @@ bool LoginJobPrivate::startAuthentication()
} while ( result == SASL_INTERACT );
if ( result != SASL_CONTINUE && result != SASL_OK ) {
- kDebug() <<"sasl_client_start failed with:" << result;
+ qDebug() <<"sasl_client_start failed with:" << result;
q->setError( LoginJob::UserDefinedError );
q->setErrorText( QString::fromUtf8( sasl_errdetail( conn ) ) );
sasl_dispose( &conn );
@@ -426,7 +426,7 @@ bool LoginJobPrivate::answerChallenge(const QByteArray &data)
} while ( result == SASL_INTERACT );
if ( result != SASL_CONTINUE && result != SASL_OK ) {
- kDebug() <<"sasl_client_step failed with:" << result;
+ qDebug() <<"sasl_client_step failed with:" << result;
q->setError( LoginJob::UserDefinedError ); //TODO: check up the actual error
q->setErrorText( QString::fromUtf8( sasl_errdetail( conn ) ) );
sasl_dispose( &conn );
@@ -530,4 +530,4 @@ QString LoginJob::serverGreeting() const
return d->serverGreeting;
}
-#include "moc_loginjob.cpp"
+// #include "moc_loginjob.cpp"
diff --git a/kimap/rfccodecs.cpp b/kimap/rfccodecs.cpp
index ae0141a..f102514 100644
--- a/kimap/rfccodecs.cpp
+++ b/kimap/rfccodecs.cpp
@@ -376,7 +376,7 @@ const QString KIMAP::decodeRFC2047String( const QString &str,
}
pos += 3;
i += 3;
-// kDebug() << "Charset:" << charset << "- Language:" << language << "-'" << pos << "'";
+// qDebug() << "Charset:" << charset << "- Language:" << language << "-'" << pos << "'";
}
if ( valid ) {
mid = pos;
@@ -401,10 +401,10 @@ const QString KIMAP::decodeRFC2047String( const QString &str,
cstr[i] = ' ';
}
}
-// kDebug() << "before QP '"
+// qDebug() << "before QP '"
// << cstr << "'";
cstr = KCodecs::quotedPrintableDecode( cstr );
-// kDebug() << "after QP '"
+// qDebug() << "after QP '"
// << cstr << "'";
} else {
// decode base64 text
@@ -418,7 +418,7 @@ const QString KIMAP::decodeRFC2047String( const QString &str,
pos = end - 1;
} else {
-// kDebug() << "invalid";
+// qDebug() << "invalid";
//result += "=?";
//pos = beg -1; // because pos gets increased shortly afterwards
pos = beg - 2;
@@ -429,7 +429,7 @@ const QString KIMAP::decodeRFC2047String( const QString &str,
if ( !charset.isEmpty () ) {
QTextCodec *aCodec = codecForName( charset.toAscii () );
if ( aCodec ) {
-// kDebug() << "Codec is" << aCodec->name();
+// qDebug() << "Codec is" << aCodec->name();
return aCodec->toUnicode( result );
}
}
@@ -636,7 +636,7 @@ const QString KIMAP::decodeRFC2231String( const QString &str )
QString st = str.mid ( l + 1 );
QString language = str.mid ( p + 1, l - p - 1 );
- //kDebug() << "Charset:" << charset << "Language:" << language;
+ //qDebug() << "Charset:" << charset << "Language:" << language;
char ch, ch2;
p = 0;
diff --git a/kimap/searchjob.cpp b/kimap/searchjob.cpp
index 1e6e27f..7668222 100644
--- a/kimap/searchjob.cpp
+++ b/kimap/searchjob.cpp
@@ -209,7 +209,7 @@ void SearchJob::addSearchCriteria( SearchCriteria criteria )
break;
default:
//TODO Discuss if we keep error checking here, or accept anything, even if it is wrong
- kDebug() << "Criteria " << d->criteriaMap[criteria] << " needs an argument, but none was specified.";
+ qDebug() << "Criteria " << d->criteriaMap[criteria] << " needs an argument, but none was specified.";
break;
}
}
@@ -225,7 +225,7 @@ void SearchJob::addSearchCriteria( SearchCriteria criteria, int argument )
break;
default:
//TODO Discuss if we keep error checking here, or accept anything, even if it is wrong
- kDebug() << "Criteria " << d->criteriaMap[criteria] << " doesn't accept an integer as an argument.";
+ qDebug() << "Criteria " << d->criteriaMap[criteria] << " doesn't accept an integer as an argument.";
break;
}
}
@@ -253,7 +253,7 @@ void SearchJob::addSearchCriteria( SearchCriteria criteria, const QByteArray &ar
break;
default:
//TODO Discuss if we keep error checking here, or accept anything, even if it is wrong
- kDebug() << "Criteria " << d->criteriaMap[criteria] << " doesn't accept any argument.";
+ qDebug() << "Criteria " << d->criteriaMap[criteria] << " doesn't accept any argument.";
break;
}
}
@@ -275,7 +275,7 @@ void SearchJob::addSearchCriteria( SearchCriteria criteria, const QDate &argumen
}
default:
//TODO Discuss if we keep error checking here, or accept anything, even if it is wrong
- kDebug() << "Criteria " << d->criteriaMap[criteria] << " doesn't accept a date as argument.";
+ qDebug() << "Criteria " << d->criteriaMap[criteria] << " doesn't accept a date as argument.";
break;
}
}
diff --git a/kimap/session.cpp b/kimap/session.cpp
index de174d6..ddfb6ad 100644
--- a/kimap/session.cpp
+++ b/kimap/session.cpp
@@ -27,7 +27,6 @@
#include <QtCore/QDebug>
#include <QtCore/QTimer>
-#include <KDebug>
#include <KDE/KLocale>
#include "job.h"
@@ -484,7 +483,7 @@ void SessionPrivate::restartSocketTimer()
void SessionPrivate::onSocketTimeout()
{
- kDebug() << "Socket timeout!";
+ qDebug() << "Socket timeout!";
thread->closeSocket();
}
@@ -493,5 +492,5 @@ void Session::setTimeout( int timeout )
d->setSocketTimeout( timeout * 1000 );
}
-#include "moc_session.cpp"
-#include "moc_session_p.cpp"
+// #include "moc_session.cpp"
+// #include "moc_session_p.cpp"
diff --git a/kimap/sessionthread.cpp b/kimap/sessionthread.cpp
index 753fd07..b7e6aa5 100644
--- a/kimap/sessionthread.cpp
+++ b/kimap/sessionthread.cpp
@@ -198,7 +198,7 @@ void SessionThread::sslConnected()
if ( m_socket->sslErrors().count() > 0 || m_socket->encryptionMode() != KTcpSocket::SslClientMode
|| cipher.isNull() || cipher.usedBits() == 0) {
- kDebug() << "Initial SSL handshake failed. cipher.isNull() is" << cipher.isNull()
+ qDebug() << "Initial SSL handshake failed. cipher.isNull() is" << cipher.isNull()
<< ", cipher.usedBits() is" << cipher.usedBits()
<< ", the socket says:" << m_socket->errorString()
<< "and the list of SSL errors contains"
@@ -206,7 +206,7 @@ void SessionThread::sslConnected()
KSslErrorUiData errorData(m_socket);
emit sslError(errorData);
} else {
- kDebug() << "TLS negotiation done.";
+ qDebug() << "TLS negotiation done.";
m_encryptedMode = true;
emit encryptionNegotiationResult(true, m_socket->negotiatedSslVersion());
}
@@ -228,5 +228,5 @@ void SessionThread::sslErrorHandlerResponse(bool response)
}
}
-#include "moc_sessionthread_p.cpp"
+// #include "moc_sessionthread_p.cpp"
diff --git a/kimap/setmetadatajob.cpp b/kimap/setmetadatajob.cpp
index 7fa0ebb..a779403 100644
--- a/kimap/setmetadatajob.cpp
+++ b/kimap/setmetadatajob.cpp
@@ -86,7 +86,7 @@ void SetMetaDataJob::doStart()
}
d->tags << d->sessionInternal()->sendCommand( command, parameters );
-// kDebug() << "SENT: " << command << " " << parameters;
+// qDebug() << "SENT: " << command << " " << parameters;
}
void SetMetaDataJob::handleResponse( const Message &response )
@@ -128,7 +128,7 @@ void SetMetaDataJob::handleResponse( const Message &response )
} else {
content +=" {" + QByteArray::number(d->entriesIt.value().size()) + '}';
}
-// kDebug() << "SENT: " << content;
+// qDebug() << "SENT: " << content;
d->sessionInternal()->sendData( content );
}
}
diff --git a/kimap/setquotajob.cpp b/kimap/setquotajob.cpp
index 1e3b3f1..36af7b4 100644
--- a/kimap/setquotajob.cpp
+++ b/kimap/setquotajob.cpp
@@ -64,7 +64,7 @@ void SetQuotaJob::doStart()
s[s.length() - 1] = ')';
}
- kDebug() << "SETQUOTA " << '\"' + d->root + "\" " + s;
+ qDebug() << "SETQUOTA " << '\"' + d->root + "\" " + s;
//XXX: [alexmerry, 2010-07-24]: should d->root be quoted properly?
d->tags << d->sessionInternal()->sendCommand( "SETQUOTA", '\"' + d->root + "\" " + s);
}
diff --git a/kimap/tests/listjobtest.cpp b/kimap/tests/listjobtest.cpp
index 81fbfc4..9478e15 100644
--- a/kimap/tests/listjobtest.cpp
+++ b/kimap/tests/listjobtest.cpp
@@ -220,8 +220,8 @@ void testList()
mailBoxes+= spy.at( i ).at( 0 ).value< QList<KIMAP::MailBoxDescriptor> >();
}
- //kDebug() << mailBoxes.first().name;
- //kDebug() << listresult.first().name;
+ //qDebug() << mailBoxes.first().name;
+ //qDebug() << listresult.first().name;
QCOMPARE(mailBoxes, listresult);
}
// QCOMPARE(job->mailBox(), mailbox);
diff --git a/kimap/tests/testimapidle.cpp b/kimap/tests/testimapidle.cpp
index bdf8d69..2198ef3 100644
--- a/kimap/tests/testimapidle.cpp
+++ b/kimap/tests/testimapidle.cpp
@@ -63,7 +63,7 @@ int main( int argc, char **argv )
QString user = QString::fromLocal8Bit(argv[2]);
QString password = QString::fromLocal8Bit(argv[3]);
- kDebug() << "Listening:" << server << port << user << password;
+ qDebug() << "Listening:" << server << port << user << password;
qDebug();
QCoreApplication app(argc, argv);
@@ -71,7 +71,7 @@ int main( int argc, char **argv )
UiProxy *proxy = new UiProxy();
session.setUiProxy(UiProxy::Ptr( proxy ));
- kDebug() << "Logging in...";
+ qDebug() << "Logging in...";
LoginJob *login = new LoginJob(&session);
login->setUserName(user);
login->setPassword(password);
@@ -80,47 +80,47 @@ int main( int argc, char **argv )
Q_ASSERT(session.state()==Session::Authenticated);
qDebug();
- kDebug() << "Asking for capabilities:";
+ qDebug() << "Asking for capabilities:";
CapabilitiesJob *capabilities = new CapabilitiesJob(&session);
capabilities->exec();
Q_ASSERT_X(capabilities->error()==0, "CapabilitiesJob", capabilities->errorString().toLocal8Bit());
Q_ASSERT(session.state()==Session::Authenticated);
- kDebug() << capabilities->capabilities();
+ qDebug() << capabilities->capabilities();
qDebug();
Q_ASSERT(capabilities->capabilities().contains("IDLE"));
- kDebug() << "Selecting INBOX:";
+ qDebug() << "Selecting INBOX:";
SelectJob *select = new SelectJob(&session);
select->setMailBox("INBOX");
select->exec();
Q_ASSERT_X(select->error()==0, "SelectJob", select->errorString().toLocal8Bit());
Q_ASSERT(session.state()==Session::Selected);
- kDebug() << "Flags:" << select->flags();
- kDebug() << "Permanent flags:" << select->permanentFlags();
- kDebug() << "Total Number of Messages:" << select->messageCount();
- kDebug() << "Number of recent Messages:" << select->recentCount();
- kDebug() << "First Unseen Message Index:" << select->firstUnseenIndex();
- kDebug() << "UID validity:" << select->uidValidity();
- kDebug() << "Next UID:" << select->nextUid();
+ qDebug() << "Flags:" << select->flags();
+ qDebug() << "Permanent flags:" << select->permanentFlags();
+ qDebug() << "Total Number of Messages:" << select->messageCount();
+ qDebug() << "Number of recent Messages:" << select->recentCount();
+ qDebug() << "First Unseen Message Index:" << select->firstUnseenIndex();
+ qDebug() << "UID validity:" << select->uidValidity();
+ qDebug() << "Next UID:" << select->nextUid();
qDebug();
- kDebug() << "Start idling...";
+ qDebug() << "Start idling...";
IdleJob *idle = new IdleJob(&session);
QObject::connect(idle, SIGNAL(mailBoxStats(KIMAP::IdleJob*,QString,int,int)),
idle, SLOT(stop()));
idle->exec();
- kDebug() << "Idling done for" << idle->lastMailBox()
+ qDebug() << "Idling done for" << idle->lastMailBox()
<< "message count:" << idle->lastMessageCount()
<< "recent count:" << idle->lastRecentCount();
- kDebug() << "Closing INBOX:";
+ qDebug() << "Closing INBOX:";
CloseJob *close = new CloseJob(&session);
close->exec();
Q_ASSERT(session.state()==Session::Authenticated);
qDebug();
- kDebug() << "Logging out...";
+ qDebug() << "Logging out...";
LogoutJob *logout = new LogoutJob(&session);
logout->exec();
Q_ASSERT_X(logout->error()==0, "LogoutJob", logout->errorString().toLocal8Bit());
diff --git a/kimap/tests/testimapserver.cpp b/kimap/tests/testimapserver.cpp
index c22aee2..b919b26 100644
--- a/kimap/tests/testimapserver.cpp
+++ b/kimap/tests/testimapserver.cpp
@@ -66,12 +66,12 @@ class UiProxy: public SessionUiProxy {
void dumpContentHelper(KMime::Content *part, const QString &partId = QString())
{
if (partId.isEmpty()) {
- kDebug() << "** Message root **";
+ qDebug() << "** Message root **";
} else {
- kDebug() << "** Part" << partId << "**";
+ qDebug() << "** Part" << partId << "**";
}
- kDebug() << part->head();
+ qDebug() << part->head();
KMime::Content::List children = part->contents();
for (int i=0; i<children.size(); i++) {
@@ -94,7 +94,7 @@ void listFolders(Session *session, bool includeUnsubscribed = false, const QStri
for (int i=0; i<count; ++i) {
MailBoxDescriptor descriptor = list->mailBoxes()[i];
if (descriptor.name.endsWith(nameFilter)) {
- kDebug() << descriptor.separator << descriptor.name;
+ qDebug() << descriptor.separator << descriptor.name;
}
}
@@ -102,7 +102,7 @@ void listFolders(Session *session, bool includeUnsubscribed = false, const QStri
void testMetaData(Session *session)
{
- kDebug() << "TESTING: METADATA commands";
+ qDebug() << "TESTING: METADATA commands";
CreateJob *create = new CreateJob(session);
create->setMailBox("INBOX/TestFolder");
create->exec();
@@ -137,7 +137,7 @@ void testMetaData(Session *session)
void testAcl(Session *session, const QString &user)
{
- kDebug() << "TESTING: ACL commands";
+ qDebug() << "TESTING: ACL commands";
CreateJob *create = new CreateJob(session);
create->setMailBox("INBOX/TestFolder");
create->exec();
@@ -146,33 +146,33 @@ void testAcl(Session *session, const QString &user)
listRights->setMailBox("INBOX/TestFolder");
listRights->setIdentifier(user.toLatin1());
listRights->exec();
- kDebug() << "Default rights on INBOX/TestFolder: " << Acl::rightsToString(listRights->defaultRights());
+ qDebug() << "Default rights on INBOX/TestFolder: " << Acl::rightsToString(listRights->defaultRights());
QList<Acl::Rights> possible = listRights->possibleRights();
QStringList strList;
Q_FOREACH(Acl::Rights r, possible) {
strList << Acl::rightsToString(r);
}
- kDebug() << "Possible rights on INBOX/TestFolder: " << strList;
+ qDebug() << "Possible rights on INBOX/TestFolder: " << strList;
MyRightsJob *myRights = new MyRightsJob(session);
myRights->setMailBox("INBOX/TestFolder");
myRights->exec();
Acl::Rights mine = myRights->rights();
- kDebug() << "My rights on INBOX/TestFolder: " << Acl::rightsToString(mine);
- kDebug() << "Reading INBOX/TestFolder is possible: " << myRights->hasRightEnabled(Acl::Read);
+ qDebug() << "My rights on INBOX/TestFolder: " << Acl::rightsToString(mine);
+ qDebug() << "Reading INBOX/TestFolder is possible: " << myRights->hasRightEnabled(Acl::Read);
Q_ASSERT_X(myRights->hasRightEnabled(Acl::Read), "Reading INBOX is NOT possible", "");
GetAclJob *getAcl= new GetAclJob(session);
getAcl->setMailBox("INBOX/TestFolder");
getAcl->exec();
- kDebug() << "Anyone rights on INBOX/TestFolder: " << getAcl->rights("anyone");
+ qDebug() << "Anyone rights on INBOX/TestFolder: " << getAcl->rights("anyone");
Acl::Rights users = getAcl->rights(user.toLatin1());
- kDebug() << user << " rights on INBOX/TestFolder: " << Acl::rightsToString(users);
+ qDebug() << user << " rights on INBOX/TestFolder: " << Acl::rightsToString(users);
Q_ASSERT_X(mine == users, "GETACL returns different rights for the same user", "");
- kDebug() << "Removing Delete right ";
+ qDebug() << "Removing Delete right ";
mine = Acl::Delete;
SetAclJob *setAcl= new SetAclJob(session);
setAcl->setMailBox("INBOX/TestFolder");
@@ -184,9 +184,9 @@ void testAcl(Session *session, const QString &user)
getAcl->setMailBox("INBOX/TestFolder");
getAcl->exec();
users = getAcl->rights(user.toLatin1());
- kDebug() << user << " rights on INBOX/TestFolder: " << Acl::rightsToString(users);
+ qDebug() << user << " rights on INBOX/TestFolder: " << Acl::rightsToString(users);
- kDebug() << "Adding back Delete right ";
+ qDebug() << "Adding back Delete right ";
mine = Acl::Delete;
setAcl= new SetAclJob(session);
setAcl->setMailBox("INBOX/TestFolder");
@@ -198,7 +198,7 @@ void testAcl(Session *session, const QString &user)
getAcl->setMailBox("INBOX/TestFolder");
getAcl->exec();
users = getAcl->rights(user.toLatin1());
- kDebug() << user << " rights on INBOX/TestFolder: " << Acl::rightsToString(users);
+ qDebug() << user << " rights on INBOX/TestFolder: " << Acl::rightsToString(users);
//cleanup
DeleteJob *deletejob = new DeleteJob(session);
@@ -208,7 +208,7 @@ void testAcl(Session *session, const QString &user)
void testAppendAndStore(Session *session)
{
- kDebug() << "TESTING: APPEND and STORE";
+ qDebug() << "TESTING: APPEND and STORE";
//setup
CreateJob *create = new CreateJob(session);
create->setMailBox("INBOX/TestFolder");
@@ -225,14 +225,14 @@ void testAppendAndStore(Session *session)
"\r\n"
"Hello Joe, do you think we can meet at 3:30 tomorrow?\r\n";
- kDebug() << "Append a message in INBOX/TestFolder...";
+ qDebug() << "Append a message in INBOX/TestFolder...";
AppendJob *append = new AppendJob(session);
append->setMailBox("INBOX/TestFolder");
append->setContent(testMailContent);
append->exec();
Q_ASSERT_X(append->error()==0, "AppendJob", append->errorString().toLocal8Bit());
- kDebug() << "Read the message back and compare...";
+ qDebug() << "Read the message back and compare...";
SelectJob *select = new SelectJob(session);
select->setMailBox("INBOX/TestFolder");
select->exec();
@@ -257,9 +257,9 @@ void testAppendAndStore(Session *session)
fetch->setScope(scope);
fetch->exec();
MessageFlags expectedFlags = fetch->flags()[1];
- kDebug() << "Read the message flags:" << expectedFlags;
+ qDebug() << "Read the message flags:" << expectedFlags;
- kDebug() << "Add the \\Deleted flag...";
+ qDebug() << "Add the \\Deleted flag...";
expectedFlags << "\\Deleted";
qSort(expectedFlags);
StoreJob *store = new StoreJob(session);
@@ -272,7 +272,7 @@ void testAppendAndStore(Session *session)
QList<QByteArray> resultingFlags = store->resultingFlags()[1];
qSort(resultingFlags);
if (expectedFlags!=resultingFlags) {
- kDebug() << resultingFlags;
+ qDebug() << resultingFlags;
}
Q_ASSERT(expectedFlags==resultingFlags);
@@ -292,25 +292,25 @@ void testAppendAndStore(Session *session)
void testRename(Session *session)
{
- kDebug() << "TESTING: RENAME";
+ qDebug() << "TESTING: RENAME";
//setup
CreateJob *create = new CreateJob(session);
create->setMailBox("INBOX/TestFolder");
create->exec();
- kDebug() << "Listing mailboxes with name TestFolder:";
+ qDebug() << "Listing mailboxes with name TestFolder:";
listFolders(session, true, "TestFolder");
//actual tests
- kDebug() << "Renaming to RenamedTestFolder";
+ qDebug() << "Renaming to RenamedTestFolder";
RenameJob *rename = new RenameJob(session);
rename->setSourceMailBox("INBOX/TestFolder");
rename->setDestinationMailBox("INBOX/RenamedTestFolder");
rename->exec();
- kDebug() << "Listing mailboxes with name TestFolder:";
+ qDebug() << "Listing mailboxes with name TestFolder:";
listFolders(session, true, "TestFolder");
- kDebug() << "Listing mailboxes with name RenamedTestFolder:";
+ qDebug() << "Listing mailboxes with name RenamedTestFolder:";
listFolders(session, true, "RenamedTestFolder");
//cleanup
@@ -325,30 +325,30 @@ void testRename(Session *session)
void testSubscribe(Session *session)
{
- kDebug() << "TESTING: SUBSCRIBE/UNSUBSCRIBE";
+ qDebug() << "TESTING: SUBSCRIBE/UNSUBSCRIBE";
//setup
CreateJob *create = new CreateJob(session);
create->setMailBox("INBOX/TestFolder");
create->exec();
- kDebug() << "Listing subscribed mailboxes with name TestFolder:";
+ qDebug() << "Listing subscribed mailboxes with name TestFolder:";
listFolders(session, false, "TestFolder");
//actual tests
- kDebug() << "Subscribing to INBOX/TestFolder";
+ qDebug() << "Subscribing to INBOX/TestFolder";
SubscribeJob *subscribe = new SubscribeJob(session);
subscribe->setMailBox("INBOX/TestFolder");
subscribe->exec();
- kDebug() << "Listing subscribed mailboxes with name TestFolder:";
+ qDebug() << "Listing subscribed mailboxes with name TestFolder:";
listFolders(session, false, "TestFolder");
- kDebug() << "Unsubscribing from INBOX/TestFolder";
+ qDebug() << "Unsubscribing from INBOX/TestFolder";
UnsubscribeJob *unsubscribe = new UnsubscribeJob(session);
unsubscribe->setMailBox("INBOX/TestFolder");
unsubscribe->exec();
- kDebug() << "Listing subscribed mailboxes with name TestFolder:";
+ qDebug() << "Listing subscribed mailboxes with name TestFolder:";
listFolders(session, false, "TestFolder");
//cleanup
@@ -359,22 +359,22 @@ void testSubscribe(Session *session)
void testDelete(Session *session)
{
- kDebug() << "TESTING: DELETE";
- kDebug() << "Creating INBOX/TestFolder:";
+ qDebug() << "TESTING: DELETE";
+ qDebug() << "Creating INBOX/TestFolder:";
CreateJob *create = new CreateJob(session);
create->setMailBox("INBOX/TestFolder");
create->exec();
- kDebug() << "Listing with name TestFolder before DELETE:";
+ qDebug() << "Listing with name TestFolder before DELETE:";
listFolders(session, true, "TestFolder");
- kDebug() << "Deleting INBOX/TestFolder";
+ qDebug() << "Deleting INBOX/TestFolder";
DeleteJob *deletejob = new DeleteJob(session);
deletejob->setMailBox("INBOX/TestFolder");
deletejob->exec();
- kDebug() << "Listing with name TestFolder after DELETE:";
+ qDebug() << "Listing with name TestFolder after DELETE:";
listFolders(session, true, "TestFolder");
}
@@ -396,7 +396,7 @@ int main( int argc, char **argv )
QString user = QString::fromLocal8Bit(argv[2]);
QString password = QString::fromLocal8Bit(argv[3]);
- kDebug() << "Querying:" << server << port << user << password;
+ qDebug() << "Querying:" << server << port << user << password;
qDebug();
QCoreApplication app(argc, argv);
@@ -404,7 +404,7 @@ int main( int argc, char **argv )
UiProxy::Ptr proxy( new UiProxy() );
session.setUiProxy(proxy);
- kDebug() << "Logging in...";
+ qDebug() << "Logging in...";
LoginJob *login = new LoginJob(&session);
//login->setEncryptionMode(LoginJob::TlsV1);
//login->setAuthenticationMode(LoginJob::Plain);
@@ -415,7 +415,7 @@ int main( int argc, char **argv )
/*if (login->encryptionMode() == LoginJob::Unencrypted)
{
- kDebug() << "Encrypted login not possible, try to log in without encryption";
+ qDebug() << "Encrypted login not possible, try to log in without encryption";
login = new LoginJob(&session);
login->setUserName(user);
login->setPassword(password);
@@ -426,60 +426,60 @@ int main( int argc, char **argv )
}*/
- kDebug() << "Server greeting:" << session.serverGreeting();
+ qDebug() << "Server greeting:" << session.serverGreeting();
- kDebug() << "Asking for capabilities:";
+ qDebug() << "Asking for capabilities:";
CapabilitiesJob *capabilities = new CapabilitiesJob(&session);
capabilities->exec();
Q_ASSERT_X(capabilities->error()==0, "CapabilitiesJob", capabilities->errorString().toLocal8Bit());
Q_ASSERT(session.state()==Session::Authenticated);
- kDebug() << capabilities->capabilities();
+ qDebug() << capabilities->capabilities();
qDebug();
- kDebug() << "Asking for namespaces:";
+ qDebug() << "Asking for namespaces:";
NamespaceJob *namespaces = new NamespaceJob(&session);
namespaces->exec();
Q_ASSERT_X(namespaces->error()==0, "CapabilitiesJob", namespaces->errorString().toLocal8Bit());
Q_ASSERT(session.state()==Session::Authenticated);
- kDebug() << "Contains empty namespace:" << namespaces->containsEmptyNamespace();
+ qDebug() << "Contains empty namespace:" << namespaces->containsEmptyNamespace();
- kDebug() << "Personal:";
+ qDebug() << "Personal:";
foreach ( MailBoxDescriptor ns, namespaces->personalNamespaces() ) {
- kDebug() << ns.separator << ns.name;
+ qDebug() << ns.separator << ns.name;
}
- kDebug() << "User: ";
+ qDebug() << "User: ";
foreach ( MailBoxDescriptor ns, namespaces->userNamespaces() ) {
- kDebug() << ns.separator << ns.name;
+ qDebug() << ns.separator << ns.name;
}
- kDebug() << "Shared: ";
+ qDebug() << "Shared: ";
foreach ( MailBoxDescriptor ns, namespaces->sharedNamespaces() ) {
- kDebug() << ns.separator << ns.name;
+ qDebug() << ns.separator << ns.name;
}
qDebug();
- kDebug() << "Listing mailboxes:";
+ qDebug() << "Listing mailboxes:";
listFolders(&session);
Q_ASSERT(session.state()==Session::Authenticated);
- kDebug() << "Selecting INBOX:";
+ qDebug() << "Selecting INBOX:";
SelectJob *select = new SelectJob(&session);
select->setMailBox("INBOX");
select->exec();
Q_ASSERT_X(select->error()==0, "SelectJob", select->errorString().toLocal8Bit());
Q_ASSERT(session.state()==Session::Selected);
- kDebug() << "Flags:" << select->flags();
- kDebug() << "Permanent flags:" << select->permanentFlags();
- kDebug() << "Total Number of Messages:" << select->messageCount();
- kDebug() << "Number of recent Messages:" << select->recentCount();
- kDebug() << "First Unseen Message Index:" << select->firstUnseenIndex();
- kDebug() << "UID validity:" << select->uidValidity();
- kDebug() << "Next UID:" << select->nextUid();
+ qDebug() << "Flags:" << select->flags();
+ qDebug() << "Permanent flags:" << select->permanentFlags();
+ qDebug() << "Total Number of Messages:" << select->messageCount();
+ qDebug() << "Number of recent Messages:" << select->recentCount();
+ qDebug() << "First Unseen Message Index:" << select->firstUnseenIndex();
+ qDebug() << "UID validity:" << select->uidValidity();
+ qDebug() << "Next UID:" << select->nextUid();
qDebug();
- kDebug() << "Fetching first 3 messages headers:";
+ qDebug() << "Fetching first 3 messages headers:";
FetchJob *fetch = new FetchJob(&session);
FetchJob::FetchScope scope;
fetch->setSequenceSet(ImapSet(1, 3));
@@ -491,17 +491,17 @@ int main( int argc, char **argv )
Q_ASSERT(session.state()==Session::Selected);
QMap<qint64, MessagePtr> messages = fetch->messages();
foreach (qint64 id, messages.keys()) {
- kDebug() << "* Message" << id << "(" << fetch->sizes()[id] << "bytes )";
- kDebug() << " From :" << messages[id]->from()->asUnicodeString();
- kDebug() << " To :" << messages[id]->to()->asUnicodeString();
- kDebug() << " Date :" << messages[id]->date()->asUnicodeString();
- kDebug() << " Subject :" << messages[id]->subject()->asUnicodeString();
- kDebug() << " Message-ID:" << messages[id]->messageID()->asUnicodeString();
+ qDebug() << "* Message" << id << "(" << fetch->sizes()[id] << "bytes )";
+ qDebug() << " From :" << messages[id]->from()->asUnicodeString();
+ qDebug() << " To :" << messages[id]->to()->asUnicodeString();
+ qDebug() << " Date :" << messages[id]->date()->asUnicodeString();
+ qDebug() << " Subject :" << messages[id]->subject()->asUnicodeString();
+ qDebug() << " Message-ID:" << messages[id]->messageID()->asUnicodeString();
}
qDebug();
- kDebug() << "Fetching first 3 messages flags:";
+ qDebug() << "Fetching first 3 messages flags:";
fetch = new FetchJob(&session);
fetch->setSequenceSet(ImapSet(1, 3));
scope.parts.clear();
@@ -512,11 +512,11 @@ int main( int argc, char **argv )
Q_ASSERT(session.state()==Session::Selected);
QMap<qint64, MessageFlags> flags = fetch->flags();
foreach (qint64 id, flags.keys()) {
- kDebug() << "* Message" << id << "flags:" << flags[id];
+ qDebug() << "* Message" << id << "flags:" << flags[id];
}
qDebug();
- kDebug() << "Fetching first message structure:";
+ qDebug() << "Fetching first message structure:";
fetch = new FetchJob(&session);
fetch->setSequenceSet(ImapSet(1));
scope.parts.clear();
@@ -529,7 +529,7 @@ int main( int argc, char **argv )
dumpContentHelper(message.get());
qDebug();
- kDebug() << "Fetching first message second part headers:";
+ qDebug() << "Fetching first message second part headers:";
fetch = new FetchJob(&session);
fetch->setSequenceSet(ImapSet(1));
scope.parts.clear();
@@ -541,18 +541,18 @@ int main( int argc, char **argv )
Q_ASSERT(session.state()==Session::Selected);
QMap<qint64, MessageParts> allParts = fetch->parts();
foreach (qint64 id, allParts.keys()) {
- kDebug() << "* Message" << id << "parts headers";
+ qDebug() << "* Message" << id << "parts headers";
MessageParts parts = allParts[id];
foreach (const QByteArray &partId, parts.keys()) {
- kDebug() << " ** Part" << partId;
- kDebug() << " Name :" << parts[partId]->contentType()->name();
- kDebug() << " Mimetype :" << parts[partId]->contentType()->mimeType();
- kDebug() << " Description:" << parts[partId]->contentDescription()->asUnicodeString().simplified();
+ qDebug() << " ** Part" << partId;
+ qDebug() << " Name :" << parts[partId]->contentType()->name();
+ qDebug() << " Mimetype :" << parts[partId]->contentType()->mimeType();
+ qDebug() << " Description:" << parts[partId]->contentDescription()->asUnicodeString().simplified();
}
}
qDebug();
- kDebug() << "Fetching first message second part content:";
+ qDebug() << "Fetching first message second part content:";
fetch = new FetchJob(&session);
fetch->setSequenceSet(ImapSet(1));
scope.parts.clear();
@@ -566,8 +566,8 @@ int main( int argc, char **argv )
foreach (int id, allParts.keys()) {
MessageParts parts = allParts[id];
foreach (const QByteArray &partId, parts.keys()) {
- kDebug() << "* Message" << id << "part" << partId << "content:";
- kDebug() << parts[partId]->body();
+ qDebug() << "* Message" << id << "part" << partId << "content:";
+ qDebug() << parts[partId]->body();
}
}
qDebug();
@@ -584,17 +584,17 @@ int main( int argc, char **argv )
testMetaData(&session);
- kDebug() << "Expunge INBOX:";
+ qDebug() << "Expunge INBOX:";
ExpungeJob *expunge = new ExpungeJob(&session);
expunge->exec();
- kDebug() << "Closing INBOX:";
+ qDebug() << "Closing INBOX:";
CloseJob *close = new CloseJob(&session);
close->exec();
Q_ASSERT(session.state()==Session::Authenticated);
qDebug();
- kDebug() << "Logging out...";
+ qDebug() << "Logging out...";
LogoutJob *logout = new LogoutJob(&session);
logout->exec();
Q_ASSERT_X(logout->error()==0, "LogoutJob", logout->errorString().toLocal8Bit());