1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

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

This commit is contained in:
Charles Kerr 2010-08-04 16:25:30 +00:00
parent d4f97143cd
commit 515ac1be36

View file

@ -549,7 +549,27 @@ Options :: onTimeout( )
myVerifyFilePos = 0;
}
const bool done = myVerifyPieceIndex >= myInfo.pieceCount;
bool done = myVerifyPieceIndex >= myInfo.pieceCount;
if( done )
{
uint64_t have = 0;
foreach( const TrFile& f, myFiles )
have += f.have;
if( !have ) // everything failed
{
// did the user accidentally specify the child directory instead of the parent?
const QStringList tokens = QString(file->name).split('/');
if( !tokens.empty() && myDestination.dirName()==tokens.at(0) )
{
// move up one directory and try again
myDestination.cdUp( );
refreshDestinationButton( -1 );
onVerify( );
done = false;
}
}
}
if( done )
myVerifyTimer.stop( );