Commit 408cc7c9 authored by wmayer's avatar wmayer
Browse files

Use Qt's uuid implementation on Linux

parent 0ebffa93
......@@ -97,25 +97,26 @@
#include <xercesc/sax2/SAX2XMLReader.hpp>
#include <xercesc/sax2/XMLReaderFactory.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/exception.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/exception.hpp>
#include <boost/regex.hpp>
// QtCore
#include <QBuffer>
#include <QByteArray>
// QtCore
#include <QBuffer>
#include <QByteArray>
#include <QCoreApplication>
#include <QEvent>
#include <QIODevice>
#include <QDataStream>
#include <QIODevice>
#include <QDataStream>
#include <QWriteLocker>
#include <QReadLocker>
#include <QReadWriteLock>
#include <QMutex>
#include <QMutexLocker>
#include <QUuid>
#endif //_PreComp_
#endif // BASE_PRECOMPILED_H
......
......@@ -26,6 +26,8 @@
#ifndef _PreComp_
# ifdef FC_OS_WIN32
# include <Rpc.h>
# else
# include <QUuid>
# endif
#endif
......@@ -63,7 +65,6 @@ Uuid::~Uuid()
//**************************************************************************
// Get the UUID
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
std::string Uuid::CreateUuid(void)
{
#ifdef FC_OS_WIN32
......@@ -82,6 +83,12 @@ std::string Uuid::CreateUuid(void)
/* convert it from rcp memory to our own */
//container = nssUTF8_Duplicate(uuidStr, NULL);
RpcStringFree(&uuidStr);
#elif 1
std::string Uuid;
QString uuid = QUuid::createUuid().toString();
uuid = uuid.mid(1);
uuid.chop(1);
Uuid = (const char*)uuid.toAscii();
#else
// use Python's implemententation
std::string Uuid;
......@@ -100,3 +107,4 @@ std::string Uuid::CreateUuid(void)
#endif
return Uuid;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment