summaryrefslogtreecommitdiff
path: root/core/qws
authoreilers <eilers>2003-11-03 16:52:18 (UTC)
committer eilers <eilers>2003-11-03 16:52:18 (UTC)
commitd34dc773591a2d467c68875a68a671d6a809f861 (patch) (side-by-side diff)
treeb57e5ae15c51e3d87ca95d57aedfd1ca3db57bfe /core/qws
parentce84f2d8bdd65c438821f0457cdad6bbbfa73380 (diff)
downloadopie-d34dc773591a2d467c68875a68a671d6a809f861.zip
opie-d34dc773591a2d467c68875a68a671d6a809f861.tar.gz
opie-d34dc773591a2d467c68875a68a671d6a809f861.tar.bz2
Porting Opie to MacOS-X.
The base system and all platform independent applications and platforms should work. Please see $OPIEDIR/development/macosx for details
Diffstat (limited to 'core/qws') (more/less context) (ignore whitespace changes)
-rw-r--r--core/qws/transferserver.cpp31
1 files changed, 25 insertions, 6 deletions
diff --git a/core/qws/transferserver.cpp b/core/qws/transferserver.cpp
index 0337a94..239c824 100644
--- a/core/qws/transferserver.cpp
+++ b/core/qws/transferserver.cpp
@@ -23,12 +23,20 @@
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
+
+#ifndef Q_OS_MACX
#include <shadow.h>
+#endif /* Q_OS_MACX */
/* we need the _OS_LINUX stuff first ! */
#include <qglobal.h>
#ifndef _OS_LINUX_
+// Is anybody able to review this ? The include "uuid/uuid.h" couldn't be found
+// anywhere ? Therfore I removed it completely..
+// I think it should be made permanentyl !? (eilers)
+#warning "Where should uuid/uuid.h be found ? Removed this part .. (eilers)"
+#if 0
extern "C"
{
@@ -36,10 +44,14 @@ extern "C"
#define UUID_H_INCLUDED
}
+#endif
+
#endif // not defined linux
#if defined(_OS_LINUX_)
#include <shadow.h>
+#elif defined(Q_OS_MACX)
+#include <stdlib.h>
#endif
#include <qdir.h>
@@ -91,15 +103,15 @@ struct UidGen
{
QString uuid();
};
-#if !defined(_OS_LINUX_)
-
+#if defined(Q_OS_MACX)
QString UidGen::uuid()
{
- uuid_t uuid;
- uuid_generate( uuid );
- return QUUid( uuid ).toString();
+ srandom( random() );
+ QString numStr = QString::number( random() );
+
+ return "{" + numStr + "}";
}
-#else
+#elif defined(_OS_LINUX_)
/*
* linux got a /proc/sys/kernel/random/uuid file
* it'll generate the uuids for us
@@ -114,6 +126,13 @@ QString UidGen::uuid()
return "{" + stream.read().stripWhiteSpace() + "}";
}
+#else
+QString UidGen::uuid()
+{
+ uuid_t uuid;
+ ::uuid_generate( uuid );
+ return QUUid( uuid ).toString();
+}
#endif
}