1
/****************************************************************************
2
* Copyright (C) 2009-2013 by Savoir-Faire Linux *
3
* Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> *
4
* Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
6
* This library is free software; you can redistribute it and/or *
7
* modify it under the terms of the GNU Lesser General Public *
8
* License as published by the Free Software Foundation; either *
9
* version 2.1 of the License, or (at your option) any later version. *
11
* This library is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14
* Lesser General Public License for more details. *
16
* You should have received a copy of the GNU General Public License *
17
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
18
***************************************************************************/
20
#include "sortabledockcommon.h"
23
#include <QtCore/QDateTime>
24
#include <QtCore/QStringList>
25
#include <QtCore/QTimer>
26
#include <QtCore/QString>
32
#include "../lib/call.h"
33
#include "../lib/contact.h"
34
#include "../lib/callmodel.h"
35
#include "akonadibackend.h"
37
///StaticEventHandler constructor
38
StaticEventHandler::StaticEventHandler(QObject* parent, QStringList* list) : QObject(parent),m_pList(list)
40
QTimer* timer = new QTimer(this);
41
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
42
timer->start(86400000); //1 day
46
///Update the days constant, necessary to cycle after midnight
47
void StaticEventHandler::update()
52
QDate::currentDate().addDays(-2).toString("dddd").toAscii()<<//2
53
QDate::currentDate().addDays(-3).toString("dddd").toAscii()<<//3
54
QDate::currentDate().addDays(-4).toString("dddd").toAscii()<<//4
55
QDate::currentDate().addDays(-5).toString("dddd").toAscii()<<//5
56
QDate::currentDate().addDays(-6).toString("dddd").toAscii()<<//6
59
"Three weeks ago" <<//9
61
"Two months ago" <<//11
62
"Three months ago" <<//12
63
"Four months ago" <<//13
64
"Five months ago" <<//14
65
"Six months ago" <<//15
66
"Seven months ago" <<//16
67
"Eight months ago" <<//17
68
"Nine months ago" <<//18
69
"Ten months ago" <<//19
70
"Eleven months ago" <<//20
71
"Twelve months ago" <<//21
73
"Very long time ago" <<//23