From f98d4f080b81b16cd4afe1d8de06418981cdc10c Mon Sep 17 00:00:00 2001 From: alexandrut Date: Sat, 18 Jul 2009 12:23:34 +0000 Subject: [PATCH] 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 --- libretroshare/src/ft/ftcontroller.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index f6c740253..83e2ec2e8 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -735,7 +735,16 @@ bool ftController::FileRequest(std::string fname, std::string hash, { 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; /* if no destpath - send to download directory */