switch file to REMOTE state in subfileitem if the attachment has already been checked in the past but the file is not here anymore

This commit is contained in:
csoler 2017-05-15 21:37:22 +02:00
parent 18e37deba0
commit 84e588b7e0
4 changed files with 16 additions and 16 deletions

View file

@ -186,7 +186,7 @@ void SubFileItem::updateItemStatic()
}
/* get full path for local file */
if ((mMode == SFI_STATE_LOCAL) || (mMode == SFI_STATE_UPLOAD))
if (((mMode == SFI_STATE_LOCAL) || (mMode == SFI_STATE_UPLOAD)))
{
#ifdef DEBUG_ITEM
std::cerr << "SubFileItem::updateItemStatic() STATE=Local/Upload checking path";
@ -200,7 +200,10 @@ void SubFileItem::updateItemStatic()
/* look up path */
if (!rsFiles->FileDetails(mFileHash, hintflags, fi))
{
mMode = SFI_STATE_ERROR;
if(mFlag & SFI_FLAG_ASSUME_FILE_READY)
mMode = SFI_STATE_REMOTE;
else
mMode = SFI_STATE_ERROR;
#ifdef DEBUG_ITEM
std::cerr << "SubFileItem::updateItemStatic() STATE=>Error No Details";
std::cerr << std::endl;
@ -251,6 +254,7 @@ void SubFileItem::updateItemStatic()
case SFI_STATE_REMOTE:
playButton->setEnabled(false);
downloadButton->setEnabled(true);
downloadButton->setVisible(true);
cancelButton->setEnabled(false);
progressBar->setValue(0);