fixed bug introduced in 6910, due to calling member on deleted mCreator

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6914 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-11-28 19:43:14 +00:00
parent dda9d4eca5
commit 01588f6f53
2 changed files with 21 additions and 6 deletions

View file

@ -937,12 +937,25 @@ int TransfersDialog::addItem(int row, const FileInfo &fileInfo, const std::map<s
qlonglong completed = fileInfo.transfered;
qlonglong remaining = fileInfo.size - fileInfo.transfered;
qlonglong downloadtime = (fileInfo.size - fileInfo.transfered) / (fileInfo.tfRate * 1024.0);
qint64 qi64LastDL = fileInfo.lastTS ; //std::numeric_limits<qint64>::max();
qint64 qi64LastDL = fileInfo.lastTS ; //std::numeric_limits<qint64>::max();
QString strPath = QString::fromUtf8(fileInfo.path.c_str());
QString strPathAfterDL = strPath;
strPathAfterDL.replace(QString::fromUtf8(rsFiles->getDownloadDirectory().c_str()),"");
QStringList qslPath = strPathAfterDL.split("/");
if (qi64LastDL == 0) // file is complete, or any raison why the time has not been set properly
{
QFileInfo file;
if (fileInfo.downloadStatus == FT_STATE_COMPLETE)
file = QFileInfo(QString::fromUtf8(fileInfo.path.c_str()), QString::fromUtf8(fileInfo.fname.c_str()));
else
file = QFileInfo(QString::fromUtf8(rsFiles->getPartialsDirectory().c_str()), QString::fromUtf8(fileInfo.hash.c_str()));
/*Get Last Access on File */
if (file.exists())
qi64LastDL = file.lastModified().toTime_t();
}
QString strPath = QString::fromUtf8(fileInfo.path.c_str());
QString strPathAfterDL = strPath;
strPathAfterDL.replace(QString::fromUtf8(rsFiles->getDownloadDirectory().c_str()),"");
QStringList qslPath = strPathAfterDL.split("/");
FileChunksInfo fcinfo;
if (!rsFiles->FileDownloadChunksDetails(fileInfo.hash, fcinfo)) {