mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-15 18:09:32 -04: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
5 changed files with 18 additions and 3 deletions
|
@ -31,6 +31,7 @@
|
||||||
#include "rsiface/rsforums.h"
|
#include "rsiface/rsforums.h"
|
||||||
#include "rsiface/rschannels.h"
|
#include "rsiface/rschannels.h"
|
||||||
#include "rsiface/rsmsgs.h"
|
#include "rsiface/rsmsgs.h"
|
||||||
|
#include "rsiface/rsfiles.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
@ -151,6 +152,7 @@ void GeneralMsgDialog::dropEvent(QDropEvent *event)
|
||||||
|
|
||||||
if (localpath.size() > 0)
|
if (localpath.size() > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
addAttachment(localpath);
|
addAttachment(localpath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -293,6 +295,13 @@ void GeneralMsgDialog::addAttachment(std::string path)
|
||||||
std::cerr << "GeneralMsgDialog::addAttachment()";
|
std::cerr << "GeneralMsgDialog::addAttachment()";
|
||||||
std::cerr << std::endl;
|
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 */
|
/* add widget in for new destination */
|
||||||
SubFileItem *file = new SubFileItem(path);
|
SubFileItem *file = new SubFileItem(path);
|
||||||
|
|
||||||
|
|
|
@ -340,6 +340,7 @@ void MessagesDialog::getallrecommended()
|
||||||
std::cerr << "MessagesDialog::getallrecommended() Calling File Request";
|
std::cerr << "MessagesDialog::getallrecommended() Calling File Request";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
std::list<std::string> srcIds;
|
std::list<std::string> srcIds;
|
||||||
|
srcIds.push_back(msgInfo.srcId);
|
||||||
rsFiles -> FileRequest(*fit, *hit, *sit, "", 0, srcIds);
|
rsFiles -> FileRequest(*fit, *hit, *sit, "", 0, srcIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -375,7 +375,7 @@ void TransfersDialog::insertTransfers()
|
||||||
for(it = downHashes.begin(); it != downHashes.end(); it++)
|
for(it = downHashes.begin(); it != downHashes.end(); it++)
|
||||||
{
|
{
|
||||||
FileInfo info;
|
FileInfo info;
|
||||||
if (!rsFiles->FileDetails(*it, 0, info))
|
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, info))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -484,7 +484,7 @@ void TransfersDialog::insertTransfers()
|
||||||
for(it = upHashes.begin(); it != upHashes.end(); it++)
|
for(it = upHashes.begin(); it != upHashes.end(); it++)
|
||||||
{
|
{
|
||||||
FileInfo info;
|
FileInfo info;
|
||||||
if (!rsFiles->FileDetails(*it, 0, info))
|
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_UPLOAD, info))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,9 @@ SubFileItem::SubFileItem(std::string hash, std::string name, uint64_t size,
|
||||||
{
|
{
|
||||||
mMode = SFI_STATE_ERROR;
|
mMode = SFI_STATE_ERROR;
|
||||||
}
|
}
|
||||||
|
/**** Enable ****
|
||||||
|
*****/
|
||||||
|
|
||||||
/* all other states are possible */
|
/* all other states are possible */
|
||||||
|
|
||||||
if (!rsFiles)
|
if (!rsFiles)
|
||||||
|
@ -98,7 +101,7 @@ SubFileItem::SubFileItem(std::string path)
|
||||||
mType = SFI_TYPE_ATTACH;
|
mType = SFI_TYPE_ATTACH;
|
||||||
|
|
||||||
/* ask for Files to hash/prepare it for us */
|
/* 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;
|
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_CACHE = 0x00000001; // ALREADY EXISTS
|
||||||
const uint32_t RS_FILE_HINTS_MEDIA = 0x00001000;
|
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;
|
const uint32_t RS_FILE_EXTRA_DELETE = 0x0010;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue