mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
(trunk qt) #3482 "Handle common user errors when adding an existing torrent" -- fixed
This commit is contained in:
parent
d4f97143cd
commit
515ac1be36
1 changed files with 21 additions and 1 deletions
|
@ -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( );
|
||||
|
|
Loading…
Reference in a new issue