Skip to content
Snippets Groups Projects
Select Git revision
  • 09d7cd3a650eb4fc026f7433c882e9ec4a48d925
  • master default protected
  • release/202005
  • release/202001
  • release/201912
  • release/201911
  • release/releaseWindowsTestOne
  • release/releaseTest
  • release/releaseWindowsTest
  • release/windowsReleaseTest
  • release/201910
  • release/qt/201910
  • release/windows-test/201910
  • release/201908
  • release/201906
  • release/201905
  • release/201904
  • release/201903
  • release/201902
  • release/201901
  • release/201812
  • 1.0.0
  • 0.3.0
  • 0.2.1
  • 0.2.0
  • 0.1.0
26 results

recentmodel.cpp

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    recentmodel.cpp 39.15 KiB
    /************************************************************************************
     *   Copyright (C) 2015-2016 by Savoir-faire Linux                                       *
     *   Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>         *
     *            Alexandre Lision <alexandre.lision@savoirfairelinux.com>              *
     *            Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>        *
     *                                                                                  *
     *   This library is free software; you can redistribute it and/or                  *
     *   modify it under the terms of the GNU Lesser General Public                     *
     *   License as published by the Free Software Foundation; either                   *
     *   version 2.1 of the License, or (at your option) any later version.             *
     *                                                                                  *
     *   This library 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              *
     *   Lesser General Public License for more details.                                *
     *                                                                                  *
     *   You should have received a copy of the GNU Lesser General Public               *
     *   License along with this library; if not, write to the Free Software            *
     *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA *
     ***********************************************************************************/
    #include "recentmodel.h"
    
    //std
    #include <algorithm>
    
    //Qt
    #include <QtCore/QCoreApplication>
    #include <QtCore/QSortFilterProxyModel>
    
    //Ring
    #include <call.h>
    #include <person.h>
    #include <personmodel.h>
    #include <contactmethod.h>
    #include <phonedirectorymodel.h>
    #include <callmodel.h>
    #include <categorizedhistorymodel.h>
    #include <media/recordingmodel.h>
    #include <media/textrecording.h>
    
    struct CallGroup
    {
       QVector<Call*>  m_lCalls   ;
       Call::Direction m_Direction;
       bool            m_Missed   ;
       time_t          m_LastUsed ;
    };
    
    struct RecentViewNode
    {
       //Types
       enum class Type {
          PERSON            ,
          CONTACT_METHOD    ,
          CALL              ,
          CALL_GROUP        ,
          CONFERENCE        ,
          TEXT_MESSAGE      ,
          TEXT_MESSAGE_GROUP,
       };
    
       //Constructor
       explicit RecentViewNode();
       RecentViewNode(Call* c, RecentModelPrivate* model);
       RecentViewNode(const Person *p, RecentModelPrivate* model);
       RecentViewNode(ContactMethod *cm, RecentModelPrivate* model);
       virtual ~RecentViewNode();
    
       //Attributes
       RecentModelPrivate*    m_pModel   ;