summaryrefslogtreecommitdiffstats
path: root/src/tools/quuid.cpp
diff options
context:
space:
mode:
authorDarrell Anderson <[email protected]>2012-09-14 17:50:21 -0500
committerDarrell Anderson <[email protected]>2012-09-14 17:50:21 -0500
commit41e5b784ee48d2cb403bb551bcbe7cbd322c4336 (patch)
tree57002e3eb08d64f4c7986fa607cc99cda125b92f /src/tools/quuid.cpp
parentb9cfa4cf5ea09eb72e1650ccc4c7bbdec89838af (diff)
parent1faf4cf70f8ed79f83bb4e8c1ccbb2c52b1aec44 (diff)
downloadqt3-41e5b784ee48d2cb403bb551bcbe7cbd322c4336.tar.gz
qt3-41e5b784ee48d2cb403bb551bcbe7cbd322c4336.zip
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/qt3
Diffstat (limited to 'src/tools/quuid.cpp')
-rw-r--r--src/tools/quuid.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tools/quuid.cpp b/src/tools/quuid.cpp
index ee663d7..c745613 100644
--- a/src/tools/quuid.cpp
+++ b/src/tools/quuid.cpp
@@ -389,6 +389,18 @@ QUuid QUuid::createUuid()
return result;
}
#else // !Q_OS_WIN32
+#if defined(Q_OS_LINUX)
+#include <uuid/uuid.h>
+QUuid QUuid::createUuid()
+{
+ uuid_t raw_uuid;
+ char uuid_string[37];
+
+ uuid_generate(raw_uuid);
+ uuid_unparse(raw_uuid, uuid_string);
+ return QUuid(uuid_string);
+}
+#else // !Q_OS_LINUX
#include "qdatetime.h"
#include "stdlib.h" // For srand/rand
QUuid QUuid::createUuid()
@@ -417,5 +429,6 @@ QUuid QUuid::createUuid()
return result;
}
+#endif // !Q_OS_LINUX
#endif // !Q_OS_WIN32