summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2014-08-21 14:27:13 (GMT)
committerChristian Mollekopf <chrigi_1@fastmail.fm>2014-08-21 14:29:24 (GMT)
commitdf8746790080a39099bce4330bc117b593d042a2 (patch)
tree8bcdb04f35541d33ea66b6d2212fcd0a6225668b
parent20558620dad9f490ad7db91dbece6fa6899f660c (diff)
downloadlibcalendaring-df8746790080a39099bce4330bc117b593d042a2.tar.gz
Removed dependency on non-qt uuid libraries and use QUuid instead.
-rw-r--r--kcalcore/CMakeLists.txt5
-rw-r--r--kcalcore/ConfigureChecks.cmake7
-rw-r--r--kcalcore/calformat.cpp26
-rw-r--r--kcalcore/config-kcalcore.h.cmake3
-rw-r--r--kcalcore/icaltimezones.cpp17
5 files changed, 4 insertions, 54 deletions
diff --git a/kcalcore/CMakeLists.txt b/kcalcore/CMakeLists.txt
index f127f93..2563fd3 100644
--- a/kcalcore/CMakeLists.txt
+++ b/kcalcore/CMakeLists.txt
@@ -60,7 +60,6 @@ include_directories( ../kdecore )
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5810)
-include(ConfigureChecks.cmake)
configure_file(config-kcalcore.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kcalcore.h)
if(KDE4_BUILD_TESTS)
@@ -126,10 +125,6 @@ add_library(calendaring-kcalcore ${LIBRARY_TYPE} ${kcalcore_LIB_SRCS})
#${KDE4_KDECORE_LIBRARY}
target_link_libraries(calendaring-kcalcore calendaring-kdecore ${QT_QTGUI_LIBRARY} ${LIBICAL_LIBRARIES})
-if(HAVE_UUID_LIBRARY)
- target_link_libraries(calendaring-kcalcore uuid)
-endif()
-
# set(libcalendaring-kcalcore ${libcalendaring-kcalcore} PARENT_SCOPE)
# message("${libcalendaring-kcalcore}")
set_target_properties(calendaring-kcalcore PROPERTIES
diff --git a/kcalcore/ConfigureChecks.cmake b/kcalcore/ConfigureChecks.cmake
deleted file mode 100644
index 537e7cc..0000000
--- a/kcalcore/ConfigureChecks.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-include(CheckIncludeFiles)
-include(CheckLibraryExists)
-
-check_include_files(uuid/uuid.h HAVE_UUID_UUID_H)
-check_library_exists(uuid uuid_generate_random "" HAVE_UUID_LIBRARY)
-
-
diff --git a/kcalcore/calformat.cpp b/kcalcore/calformat.cpp
index c9d2015..1db941d 100644
--- a/kcalcore/calformat.cpp
+++ b/kcalcore/calformat.cpp
@@ -32,13 +32,7 @@
#include <config-kcalcore.h>
#include "calformat.h"
#include "exceptions.h"
-
-#if defined(HAVE_UUID_UUID_H)
-#include <uuid/uuid.h>
-#else
-#include <krandom.h>
-#include <QtCore/QDateTime>
-#endif
+#include <QtCore/QUuid>
using namespace KCalCore;
@@ -120,23 +114,7 @@ void CalFormat::setLoadedProductId( const QString &id )
QString CalFormat::createUniqueId()
{
-#if defined(HAVE_UUID_UUID_H)
- uuid_t uuid;
- char suuid[64];
-
- uuid_generate_random( uuid );
- uuid_unparse( uuid, suuid );
- return QString( suuid );
-#else
- int hashTime = QTime::currentTime().hour() +
- QTime::currentTime().minute() + QTime::currentTime().second() +
- QTime::currentTime().msec();
- QString uidStr = QString( "%1-%2.%3" ).
- arg( Private::mApplication ).
- arg( KRandom::random() ).
- arg( hashTime );
- return uidStr;
-#endif
+ return QUuid::createUuid().toString().mid(1, 36);
}
void CalFormat::virtual_hook( int id, void *data )
diff --git a/kcalcore/config-kcalcore.h.cmake b/kcalcore/config-kcalcore.h.cmake
index 4a6f35c..ce6068d 100644
--- a/kcalcore/config-kcalcore.h.cmake
+++ b/kcalcore/config-kcalcore.h.cmake
@@ -1,5 +1,2 @@
-/* Define to 1 if you have the <uuid/uuid.h> header file. */
-#cmakedefine HAVE_UUID_UUID_H
-
/* Define to 1 if the libical version is equal or greater than 0.46 */
#cmakedefine USE_ICAL_0_46
diff --git a/kcalcore/icaltimezones.cpp b/kcalcore/icaltimezones.cpp
index 00974e6..fa7104d 100644
--- a/kcalcore/icaltimezones.cpp
+++ b/kcalcore/icaltimezones.cpp
@@ -33,16 +33,13 @@
#include <QtCore/QDateTime>
#include <QtCore/QFile>
#include <QtCore/QTextStream>
+#include <QtCore/QUuid>
extern "C" {
#include <ical.h>
#include <icaltimezone.h>
}
-#if defined(HAVE_UUID_UUID_H)
-#include <uuid/uuid.h>
-#endif
-
#if defined(Q_OS_WINCE)
#include <Winbase.h>
#endif
@@ -840,10 +837,8 @@ class ICalTimeZoneSourcePrivate
int &prevOffset, KTimeZone::Phase & );
static QByteArray icalTzidPrefix;
-#if defined(HAVE_UUID_UUID_H)
static void parseTransitions( const MSSystemTime &date, const KTimeZone::Phase &phase,
int prevOffset, QList<KTimeZone::Transition> &transitions );
-#endif
};
QByteArray ICalTimeZoneSourcePrivate::icalTzidPrefix;
@@ -1030,7 +1025,6 @@ ICalTimeZone ICalTimeZoneSource::parse( icalcomponent *vtimezone )
return ICalTimeZone( this, name, data );
}
-#if defined(HAVE_UUID_UUID_H)
ICalTimeZone ICalTimeZoneSource::parse( MSTimeZone *tz, ICalTimeZones &zones )
{
const ICalTimeZone zone = parse( tz );
@@ -1054,11 +1048,7 @@ ICalTimeZone ICalTimeZoneSource::parse( MSTimeZone *tz )
ICalTimeZoneData kdata;
// General properties.
- uuid_t uuid;
- char suuid[64];
- uuid_generate_random( uuid );
- uuid_unparse( uuid, suuid );
- QString name = QString( suuid );
+ QString name = QUuid::createUuid().toString().mid(1, 36);
// Create phases.
QList<KTimeZone::Phase> phases;
@@ -1092,7 +1082,6 @@ ICalTimeZone ICalTimeZoneSource::parse( MSTimeZone *tz )
return ICalTimeZone( this, name, idata );
}
-#endif // HAVE_UUID_UUID_H
ICalTimeZone ICalTimeZoneSource::parse( const QString &name, const QStringList &tzList,
ICalTimeZones &zones )
@@ -1154,7 +1143,6 @@ ICalTimeZone ICalTimeZoneSource::parse( const QString &name, const QStringList &
return ICalTimeZone( this, name, idata );
}
-#if defined(HAVE_UUID_UUID_H)
//@cond PRIVATE
void ICalTimeZoneSourcePrivate::parseTransitions( const MSSystemTime &date,
const KTimeZone::Phase &phase, int prevOffset,
@@ -1208,7 +1196,6 @@ void ICalTimeZoneSourcePrivate::parseTransitions( const MSSystemTime &date,
}
}
//@endcond
-#endif // HAVE_UUID_UUID_H
ICalTimeZone ICalTimeZoneSource::parse( icaltimezone *tz )
{