~ubuntu-branches/ubuntu/trusty/sflphone/trusty

« back to all changes in this revision

Viewing changes to kde/src/klib/sortabledockcommon.cpp

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (4.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20140128182336-jrsv0k9u6cawc068
Tags: 1.3.0-1
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
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> *
5
 
 *                                                                          *
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.     *
10
 
 *                                                                          *
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.                        *
15
 
 *                                                                          *
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
 
 ***************************************************************************/
19
 
 
20
 
#include "sortabledockcommon.h"
21
 
 
22
 
//Qt
23
 
#include <QtCore/QDateTime>
24
 
#include <QtCore/QStringList>
25
 
#include <QtCore/QTimer>
26
 
#include <QtCore/QString>
27
 
 
28
 
//KDE
29
 
#include <KLocale>
30
 
 
31
 
//SFLPhone
32
 
#include "../lib/call.h"
33
 
#include "../lib/contact.h"
34
 
#include "../lib/callmodel.h"
35
 
#include "akonadibackend.h"
36
 
 
37
 
///StaticEventHandler constructor
38
 
StaticEventHandler::StaticEventHandler(QObject* parent, QStringList* list) : QObject(parent),m_pList(list)
39
 
{
40
 
   QTimer* timer = new QTimer(this);
41
 
   connect(timer, SIGNAL(timeout()), this, SLOT(update()));
42
 
   timer->start(86400000); //1 day
43
 
   update();
44
 
}
45
 
 
46
 
///Update the days constant, necessary to cycle after midnight
47
 
void StaticEventHandler::update()
48
 
{
49
 
   (*m_pList) << 
50
 
      "Today"                                                    <<//0
51
 
      "Yesterday"                                                <<//1
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
57
 
      "Last week"                                                <<//7
58
 
      "Two weeks ago"                                            <<//8
59
 
      "Three weeks ago"                                          <<//9
60
 
      "Last month"                                               <<//10
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
72
 
      "Last year"                                                <<//22
73
 
      "Very long time ago"                                       <<//23
74
 
      "Never"                                                     ;//24
75
 
}