summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/oglobal.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/oglobal.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/oglobal.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libopie2/opiecore/oglobal.cpp b/libopie2/opiecore/oglobal.cpp
index 1aa206e..ea02058 100644
--- a/libopie2/opiecore/oglobal.cpp
+++ b/libopie2/opiecore/oglobal.cpp
@@ -35,12 +35,14 @@
35#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
36#include <qpe/storage.h> 36#include <qpe/storage.h>
37 37
38#include <unistd.h> 38#include <unistd.h>
39#include <sys/types.h> 39#include <sys/types.h>
40 40
41using namespace Opie::Core;
42
41static const char Base64EncMap[64] = 43static const char Base64EncMap[64] =
42{ 44{
43 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 45 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
44 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 46 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
45 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 47 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
46 0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 48 0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
@@ -309,24 +311,24 @@ QByteArray OGlobal::decodeBase64( const QByteArray& in) {
309 311
310 return out; 312 return out;
311} 313}
312 314
313bool OGlobal::isAppLnkFileName( const QString& str ) 315bool OGlobal::isAppLnkFileName( const QString& str )
314{ 316{
315 if (str.length()==0||str.at(str.length()-1)==QDir::separator()) return false; 317 if (str.isEmpty()||str.at(str.length()-1)==QDir::separator()) return false;
316 return str.startsWith(MimeType::appsFolderName()+QDir::separator()); 318 return str.startsWith(MimeType::appsFolderName()+QDir::separator());
317} 319}
318 320
319/* ToDo: 321/* ToDo:
320 * This fun should check the document-path value for the mounted media 322 * This fun should check the document-path value for the mounted media
321 * which has to be implemented later. this moment we just check for a 323 * which has to be implemented later. this moment we just check for a
322 * mounted media name. 324 * mounted media name.
323 */ 325 */
324bool OGlobal::isDocumentFileName( const QString& file ) 326bool OGlobal::isDocumentFileName( const QString& file )
325{ 327{
326 if (file.length()==0||file.at(file.length()-1)==QDir::separator()) return false; 328 if (file.isEmpty()||file.at(file.length()-1)==QDir::separator()) return false;
327 if (file.startsWith(QPEApplication::documentDir()+QDir::separator())) return true; 329 if (file.startsWith(QPEApplication::documentDir()+QDir::separator())) return true;
328 StorageInfo si; 330 StorageInfo si;
329 QList< FileSystem > fl = si.fileSystems(); 331 QList< FileSystem > fl = si.fileSystems();
330 FileSystem*fs; 332 FileSystem*fs;
331 for (fs = fl.first();fs!=0;fs=fl.next()) { 333 for (fs = fl.first();fs!=0;fs=fl.next()) {
332 if (fs->isRemovable()&&file.startsWith(fs->name()+QDir::separator())) 334 if (fs->isRemovable()&&file.startsWith(fs->name()+QDir::separator()))