X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=platform.cpp;h=4fc6deedc1c5359f0ef24657d304cb9c6e5eef76;hb=21d55858dc41a30ba77381fe62a7bef0d3e956f7;hp=f72a073dae061bc0e8d96fd5f62691d8db8203aa;hpb=986c5df2ad57bad44e8dd02286a2326406ace831;p=dorian diff --git a/platform.cpp b/platform.cpp index f72a073..4fc6dee 100644 --- a/platform.cpp +++ b/platform.cpp @@ -1,5 +1,6 @@ #include #include +#include #if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) # include @@ -25,12 +26,30 @@ static const char *DORIAN_VERSION = #include "pkg/version.txt" ; +#define DORIAN_LOG "dorian.txt" + #ifdef Q_WS_MAEMO_5 # include #else # include #endif +static Platform *theInstance; + +Platform *Platform::instance() +{ + if (!theInstance) { + theInstance = new Platform(); + } + return theInstance; +} + +void Platform::close() +{ + delete theInstance; + theInstance = 0; +} + QString Platform::dbPath() { QString base(QDir::home().absoluteFilePath(DORIAN_BASE)); @@ -100,3 +119,22 @@ void Platform::showBusy(QWidget *w, bool isBusy) Q_UNUSED(isBusy); #endif } + +QString Platform::traceFileName() +{ + return QDir::home().absoluteFilePath(DORIAN_LOG); +} + +int Platform::defaultZoom() +{ + return 150; +} + +QString Platform::defaultOrientation() +{ +#ifdef Q_OS_SYMBIAN + return QString("portrait"); +#else + return QString("landscape"); +#endif +}