[Uml-devel] branches/KDE/3.5/kdesdk/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sat Nov 18 06:53:29 UTC 2006


SVN commit 605762 by okellogg:

avoid depending on libuuid, thanks Dirk

 D             configure.in.bot  
 M  +0 -8      configure.in.in  
 M  +14 -4     umbrello/uniqueid.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/configure.in.in #605761:605762
@@ -34,14 +34,6 @@
 dnl #endif
 dnl ])
 
-KDE_CHECK_HEADER(uuid/uuid.h,
-  [kde_have_libuuid=yes],
-  [kde_have_libuuid=])
-
-if test -z "$kde_have_libuuid"; then
-  DO_NOT_COMPILE="$DO_NOT_COMPILE umbrello"
-fi
-
 HAVE_XSLT=yes
 
 KDE_FIND_PATH(xml2-config, XML_CONFIG, [${prefix}/bin ${exec_prefix}/bin], [
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/uniqueid.cpp #605761:605762
@@ -13,7 +13,7 @@
 #include "uniqueid.h"
 
 // system includes
-#include <uuid/uuid.h>
+#include <kapplication.h>
 
 namespace UniqueID {
 
@@ -24,9 +24,19 @@
 
 Uml::IDType gen() {
     static char buf[40];
-    uuid_t uuid;
-    uuid_generate(uuid);
-    uuid_unparse_upper(uuid, buf);
+    int length = 30;
+    int i = 0;
+    // Source: KDE4 kdelibs/kdecore/krandom.cpp KRandom::randomString()
+    while (length--) {
+        int r = kapp->random() % 62;
+        r += 48;
+        if (r > 57)
+            r += 7;
+        if (r > 90)
+            r += 6;
+        buf[i++] = char(r);
+    }
+    buf[i] = '\0';
     m_uniqueID = std::string(buf);
     return m_uniqueID;
 }




More information about the umbrello-devel mailing list