added extension for file names in partial dir, so them can be previewed in windows

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1390 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
alexandrut 2009-07-18 12:23:34 +00:00
parent 0ac7a92677
commit f98d4f080b

View File

@ -735,7 +735,16 @@ bool ftController::FileRequest(std::string fname, std::string hash,
{ RsStackMutex stack(ctrlMutex); /******* LOCKED ********/ { RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
savepath = mPartialsPath + "/" + hash; /* extension added to partial name to made
* possible preview of partial files from gui */
std::string ext = "";
int pos = fname.find_last_of('.');
if (pos > 0) /* don't apply for hidden files with no extension */
{
ext = fname.substr(pos);
}
savepath = mPartialsPath + "/" + hash + ext;
destination = dest + "/" + fname; destination = dest + "/" + fname;
/* if no destpath - send to download directory */ /* if no destpath - send to download directory */