summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/launcher.pro2
-rw-r--r--core/launcher/opie-taskbar.control2
-rw-r--r--core/launcher/transferserver.cpp41
3 files changed, 40 insertions, 5 deletions
diff --git a/core/launcher/launcher.pro b/core/launcher/launcher.pro
index bae5c51..5b32bc3 100644
--- a/core/launcher/launcher.pro
+++ b/core/launcher/launcher.pro
@@ -90,25 +90,25 @@ SOURCES = background.cpp \
../../rsync/util.c \
../../rsync/version.c \
../../rsync/whole.c \
../../rsync/qrsync.cpp
INTERFACES = syncdialog.ui
INCLUDEPATH += ../../include
DEPENDPATH += ../../include .
INCLUDEPATH += ../../core/apps/calibrate
DEPENDPATH += ../../core/apps/calibrate
INCLUDEPATH += ../../rsync
DEPENDPATH += ../../rsync
TARGET = qpe
-LIBS += -lqpe -lcrypt -lopie -luuid
+LIBS += -lqpe -lcrypt -lopie
TRANSLATIONS = ../../i18n/de/qpe.ts \
../../i18n/en/qpe.ts \
../../i18n/es/qpe.ts \
../../i18n/fr/qpe.ts \
../../i18n/hu/qpe.ts \
../../i18n/ja/qpe.ts \
../../i18n/ko/qpe.ts \
../../i18n/no/qpe.ts \
../../i18n/pl/qpe.ts \
../../i18n/pt/qpe.ts \
../../i18n/pt_BR/qpe.ts \
diff --git a/core/launcher/opie-taskbar.control b/core/launcher/opie-taskbar.control
index ce73d8b..e9338fb 100644
--- a/core/launcher/opie-taskbar.control
+++ b/core/launcher/opie-taskbar.control
@@ -1,9 +1,9 @@
Files: bin/qpe apps/Settings/Calibrate.desktop pics/launcher
Priority: required
Section: opie/system
Maintainer: Project Opie <opie@handhelds.org>
Architecture: arm
Version: $QPE_VERSION-$SUB_VERSION.1
-Depends: qt-embedded (>=$QTE_VERSION), libuuid1
+Depends: qt-embedded (>=$QTE_VERSION)
Description: Launcher for Opie
The "finder" or "explorer", or whatever you want to call it.
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp
index 9d18b7b..a20df2f 100644
--- a/core/launcher/transferserver.cpp
+++ b/core/launcher/transferserver.cpp
@@ -16,29 +16,33 @@
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#define _XOPEN_SOURCE
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
#include <shadow.h>
+#ifndef _OS_LINUX_
+
extern "C" {
#include <uuid/uuid.h>
#define UUID_H_INCLUDED
}
+#endif // not defined linux
+
#if defined(_OS_LINUX_)
#include <shadow.h>
#endif
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qdatastream.h>
#include <qmessagebox.h>
#include <qstringlist.h>
#include <qfileinfo.h>
#include <qregexp.h>
@@ -67,33 +71,64 @@ TransferServer::TransferServer( Q_UINT16 port, QObject *parent ,
}
TransferServer::~TransferServer()
{
}
void TransferServer::newConnection( int socket )
{
(void) new ServerPI( socket, this );
}
+/*
+ * small class in anonymous namespace
+ * to generate a QUUid for us
+ */
+namespace {
+ struct UidGen {
+ QString uuid();
+ };
+#if defined(_OS_LINUX_)
+ /*
+ * linux got a /proc/sys/kernel/random/uuid file
+ * it'll generate the uuids for us
+ */
+ QString UidGen::uuid() {
+ QFile file( "/proc/sys/kernel/random/uuid" );
+ if (!file.open(IO_ReadOnly ) )
+ return QString::null;
+
+ QTextStream stream(&file);
+
+ return "{" + stream.read().stripWhiteSpace() + "}";
+ }
+#else
+ QString UidGen::uuid() {
+ uuid_t uuid;
+ uuid_generate( uuid );
+ return QUUid( uuid ).toString();
+ }
+#endif
+}
+
QString SyncAuthentication::serverId()
{
Config cfg("Security");
cfg.setGroup("Sync");
QString r=cfg.readEntry("serverid");
if ( r.isEmpty() ) {
- uuid_t uuid;
- uuid_generate( uuid );
- cfg.writeEntry("serverid",(r = QUuid( uuid ).toString()));
+ UidGen gen;
+ r = gen.uuid();
+ cfg.writeEntry("serverid", r );
}
return r;
}
QString SyncAuthentication::ownerName()
{
QString vfilename = Global::applicationFileName("addressbook",
"businesscard.vcf");
if (QFile::exists(vfilename)) {
Contact c;
c = Contact::readVCard( vfilename )[0];
return c.fullName();