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) (unidiff)
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 @@
23#include <unistd.h> 23#include <unistd.h>
24#include <stdlib.h> 24#include <stdlib.h>
25#include <time.h> 25#include <time.h>
26
27#ifndef Q_OS_MACX
26#include <shadow.h> 28#include <shadow.h>
29#endif /* Q_OS_MACX */
27 30
28/* we need the _OS_LINUX stuff first ! */ 31/* we need the _OS_LINUX stuff first ! */
29#include <qglobal.h> 32#include <qglobal.h>
30 33
31#ifndef _OS_LINUX_ 34#ifndef _OS_LINUX_
35// Is anybody able to review this ? The include "uuid/uuid.h" couldn't be found
36// anywhere ? Therfore I removed it completely..
37// I think it should be made permanentyl !? (eilers)
38#warning "Where should uuid/uuid.h be found ? Removed this part .. (eilers)"
39#if 0
32 40
33extern "C" 41extern "C"
34{ 42{
@@ -36,10 +44,14 @@ extern "C"
36#define UUID_H_INCLUDED 44#define UUID_H_INCLUDED
37} 45}
38 46
47#endif
48
39#endif // not defined linux 49#endif // not defined linux
40 50
41#if defined(_OS_LINUX_) 51#if defined(_OS_LINUX_)
42#include <shadow.h> 52#include <shadow.h>
53#elif defined(Q_OS_MACX)
54#include <stdlib.h>
43#endif 55#endif
44 56
45#include <qdir.h> 57#include <qdir.h>
@@ -91,15 +103,15 @@ struct UidGen
91{ 103{
92 QString uuid(); 104 QString uuid();
93}; 105};
94#if !defined(_OS_LINUX_) 106#if defined(Q_OS_MACX)
95
96QString UidGen::uuid() 107QString UidGen::uuid()
97{ 108{
98 uuid_t uuid; 109 srandom( random() );
99 uuid_generate( uuid ); 110 QString numStr = QString::number( random() );
100 return QUUid( uuid ).toString(); 111
112 return "{" + numStr + "}";
101} 113}
102#else 114#elif defined(_OS_LINUX_)
103/* 115/*
104* linux got a /proc/sys/kernel/random/uuid file 116* linux got a /proc/sys/kernel/random/uuid file
105* it'll generate the uuids for us 117* it'll generate the uuids for us
@@ -114,6 +126,13 @@ QString UidGen::uuid()
114 126
115 return "{" + stream.read().stripWhiteSpace() + "}"; 127 return "{" + stream.read().stripWhiteSpace() + "}";
116} 128}
129#else
130QString UidGen::uuid()
131{
132 uuid_t uuid;
133 ::uuid_generate( uuid );
134 return QUUid( uuid ).toString();
135}
117#endif 136#endif
118} 137}
119 138