author | llornkcor <llornkcor> | 2002-02-14 02:13:19 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-02-14 02:13:19 (UTC) |
commit | 9c6a0c5da964dae08f3d9299fa5a47446f9977e2 (patch) (side-by-side diff) | |
tree | daa708f7da56a32bad5f7ecfd57191abb7ae6990 | |
parent | a3b4e55734b9a1d2b1f2f7278caa165138dd2aa2 (diff) | |
download | opie-9c6a0c5da964dae08f3d9299fa5a47446f9977e2.zip opie-9c6a0c5da964dae08f3d9299fa5a47446f9977e2.tar.gz opie-9c6a0c5da964dae08f3d9299fa5a47446f9977e2.tar.bz2 |
added runtime check for zaurus kernel
-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 32 | ||||
-rw-r--r-- | core/applets/vmemo/vmemo.h | 2 |
2 files changed, 21 insertions, 13 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 6f04c66..6bd1622 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp @@ -16,2 +16,3 @@ +#include <sys/utsname.h> #include <sys/time.h> @@ -138,2 +139,13 @@ VMemo::VMemo( QWidget *parent, const char *name ) recording = FALSE; + + struct utsname name; //check for embedix kernel running on the zaurus, if lineo change string, this break + if (uname(&name) != -1) { + QString release=name.release; + if(release.find("embedix",0,TRUE) !=-1) { + systemZaurus=TRUE; + printf("System release: %s\n", name.release); + } else + systemZaurus=FALSE; + } + } @@ -169,8 +181,7 @@ void VMemo::mousePressEvent( QMouseEvent * ) QDateTime dt = QDateTime::currentDateTime(); - -#if defined(QT_QWS_EBX) //if zaurus - QString fileName(vmCfg.readEntry("Dir", "/mnt/cf/")); // zaurus does not have /mnt/ramfs -#else - QString fileName(vmCfg.readEntry("Dir", "/mnt/ramfs/")); -#endif + QString fileName; + if(systemZaurus) + fileName=vmCfg.readEntry("Dir", "/mnt/cf/"); // zaurus does not have /mnt/ramfs + else + fileName=vmCfg.readEntry("Dir", "/mnt/ramfs/"); @@ -234,9 +245,6 @@ int VMemo::openDSP() -#if defined(QT_QWS_EBX) //if zaurus - //dsp = open("/dev/dsp1", O_RDONLY); //on the Zaurus this needs to be /dev/dsp1 !!!! - dsp = open("/dev/dsp1", O_RDWR); //on the Zaurus this needs to be /dev/dsp1 !!!! -#else - //dsp = open("/dev/dsp", O_RDONLY); + if(systemZaurus) + dsp = open("/dev/dsp1", O_RDWR); //Zaurus needs /dev/dsp1 + else dsp = open("/dev/dsp", O_RDWR); -#endif diff --git a/core/applets/vmemo/vmemo.h b/core/applets/vmemo/vmemo.h index 9ce08f2..ee375b0 100644 --- a/core/applets/vmemo/vmemo.h +++ b/core/applets/vmemo/vmemo.h @@ -43,3 +43,3 @@ private: QPixmap vmemoPixmap; - + bool systemZaurus; int dsp, wav, rate, speed, channels, format, resolution; |