summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimnotifymanager.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimnotifymanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimnotifymanager.cpp37
1 files changed, 34 insertions, 3 deletions
diff --git a/libopie2/opiepim/core/opimnotifymanager.cpp b/libopie2/opiepim/core/opimnotifymanager.cpp
index d6f0ead..1771fad 100644
--- a/libopie2/opiepim/core/opimnotifymanager.cpp
+++ b/libopie2/opiepim/core/opimnotifymanager.cpp
@@ -1,18 +1,48 @@
1#include "opimnotifymanager.h" 1/*
2 2 This file is part of the Opie Project
3#include "oconversion.h" 3 Copyright (C) The Main Author <main-author@whereever.org>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l.
6 .>+-=
7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
16 : .. .:, . . . without even the implied warranty of
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.= = ; Library General Public License for more
20++= -. .` .: details.
21 : = ...= . :.=-
22 -. .:....=;==+<; You should have received a copy of the GNU
23 -_. . . )=. = Library General Public License along with
24 -- :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28*/
29#include <opie2/opimnotifymanager.h>
30
31#include <opie2/oconversion.h>
4 32
5#include <qstringlist.h> 33#include <qstringlist.h>
6 34
35namespace Opie {
36
7OPimNotifyManager::OPimNotifyManager( const Reminders& rem, const Alarms& al) 37OPimNotifyManager::OPimNotifyManager( const Reminders& rem, const Alarms& al)
8 : m_rem( rem ), m_al( al ) 38 : m_rem( rem ), m_al( al )
9{} 39{}
10OPimNotifyManager::~OPimNotifyManager() { 40OPimNotifyManager::~OPimNotifyManager() {
11} 41}
12/* use static_cast and type instead of dynamic... */ 42/* use static_cast and type instead of dynamic... */
13void OPimNotifyManager::add( const OPimNotify& noti) { 43void OPimNotifyManager::add( const OPimNotify& noti) {
14 if ( noti.type() == QString::fromLatin1("OPimReminder") ) { 44 if ( noti.type() == QString::fromLatin1("OPimReminder") ) {
15 const OPimReminder& rem = static_cast<const OPimReminder&>(noti); 45 const OPimReminder& rem = static_cast<const OPimReminder&>(noti);
16 m_rem.append( rem ); 46 m_rem.append( rem );
17 }else if ( noti.type() == QString::fromLatin1("OPimAlarm") ) { 47 }else if ( noti.type() == QString::fromLatin1("OPimAlarm") ) {
18 const OPimAlarm& al = static_cast<const OPimAlarm&>(noti); 48 const OPimAlarm& al = static_cast<const OPimAlarm&>(noti);
@@ -151,12 +181,13 @@ void OPimNotifyManager::alarmsFromString( const QString& str )
151} 181}
152 182
153void OPimNotifyManager::remindersFromString( const QString& str ) 183void OPimNotifyManager::remindersFromString( const QString& str )
154{ 184{
155 185
156 QStringList rems = QStringList::split(";", str ); 186 QStringList rems = QStringList::split(";", str );
157 for (QStringList::Iterator it = rems.begin(); it != rems.end(); ++it ) { 187 for (QStringList::Iterator it = rems.begin(); it != rems.end(); ++it ) {
158 OPimReminder rem( (*it).toInt() ); 188 OPimReminder rem( (*it).toInt() );
159 add( rem ); 189 add( rem );
160 } 190 }
161 191
162} 192}
193}