mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-23 22:49:37 -05:00
Small changes to how gui handles files.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@798 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
aee6cb85b4
commit
b0d462c93e
@ -31,6 +31,7 @@
|
||||
#include "rsiface/rsforums.h"
|
||||
#include "rsiface/rschannels.h"
|
||||
#include "rsiface/rsmsgs.h"
|
||||
#include "rsiface/rsfiles.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@ -151,6 +152,7 @@ void GeneralMsgDialog::dropEvent(QDropEvent *event)
|
||||
|
||||
if (localpath.size() > 0)
|
||||
{
|
||||
|
||||
addAttachment(localpath);
|
||||
}
|
||||
}
|
||||
@ -293,6 +295,13 @@ void GeneralMsgDialog::addAttachment(std::string path)
|
||||
std::cerr << "GeneralMsgDialog::addAttachment()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
/* add to ExtraList here,
|
||||
* use default TIMEOUT of 30 days (time to fetch it).
|
||||
*/
|
||||
//uint32_t period = 30 * 24 * 60 * 60;
|
||||
//uint32_t flags = 0;
|
||||
//rsFiles->ExtraFileHash(localpath, period, flags);
|
||||
|
||||
/* add widget in for new destination */
|
||||
SubFileItem *file = new SubFileItem(path);
|
||||
|
||||
|
@ -340,6 +340,7 @@ void MessagesDialog::getallrecommended()
|
||||
std::cerr << "MessagesDialog::getallrecommended() Calling File Request";
|
||||
std::cerr << std::endl;
|
||||
std::list<std::string> srcIds;
|
||||
srcIds.push_back(msgInfo.srcId);
|
||||
rsFiles -> FileRequest(*fit, *hit, *sit, "", 0, srcIds);
|
||||
}
|
||||
}
|
||||
|
@ -375,7 +375,7 @@ void TransfersDialog::insertTransfers()
|
||||
for(it = downHashes.begin(); it != downHashes.end(); it++)
|
||||
{
|
||||
FileInfo info;
|
||||
if (!rsFiles->FileDetails(*it, 0, info))
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, info))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -484,7 +484,7 @@ void TransfersDialog::insertTransfers()
|
||||
for(it = upHashes.begin(); it != upHashes.end(); it++)
|
||||
{
|
||||
FileInfo info;
|
||||
if (!rsFiles->FileDetails(*it, 0, info))
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_UPLOAD, info))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -77,6 +77,9 @@ SubFileItem::SubFileItem(std::string hash, std::string name, uint64_t size,
|
||||
{
|
||||
mMode = SFI_STATE_ERROR;
|
||||
}
|
||||
/**** Enable ****
|
||||
*****/
|
||||
|
||||
/* all other states are possible */
|
||||
|
||||
if (!rsFiles)
|
||||
@ -98,7 +101,7 @@ SubFileItem::SubFileItem(std::string path)
|
||||
mType = SFI_TYPE_ATTACH;
|
||||
|
||||
/* ask for Files to hash/prepare it for us */
|
||||
if ((!rsFiles) || (rsFiles->ExtraFileHash(path, SFI_DEFAULT_PERIOD, 0)))
|
||||
if ((!rsFiles) || (!rsFiles->ExtraFileHash(path, SFI_DEFAULT_PERIOD, 0)))
|
||||
{
|
||||
mMode = SFI_STATE_ERROR;
|
||||
}
|
||||
|
@ -77,6 +77,8 @@ const uint32_t RS_FILE_HINTS_NO_SEARCH = 0x02000000;
|
||||
//const uint32_t RS_FILE_HINTS_CACHE = 0x00000001; // ALREADY EXISTS
|
||||
const uint32_t RS_FILE_HINTS_MEDIA = 0x00001000;
|
||||
|
||||
const uint32_t RS_FILE_HINTS_BACKGROUND = 0x00002000; // To download slowly.
|
||||
|
||||
const uint32_t RS_FILE_EXTRA_DELETE = 0x0010;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user