mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-09 01:25:17 -04:00
Share Flags
- 1st attempt at displaying share properties in the SharedFlagsDialog. - added share flags in DirDetails structure in place of Rank, that is not used anymore. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1509 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2380b0c793
commit
a808ab9173
8 changed files with 225 additions and 179 deletions
|
@ -932,7 +932,39 @@ int FileIndexMonitor::RequestDirDetails(void *ref, DirDetails &details, uint32_t
|
|||
fi.root->checkParentPointers();
|
||||
#endif
|
||||
|
||||
return fi.RequestDirDetails(ref,details,flags) ;
|
||||
// return details as reported by the FileIndex
|
||||
|
||||
bool b = fi.RequestDirDetails(ref,details,flags) ;
|
||||
|
||||
// look for the top level and setup flags accordingly
|
||||
|
||||
FileEntry *file = (FileEntry *) ref;
|
||||
DirEntry *dir = dynamic_cast<DirEntry *>(file);
|
||||
DirEntry *last_dir = NULL ;
|
||||
|
||||
if(dir != NULL)
|
||||
while(dir->parent != NULL)
|
||||
{
|
||||
last_dir = dir ;
|
||||
dir = dir->parent ;
|
||||
}
|
||||
|
||||
if(last_dir != NULL)
|
||||
{
|
||||
std::cerr << "FileIndexMonitor::RequestDirDetails: parent->name=" << last_dir->name << std::endl ;
|
||||
std::map<std::string,SharedDirInfo>::const_iterator it = directoryMap.find(last_dir->name) ;
|
||||
|
||||
if(it == directoryMap.end())
|
||||
std::cerr << "*********** ERROR *********** In " << __PRETTY_FUNCTION__ << std::endl ;
|
||||
else
|
||||
{
|
||||
details.flags |= (( (it->second.shareflags & RS_FILE_HINTS_BROWSABLE)>0)?DIR_FLAGS_BROWSABLE:0) ;
|
||||
details.flags |= (( (it->second.shareflags & RS_FILE_HINTS_NETWORK_WIDE)>0)?DIR_FLAGS_NETWORK_WIDE:0) ;
|
||||
std::cerr << "flags = " << details.flags << std::endl ;
|
||||
}
|
||||
}
|
||||
|
||||
return b ;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1120,7 +1120,7 @@ int FileIndex::RequestDirDetails(void *ref, DirDetails &details, uint32_t flags)
|
|||
if (!ref)
|
||||
{
|
||||
#ifdef FI_DEBUG
|
||||
std::cerr << "FileIndexMonitor::RequestDirDetails() ref=NULL (root)" << std::endl;
|
||||
std::cerr << "FileIndex::RequestDirDetails() ref=NULL (root)" << std::endl;
|
||||
#endif
|
||||
/* local only */
|
||||
DirStub stub;
|
||||
|
@ -1138,14 +1138,14 @@ int FileIndex::RequestDirDetails(void *ref, DirDetails &details, uint32_t flags)
|
|||
details.hash = "";
|
||||
details.path = "";
|
||||
details.age = 0;
|
||||
details.rank = 0;
|
||||
details.flags = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dir) /* has children --- fill */
|
||||
{
|
||||
#ifdef FI_DEBUG
|
||||
std::cerr << "FileIndexStore::RequestDirDetails() ref=dir" << std::endl;
|
||||
std::cerr << "FileIndex::RequestDirDetails() ref=dir" << std::endl;
|
||||
#endif
|
||||
std::map<std::string, FileEntry *>::iterator fit;
|
||||
std::map<std::string, DirEntry *>::iterator dit;
|
||||
|
@ -1190,7 +1190,7 @@ int FileIndex::RequestDirDetails(void *ref, DirDetails &details, uint32_t flags)
|
|||
details.name = file->name;
|
||||
details.hash = file->hash;
|
||||
details.age = time(NULL) - file->modtime;
|
||||
details.rank = file->pop;
|
||||
details.flags = 0;//file->pop;
|
||||
|
||||
/* find parent pointer, and row */
|
||||
DirEntry *parent = file->parent;
|
||||
|
|
|
@ -219,7 +219,7 @@ int FileIndexStore::RequestDirDetails(void *ref, DirDetails &details, uint32_t f
|
|||
details.hash = "";
|
||||
details.path = "";
|
||||
details.age = 0;
|
||||
details.rank = 0;
|
||||
details.flags = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -244,7 +244,7 @@ int FileIndexStore::RequestDirDetails(void *ref, DirDetails &details, uint32_t f
|
|||
details.path = "";
|
||||
details.count = indices.size();
|
||||
details.age = 0;
|
||||
details.rank = 0;
|
||||
details.flags = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -300,7 +300,7 @@ int FileIndexStore::RequestDirDetails(void *ref, DirDetails &details, uint32_t f
|
|||
details.name = file->name;
|
||||
details.hash = file->hash;
|
||||
details.age = time(NULL) - file->modtime;
|
||||
details.rank = file->pop;
|
||||
details.flags = 0;//file->pop;
|
||||
|
||||
/* find parent pointer, and row */
|
||||
DirEntry *parent = file->parent;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue