Use Qt's uuid implementation on Linux

This commit is contained in:
wmayer
2013-01-01 01:36:13 +01:00
parent 0ebffa930a
commit 408cc7c938
2 changed files with 20 additions and 11 deletions

View File

@@ -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;
}