summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp41
1 files changed, 37 insertions, 4 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
index 929d004..0ebda98 100644
--- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
+++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
@@ -1,35 +1,65 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de)
+ =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
+ .=l.
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#include <qasciidict.h>
#include <qfile.h>
#include <qtopia/global.h>
#include <qtopia/stringutil.h>
#include <qtopia/timeconversion.h>
-#include "opimnotifymanager.h"
-#include "orecur.h"
-#include "otimezone.h"
-#include "odatebookaccessbackend_xml.h"
+#include <opie2/opimnotifymanager.h>
+#include <opie2/orecur.h>
+#include <opie2/otimezone.h>
+#include <opie2/odatebookaccessbackend_xml.h>
+
+using namespace Opie;
namespace {
// FROM TT again
char *strstrlen(const char *haystack, int hLen, const char* needle, int nLen)
{
char needleChar;
char haystackChar;
if (!needle || !haystack || !hLen || !nLen)
return 0;
const char* hsearch = haystack;
@@ -157,24 +187,25 @@ namespace {
save( it.data(), buf );
buf += " />\n";
str = buf.utf8();
total_written = file.writeBlock(str.data(), str.length() );
if ( total_written != int(str.length() ) )
return false;
}
return true;
}
}
+namespace Opie {
ODateBookAccessBackend_XML::ODateBookAccessBackend_XML( const QString& ,
const QString& fileName )
: ODateBookAccessBackend() {
m_name = fileName.isEmpty() ? Global::applicationFileName( "datebook", "datebook.xml" ) : fileName;
m_changed = false;
}
ODateBookAccessBackend_XML::~ODateBookAccessBackend_XML() {
}
bool ODateBookAccessBackend_XML::load() {
return loadFile();
}
bool ODateBookAccessBackend_XML::reload() {
@@ -601,12 +632,14 @@ QArray<int> ODateBookAccessBackend_XML::matchRegexp( const QRegExp &r ) const
for ( it = m_raw.begin(); it != m_raw.end(); ++it )
if ( it.data().match( r ) )
m_currentQuery[arraycounter++] = it.data().uid();
for ( it = m_rep.begin(); it != m_rep.end(); ++it )
if ( it.data().match( r ) )
m_currentQuery[arraycounter++] = it.data().uid();
// Shrink to fit..
m_currentQuery.resize(arraycounter);
return m_currentQuery;
}
+
+}