Page MenuHomePhorge

No OneTemporary

Authored By
Unknown
Size
8 KB
Referenced Files
None
Subscribers
None
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b68fea1..dde4eb7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,106 +1,99 @@
project (KolabUtilsFormat)
cmake_minimum_required(VERSION 2.6)
option( USE_LIBCALENDARING "Use libcalendaring" FALSE )
set(CMAKE_MODULE_PATH ${KolabUtilsFormat_SOURCE_DIR}/cmake/modules)
set(BIN_INSTALL_DIR bin CACHE STRING "Where to install binaries to")
set(LIB_INSTALL_DIR lib CACHE STRING "Where to install libraries to")
find_package(Qt4 4.6.0 REQUIRED)
find_package(Libkolab 0.3 REQUIRED)
find_package(Libkolabxml 0.7 REQUIRED) #We should probably add the Libkolabxml_INCLUDES to Libkolab_INCLUDES if we have libkolabxml headers in the installed libkolab headers
if (USE_LIBCALENDARING)
find_package(Libcalendaring)
set( KDE_INCLUDES ${Libcalendaring_INCLUDE_DIRS} )
set( KDE_LIBRARIES ${Libcalendaring_LIBRARIES} )
message("${Libcalendaring_INCLUDE_DIRS} ${Libcalendaring_LIBRARIES}")
else()
find_package(KDE4 4.8 REQUIRED)
find_package(KdepimLibs 4.9.50 REQUIRED)
set( KDE_INCLUDES ${KDEPIMLIBS_INCLUDE_DIRS} ${KDE4_INCLUDE_DIR})
set( KDE_LIBRARIES
${KDE4_KDECORE_LIBRARY}
${KDEPIMLIBS_KCALCORE_LIBS}
${KDEPIMLIBS_KABC_LIBS}
${KDEPIMLIBS_KMIME_LIBS}
${KDEPIMLIBS_KIMAP_LIBS}
)
endif()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -fexceptions -UQT_NO_EXCEPTIONS -g" )
include_directories(./ ${QT_INCLUDES} ${KDE_INCLUDES} ${Libkolab_INCLUDES} ${Libkolabxml_INCLUDES})
set(COMMON_DEPENDENCIES
${Libkolab_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTXML_LIBRARY}
${QT_GUI_LIBRARY}
${KDE_LIBRARIES}
)
add_subdirectory(jobs)
QT4_WRAP_CPP(JOB_MOC
${CMAKE_CURRENT_SOURCE_DIR}/jobs/findkolabfoldersjob.h
${CMAKE_CURRENT_SOURCE_DIR}/jobs/probekolabserverjob.h
${CMAKE_CURRENT_SOURCE_DIR}/jobs/sequentialcompositejob.h
${CMAKE_CURRENT_SOURCE_DIR}/jobs/messagemodifyjob.h
${CMAKE_CURRENT_SOURCE_DIR}/jobs/fetchmessagesjob.h
${CMAKE_CURRENT_SOURCE_DIR}/jobs/setupkolabfoldersjob.h
)
set( JOBS_SRCS ${JOBS_SRCS} ${JOB_MOC} )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(upgradetool)
add_subdirectory(fbdaemon)
########## Upgradetool
QT4_WRAP_CPP(SRC_MOC
upgradetool/imapupgradejob.h
upgradetool/kolabformatupgradejob.h
)
add_executable(kolab-formatupgrade ${UPGRADE_SRCS} ${SRC_MOC} ${JOBS_SRCS})
target_link_libraries(kolab-formatupgrade ${COMMON_DEPENDENCIES})
-#Tests
-include_directories(${QT_INCLUDES} ${QT_INCLUDE_DIR} QtCore)
-# set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-undefined" )
-QT4_AUTOMOC(upgradetool/upgradetooltests.cpp)
-add_executable(upgradetooltests upgradetool/upgradetooltests.cpp upgradetool/upgradeutilities.cpp ${CMAKE_CURRENT_BINARY_DIR}/${BINDINGSTEST_MOC})
-target_link_libraries(upgradetooltests ${QT_QTTEST_LIBRARY} ${COMMON_DEPENDENCIES})
-
install(TARGETS kolab-formatupgrade
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
)
########## Freebusy
QT4_WRAP_CPP(FB_MOC
fbdaemon/authenticationjob.h
fbdaemon/fbcoordinator.h
fbdaemon/fbgeneratorjob.h
fbdaemon/generatefbjob.h
fbdaemon/getuserlistjob.h
fbdaemon/kolabjob.h
fbdaemon/fbaggregatorjob.h
)
set( FBDAEMON_SRCS ${FBDAEMON_SRCS} ${FB_MOC} ${JOBS_SRCS} )
add_executable(kolab-freebusyd ${FBDAEMON_SRCS} ${JOB_SRCS})
target_link_libraries(kolab-freebusyd ${COMMON_DEPENDENCIES})
install(TARGETS kolab-freebusyd
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
)
\ No newline at end of file
diff --git a/upgradetool/upgradetooltests.cpp b/upgradetool/upgradetooltests.cpp
deleted file mode 100644
index 15242f1..0000000
--- a/upgradetool/upgradetooltests.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-#include "upgradetooltests.h"
-#include "upgradeutilities.h"
-#include <kolabformat.h>
-#include <kolabobject.h>
-#include <kdebug.h>
-#include <kmime/kmime_message.h>
-#include <kcalcore/icalformat.h>
-
-void showDiff(const QString &expected, const QString &converted)
-{
- if (expected.isEmpty() || converted.isEmpty()) {
- kDebug() << "files are emtpy";
- return;
- }
- if (expected == converted) {
- return;
- }
- QTemporaryFile realFile("realFile");
- QTemporaryFile convertedFile("expectedFile");
- if (realFile.open() && convertedFile.open()) {
- realFile.write(expected.toLatin1());
- convertedFile.write(converted.toLatin1());
- realFile.close();
- convertedFile.close();
- QProcess::execute("kompare", QStringList() << "-c" << realFile.fileName() << convertedFile.fileName());
- }
-
- // qDebug() << "EXPECTED: " << expected;
- // qDebug() << "CONVERTED: " << converted;
-}
-
-void UpgradeToolTests::testConvertEvent()
-{
- QFile file( "../testfiles/v2/event/complex.ics.mime" );
- file.open( QFile::ReadOnly );
- const QByteArray data = file.readAll();
- QVERIFY( !data.isEmpty() );
- kDebug() << Kolab::Upgrade::upgradeMime(data);
-}
-
-void UpgradeToolTests::testEventUpgrade()
-{
- QFile file( "../testfiles/v2/event/complex.ics.mime" );
- file.open( QFile::ReadOnly );
- const QByteArray data = file.readAll();
- QVERIFY( !data.isEmpty() );
-
- //load KCalCore V2
- KMime::Message::Ptr msg = KMime::Message::Ptr(new KMime::Message);
- msg->setContent( data );
- msg->parse();
- msg->content(KMime::ContentIndex());
-
- Kolab::KolabObjectReader reader;
-
- KMime::Message::Ptr message;
- reader.parseMimeMessage(msg);
- const KCalCore::Event::Ptr &v2result = reader.getEvent();
- QVERIFY(v2result);
-
- //write KCalCore V3
- message = Kolab::KolabObjectWriter::writeEvent(v2result);
-
- kDebug() << message;
-
- //load KCalCore V3
- Kolab::KolabObjectReader reader2;
- QCOMPARE(reader2.parseMimeMessage(message), Kolab::EventObject);
- const KCalCore::Event::Ptr &v3result = reader2.getEvent();
- QVERIFY(v3result);
-
-
- kDebug() <<"--------------------------------------------------------";
- KCalCore::ICalFormat format;
- if ( *(v2result.data()) != *(v3result.data()) ) {
- showDiff(format.toString( v2result.dynamicCast<KCalCore::Incidence>() ), format.toString( v3result.dynamicCast<KCalCore::Incidence>() ));
-// qDebug() << "V2: " << format.toString( v2result.dynamicCast<KCalCore::Incidence>() );
-// qDebug() << "V3: " << format.toString( v3result.dynamicCast<KCalCore::Incidence>() );
- }
- QVERIFY( *(v2result.data()) == *(v3result.data()) );
- kDebug() <<"--------------------------------------------------------";
- //Compare
- QCOMPARE(*v2result, *v3result);
-}
-
-void UpgradeToolTests::testConvertContact()
-{
- QFile file( "../testfiles/v2/contacts/complex.vcf.mime" );
- file.open( QFile::ReadOnly );
- const QByteArray data = file.readAll();
- QVERIFY( !data.isEmpty() );
-// kDebug() << Kolab::Upgrade::upgradeMime(data);
-}
-
-// void UpgradeToolTests::testContactUpgrade()
-// {
-// QFile file( "../testfiles/v2/event/complex.ics.mime" );
-// file.open( QFile::ReadOnly );
-// const QByteArray data = file.readAll();
-// QVERIFY( !data.isEmpty() );
-//
-// //load KCalCore V2
-// KMime::Message::Ptr msg = KMime::Message::Ptr(new KMime::Message);
-// msg->setContent( data );
-// msg->parse();
-// msg->content(KMime::ContentIndex());
-//
-// Kolab::KolabObjectReader reader;
-//
-// KMime::Message::Ptr message;
-// reader.parseMimeMessage(msg);
-// const KABC::Addressee &v2result = reader.getContact();
-//
-// //write KCalCore V3
-// message = Kolab::KolabObjectWriter::writeContact(v2result);
-//
-// //load KCalCore V3
-// Kolab::KolabObjectReader reader2;
-// reader2.parseMimeMessage(message);
-// const KABC::Addressee &v3result = reader2.getContact();
-//
-// //Compare
-// QCOMPARE(v2result, v3result);
-//
-// }
-
-
-
-QTEST_MAIN( UpgradeToolTests )
-
-#include "upgradetooltests.moc"
diff --git a/upgradetool/upgradetooltests.h b/upgradetool/upgradetooltests.h
deleted file mode 100644
index d2fb351..0000000
--- a/upgradetool/upgradetooltests.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef UPGRADETOOL_TEST_H
-#define UPGRADETOOL_TEST_H
-
-
-#include <QtCore/QObject>
-#include <QtTest/QtTest>
-
-
-class UpgradeToolTests : public QObject
-{
- Q_OBJECT
-private slots:
-
- void testConvertEvent();
- void testEventUpgrade();
- void testConvertContact();
-
-};
-
-#endif

File Metadata

Mime Type
text/x-diff
Expires
Sun, Apr 5, 11:04 PM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18831504
Default Alt Text
(8 KB)

Event Timeline