summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/oglobal.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opiecore/oglobal.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/oglobal.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiecore/oglobal.cpp b/libopie2/opiecore/oglobal.cpp
index 706ac6c..b7d59fc 100644
--- a/libopie2/opiecore/oglobal.cpp
+++ b/libopie2/opiecore/oglobal.cpp
@@ -299,97 +299,97 @@ QByteArray OGlobal::decodeBase64( const QByteArray& in) {
unsigned int sidx = 0, didx = 0;
if ( len > 1 )
{
while (didx < len-2)
{
out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003));
out[didx+1] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017));
out[didx+2] = (((out[sidx+2] << 6) & 255) | (out[sidx+3] & 077));
sidx += 4;
didx += 3;
}
}
if (didx < len)
out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003));
if (++didx < len )
out[didx] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017));
// Resize the output buffer
if ( len == 0 || len < out.size() )
out.resize(len);
return out;
}
bool OGlobal::isAppLnkFileName( const QString& str )
{
if (str.isEmpty()||str.at(str.length()-1)==QDir::separator()) return false;
return str.startsWith(MimeType::appsFolderName()+QDir::separator());
}
/* ToDo:
* This fun should check the document-path value for the mounted media
* which has to be implemented later. this moment we just check for a
* mounted media name.
*/
bool OGlobal::isDocumentFileName( const QString& file )
{
if (file.isEmpty()||file.at(file.length()-1)==QDir::separator()) return false;
if (file.startsWith(QPEApplication::documentDir()+QDir::separator())) return true;
StorageInfo si;
QList< FileSystem > fl = si.fileSystems();
FileSystem*fs;
for (fs = fl.first();fs!=0;fs=fl.next()) {
if (fs->isRemovable()&&file.startsWith(fs->name()+QDir::separator()))
return true;
}
- if (file.startsWith(homeDirPath())+"/Documents/") return true;
+ if (file.startsWith(homeDirPath()+"/Documents/")) return true;
return false;
}
QString OGlobal::tempDirPath()
{
static QString defstring="/tmp";
char * tmpp = 0;
if ( (tmpp=getenv("TEMP"))) {
return tmpp;
}
return defstring;
}
QString OGlobal::homeDirPath()
{
char * tmpp = getenv("HOME");
return (tmpp?tmpp:"/");
}
bool OGlobal::weekStartsOnMonday()
{
OConfig*conf=OGlobal::qpe_config();
if (!conf)return false;
conf->setGroup("Time");
return conf->readBoolEntry("MONDAY",true);
}
void OGlobal::setWeekStartsOnMonday( bool what)
{
OConfig*conf=OGlobal::qpe_config();
if (!conf)return;
conf->setGroup("Time");
return conf->writeEntry("MONDAY",what);
}
bool OGlobal::useAMPM()
{
OConfig*conf=OGlobal::qpe_config();
if (!conf)return false;
conf->setGroup("Time");
return conf->readBoolEntry("AMPM",false);
}
void OGlobal::setUseAMPM( bool what)
{
OConfig*conf=OGlobal::qpe_config();
if (!conf)return;
conf->setGroup("Time");