~ubuntu-branches/ubuntu/oneiric/koffice/oneiric-updates

« back to all changes in this revision

Viewing changes to kplato/libs/models/kptresourceappointmentsmodel.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
327
327
 
328
328
long ResourceAppointmentsItemModel::id() const
329
329
{
330
 
    return m_manager == 0 ? -1 : m_manager->id();
 
330
    return m_manager == 0 ? -1 : m_manager->scheduleId();
331
331
}
332
332
 
333
333
Qt::ItemFlags ResourceAppointmentsItemModel::flags( const QModelIndex &index ) const
419
419
    if ( r && ( m_showInternal || m_showExternal ) ) {
420
420
        int num = m_showInternal ? r->numAppointments( id() ) : 0;
421
421
        if ( row < num ) {
422
 
            //kDebug()<<"Appointment: "<<r->appointmentAt( row, m_manager->id() );
 
422
            //kDebug()<<"Appointment: "<<r->appointmentAt( row, m_manager->scheduleId() );
423
423
            return createAppointmentIndex( row, column, r->appointmentAt( row, id() ) );
424
424
        }
425
425
        int extRow = row - num;
464
464
 
465
465
void ResourceAppointmentsItemModel::refreshData()
466
466
{
467
 
    long id = m_manager == 0 ? -1 : m_manager->id();
 
467
    long id = m_manager == 0 ? -1 : m_manager->scheduleId();
468
468
    //kDebug()<<"Schedule id: "<<id<<endl;
469
469
    QDate start;
470
470
    QDate end;
598
598
        case Qt::DisplayRole: {
599
599
            Duration d;
600
600
            if ( m_showInternal ) {
601
 
                QList<Appointment*> lst = res->appointments( m_manager->id() );
 
601
                QList<Appointment*> lst = res->appointments( m_manager->scheduleId() );
602
602
                foreach ( Appointment *a, lst ) {
603
603
                    if ( m_effortMap.contains( a ) ) {
604
604
                        d += m_effortMap[ a ].totalEffort();
1429
1429
 
1430
1430
long ResourceAppointmentsRowModel::id() const
1431
1431
{
1432
 
    return m_manager ? m_manager->id() : -1;
 
1432
    return m_manager ? m_manager->scheduleId() : -1;
1433
1433
}
1434
1434
 
1435
1435
const QMetaEnum ResourceAppointmentsRowModel::columnMap() const
1437
1437
    return metaObject()->enumerator( metaObject()->indexOfEnumerator("Properties") );
1438
1438
}
1439
1439
 
1440
 
int ResourceAppointmentsRowModel::columnCount( const QModelIndex & parent ) const
 
1440
int ResourceAppointmentsRowModel::columnCount( const QModelIndex & /*parent */) const
1441
1441
{
1442
1442
    return columnMap().keyCount();
1443
1443
}
1594
1594
    if ( Resource *r = resource( parent ) ) {
1595
1595
        int num = r->numAppointments( id() ) + r->numExternalAppointments();
1596
1596
        if ( row < num ) {
1597
 
            //kDebug()<<"Appointment: "<<r->appointmentAt( row, m_manager->id() );
 
1597
            //kDebug()<<"Appointment: "<<r->appointmentAt( row, m_manager->scheduleId() );
1598
1598
            return const_cast<ResourceAppointmentsRowModel*>( this )->createAppointmentIndex( row, column, r );
1599
1599
        }
1600
1600
        return QModelIndex();
1602
1602
    if ( Appointment *a = appointment( parent ) ) {
1603
1603
        int num = a->count();
1604
1604
        if ( row < num ) {
1605
 
            //kDebug()<<"Appointment: "<<r->appointmentAt( row, m_manager->id() );
 
1605
            //kDebug()<<"Appointment: "<<r->appointmentAt( row, m_manager->scheduleId() );
1606
1606
            return const_cast<ResourceAppointmentsRowModel*>( this )->createIntervalIndex( row, column, a );
1607
1607
        }
1608
1608
        return QModelIndex();
1779
1779
    beginInsertRows( QModelIndex(), row, row );
1780
1780
}
1781
1781
 
1782
 
void ResourceAppointmentsRowModel::slotResourceGroupInserted( const ResourceGroup*group )
 
1782
void ResourceAppointmentsRowModel::slotResourceGroupInserted( const ResourceGroup*/*group*/ )
1783
1783
{
1784
1784
    endInsertRows();
1785
1785
}