Changeset 9261 for trunk/qt/mainwin.cc


Ignore:
Timestamp:
Oct 10, 2009, 12:39:38 AM (13 years ago)
Author:
charles
Message:

(trunk Qt) #2298: qtr client crashes when expired torrent is removed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/mainwin.cc

    r9247 r9261  
    719719                                      .arg( Utils :: sizeToString( stats.uploadedBytes ) );
    720720    }
    721     else /* default is "total-ratio" */
     721    else // default is "total-ratio"
    722722    {
    723723        str = tr( "Ratio: %1" ).arg( Utils :: ratioToString( mySession.getCumulativeStats().ratio ) );
     
    738738    const int rowCount( model->rowCount( ) );
    739739
    740     /* count how many torrents are selected, paused, etc */
     740    // count how many torrents are selected, paused, etc
    741741    for( int row=0; row<rowCount; ++row ) {
    742742        const QModelIndex modelIndex( model->index( row, 0 ) );
    743743        assert( model == modelIndex.model( ) );
    744744        const Torrent * tor( model->data( modelIndex, TorrentModel::TorrentRole ).value<const Torrent*>( ) );
    745         const bool isSelected( selectionModel->isSelected( modelIndex ) );
    746         const bool isPaused( tor->isPaused( ) );
    747         if( isSelected )
    748             ++selected;
    749         if( isPaused )
    750             ++ paused;
    751         if( isSelected && isPaused )
    752             ++selectedAndPaused;
    753         if( tor->canManualAnnounce( ) )
    754             ++canAnnounce;
     745        if( tor ) {
     746            const bool isSelected( selectionModel->isSelected( modelIndex ) );
     747            const bool isPaused( tor->isPaused( ) );
     748            if( isSelected )
     749                ++selected;
     750            if( isPaused )
     751                ++ paused;
     752            if( isSelected && isPaused )
     753                ++selectedAndPaused;
     754            if( tor->canManualAnnounce( ) )
     755                ++canAnnounce;
     756        }
    755757    }
    756758
Note: See TracChangeset for help on using the changeset viewer.