• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kalarm

alarmlistfiltermodel.cpp

Go to the documentation of this file.
00001 /*
00002  *  alarmlistfiltermodel.cpp  -  proxy model class for lists of alarms
00003  *  Program:  kalarm
00004  *  Copyright © 2007,2008 by David Jarvie <software@astrojar.org.uk>
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License along
00017  *  with this program; if not, write to the Free Software Foundation, Inc.,
00018  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #include "kalarm.h"   //krazy:exclude=includes (kalarm.h must be first)
00022 #include "alarmlistfiltermodel.h"
00023 
00024 #include "eventlistmodel.h"
00025 
00026 #include <kdebug.h>
00027 
00028 
00029 // AlarmListFilterModel provides sorting and filtering for the alarm list model.
00030 
00031 
00032 AlarmListFilterModel::AlarmListFilterModel(EventListModel* baseModel, QObject* parent)
00033     : EventListFilterModel(baseModel, parent),
00034       mStatusFilter(KCalEvent::EMPTY)
00035 {}
00036 
00037 void AlarmListFilterModel::setStatusFilter(KCalEvent::Status type)
00038 {
00039     if (type != mStatusFilter)
00040     {
00041         mStatusFilter = type;
00042         invalidateFilter();
00043     }
00044 }
00045 
00046 bool AlarmListFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex&) const
00047 {
00048     return sourceModel()->data(sourceModel()->index(sourceRow, 0), EventListModel::StatusRole).toInt() & mStatusFilter;
00049 }
00050 
00051 bool AlarmListFilterModel::filterAcceptsColumn(int sourceCol, const QModelIndex&) const
00052 {
00053     return (sourceCol != EventListModel::TemplateNameColumn);
00054 }
00055 
00056 QModelIndex AlarmListFilterModel::mapFromSource(const QModelIndex& sourceIndex) const
00057 {
00058     if (sourceIndex.column() == EventListModel::TemplateNameColumn)
00059         return QModelIndex();
00060     return EventListFilterModel::mapFromSource(sourceIndex);
00061 }

kalarm

Skip menu "kalarm"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal