Changeset 11112


Ignore:
Timestamp:
Aug 4, 2010, 4:25:30 PM (12 years ago)
Author:
charles
Message:

(trunk qt) #3482 "Handle common user errors when adding an existing torrent" -- fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/options.cc

    r11092 r11112  
    550550    }
    551551
    552     const bool done = myVerifyPieceIndex >= myInfo.pieceCount;
     552    bool done = myVerifyPieceIndex >= myInfo.pieceCount;
     553    if( done )
     554    {
     555        uint64_t have = 0;
     556        foreach( const TrFile& f, myFiles )
     557            have += f.have;
     558
     559        if( !have ) // everything failed
     560        {
     561            // did the user accidentally specify the child directory instead of the parent?
     562            const QStringList tokens = QString(file->name).split('/');
     563            if( !tokens.empty() && myDestination.dirName()==tokens.at(0) )
     564            {
     565                // move up one directory and try again
     566                myDestination.cdUp( );
     567                refreshDestinationButton( -1 );
     568                onVerify( );
     569                done = false;
     570            }
     571        }
     572    }
    553573
    554574    if( done )
Note: See TracChangeset for help on using the changeset viewer.