mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed getFileInfo and transfer from new database
This commit is contained in:
parent
c1e538ff13
commit
274f924ca0
@ -260,6 +260,7 @@ bool InternalFileHierarchyStorage::updateHash(const DirectoryStorage::EntryIndex
|
||||
std::cerr << "[directory storage] updating hash at index " << file_index << ", hash=" << hash << std::endl;
|
||||
|
||||
RsFileHash& old_hash (static_cast<FileEntry*>(mNodes[file_index])->file_hash) ;
|
||||
mFileHashes[hash] = file_index ;
|
||||
|
||||
old_hash = hash ;
|
||||
|
||||
@ -282,6 +283,9 @@ bool InternalFileHierarchyStorage::updateFile(const DirectoryStorage::EntryIndex
|
||||
fe.file_modtime = modf_time;
|
||||
fe.file_name = fname;
|
||||
|
||||
if(!hash.isNull())
|
||||
mFileHashes[hash] = file_index ;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -185,9 +185,36 @@ void DirectoryStorage::print()
|
||||
|
||||
bool LocalDirectoryStorage::getFileInfo(DirectoryStorage::EntryIndex i,FileInfo& info)
|
||||
{
|
||||
RS_STACK_MUTEX(mDirStorageMtx) ;
|
||||
DirDetails d;
|
||||
extractData(i,d) ;
|
||||
|
||||
info.storage_permission_flags = d.flags; // Combination of the four RS_DIR_FLAGS_*. Updated when the file is a local stored file.
|
||||
info.parent_groups = d.parent_groups;
|
||||
info.transfer_info_flags = TransferRequestFlags(); // various flags from RS_FILE_HINTS_*
|
||||
info.path = d.path + "/" + d.name;
|
||||
info.fname = d.name;
|
||||
info.hash = d.hash;
|
||||
info.size = d.count;
|
||||
|
||||
// all this stuff below is not useful in this case.
|
||||
|
||||
info.mId = 0; /* (GUI) Model Id -> unique number */
|
||||
info.ext.clear();
|
||||
info.avail = 0; /* how much we have */
|
||||
info.rank = 0;
|
||||
info.age = 0;
|
||||
info.queue_position =0;
|
||||
info.searchId = 0; /* 0 if none */
|
||||
|
||||
/* Transfer Stuff */
|
||||
info.transfered = 0;
|
||||
info.tfRate = 0; /* in kbytes */
|
||||
info.downloadStatus = FT_STATE_COMPLETE ;
|
||||
std::list<TransferInfo> peers;
|
||||
|
||||
info.priority = SPEED_NORMAL;
|
||||
info.lastTS = 0;
|
||||
|
||||
NOT_IMPLEMENTED();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user