mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #584 from mr-alice/v0.6-FileLists
added an option to follow symbolic links or not, and anti-loop system…
This commit is contained in:
commit
c92c270a4e
@ -43,6 +43,8 @@ LocalDirectoryUpdater::LocalDirectoryUpdater(HashStorage *hc,LocalDirectoryStora
|
|||||||
|
|
||||||
mDelayBetweenDirectoryUpdates = DELAY_BETWEEN_DIRECTORY_UPDATES;
|
mDelayBetweenDirectoryUpdates = DELAY_BETWEEN_DIRECTORY_UPDATES;
|
||||||
mIsEnabled = false ;
|
mIsEnabled = false ;
|
||||||
|
mFollowSymLinks = FOLLOW_SYMLINKS_DEFAULT ;
|
||||||
|
mNeedsFullRebuild = false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LocalDirectoryUpdater::isEnabled() const
|
bool LocalDirectoryUpdater::isEnabled() const
|
||||||
@ -69,6 +71,8 @@ void LocalDirectoryUpdater::data_tick()
|
|||||||
if(now > mDelayBetweenDirectoryUpdates + mLastSweepTime)
|
if(now > mDelayBetweenDirectoryUpdates + mLastSweepTime)
|
||||||
{
|
{
|
||||||
sweepSharedDirectories() ;
|
sweepSharedDirectories() ;
|
||||||
|
|
||||||
|
mNeedsFullRebuild = false ;
|
||||||
mLastSweepTime = now;
|
mLastSweepTime = now;
|
||||||
mSharedDirectories->notifyTSChanged() ;
|
mSharedDirectories->notifyTSChanged() ;
|
||||||
}
|
}
|
||||||
@ -119,29 +123,43 @@ void LocalDirectoryUpdater::sweepSharedDirectories()
|
|||||||
|
|
||||||
// now for each of them, go recursively and match both files and dirs
|
// now for each of them, go recursively and match both files and dirs
|
||||||
|
|
||||||
|
std::set<std::string> existing_dirs ;
|
||||||
|
|
||||||
for(DirectoryStorage::DirIterator stored_dir_it(mSharedDirectories,mSharedDirectories->root()) ; stored_dir_it;++stored_dir_it)
|
for(DirectoryStorage::DirIterator stored_dir_it(mSharedDirectories,mSharedDirectories->root()) ; stored_dir_it;++stored_dir_it)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LOCAL_DIR_UPDATER
|
#ifdef DEBUG_LOCAL_DIR_UPDATER
|
||||||
std::cerr << "[directory storage] recursing into " << stored_dir_it.name() << std::endl;
|
std::cerr << "[directory storage] recursing into " << stored_dir_it.name() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
recursUpdateSharedDir(stored_dir_it.name(), *stored_dir_it) ; // here we need to use the list that was stored, instead of the shared dir list, because the two
|
recursUpdateSharedDir(stored_dir_it.name(), *stored_dir_it,existing_dirs) ; // here we need to use the list that was stored, instead of the shared dir list, because the two
|
||||||
// are not necessarily in the same order.
|
// are not necessarily in the same order.
|
||||||
}
|
}
|
||||||
|
|
||||||
RsServer::notify()->notifyListChange(NOTIFY_LIST_DIRLIST_LOCAL, 0);
|
RsServer::notify()->notifyListChange(NOTIFY_LIST_DIRLIST_LOCAL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalDirectoryUpdater::recursUpdateSharedDir(const std::string& cumulated_path, DirectoryStorage::EntryIndex indx)
|
void LocalDirectoryUpdater::recursUpdateSharedDir(const std::string& cumulated_path, DirectoryStorage::EntryIndex indx,std::set<std::string>& existing_directories)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_LOCAL_DIR_UPDATER
|
#ifdef DEBUG_LOCAL_DIR_UPDATER
|
||||||
std::cerr << "[directory storage] parsing directory " << cumulated_path << ", index=" << indx << std::endl;
|
std::cerr << "[directory storage] parsing directory " << cumulated_path << ", index=" << indx << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if(mFollowSymLinks)
|
||||||
|
{
|
||||||
|
std::string real_path = RsDirUtil::removeSymLinks(cumulated_path) ;
|
||||||
|
if(existing_directories.end() != existing_directories.find(real_path))
|
||||||
|
{
|
||||||
|
std::cerr << "(WW) Directory " << cumulated_path << " has real path " << real_path << " which already belongs to another shared directory. Ignoring" << std::endl;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
existing_directories.insert(real_path) ;
|
||||||
|
}
|
||||||
|
|
||||||
// make sure list of subdirs is the same
|
// make sure list of subdirs is the same
|
||||||
// make sure list of subfiles is the same
|
// make sure list of subfiles is the same
|
||||||
// request all hashes to the hashcache
|
// request all hashes to the hashcache
|
||||||
|
|
||||||
librs::util::FolderIterator dirIt(cumulated_path,false,false); // disallow symbolic links and files from the future.
|
librs::util::FolderIterator dirIt(cumulated_path,mFollowSymLinks,false); // disallow symbolic links and files from the future.
|
||||||
|
|
||||||
time_t dir_local_mod_time ;
|
time_t dir_local_mod_time ;
|
||||||
if(!mSharedDirectories->getDirectoryLocalModTime(indx,dir_local_mod_time))
|
if(!mSharedDirectories->getDirectoryLocalModTime(indx,dir_local_mod_time))
|
||||||
@ -150,8 +168,8 @@ void LocalDirectoryUpdater::recursUpdateSharedDir(const std::string& cumulated_p
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dirIt.dir_modtime() > dir_local_mod_time) // the > is because we may have changed the virtual name, and therefore the TS wont match.
|
if(mNeedsFullRebuild || dirIt.dir_modtime() > dir_local_mod_time) // the > is because we may have changed the virtual name, and therefore the TS wont match.
|
||||||
// we only want to detect when the directory has changed on the disk
|
// we only want to detect when the directory has changed on the disk
|
||||||
{
|
{
|
||||||
// collect subdirs and subfiles
|
// collect subdirs and subfiles
|
||||||
|
|
||||||
@ -213,7 +231,7 @@ void LocalDirectoryUpdater::recursUpdateSharedDir(const std::string& cumulated_p
|
|||||||
#ifdef DEBUG_LOCAL_DIR_UPDATER
|
#ifdef DEBUG_LOCAL_DIR_UPDATER
|
||||||
std::cerr << " recursing into " << stored_dir_it.name() << std::endl;
|
std::cerr << " recursing into " << stored_dir_it.name() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
recursUpdateSharedDir(cumulated_path + "/" + stored_dir_it.name(), *stored_dir_it) ;
|
recursUpdateSharedDir(cumulated_path + "/" + stored_dir_it.name(), *stored_dir_it,existing_directories) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,6 +262,20 @@ uint32_t LocalDirectoryUpdater::fileWatchPeriod() const
|
|||||||
return mDelayBetweenDirectoryUpdates ;
|
return mDelayBetweenDirectoryUpdates ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LocalDirectoryUpdater::setFollowSymLinks(bool b)
|
||||||
|
{
|
||||||
|
if(b != mFollowSymLinks)
|
||||||
|
mNeedsFullRebuild = true ;
|
||||||
|
|
||||||
|
mFollowSymLinks = b ;
|
||||||
|
|
||||||
|
forceUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LocalDirectoryUpdater::followSymLinks() const
|
||||||
|
{
|
||||||
|
return mFollowSymLinks ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,6 +47,9 @@ public:
|
|||||||
void setFileWatchPeriod(int seconds) ;
|
void setFileWatchPeriod(int seconds) ;
|
||||||
uint32_t fileWatchPeriod() const ;
|
uint32_t fileWatchPeriod() const ;
|
||||||
|
|
||||||
|
void setFollowSymLinks(bool b) ;
|
||||||
|
bool followSymLinks() const ;
|
||||||
|
|
||||||
void setEnabled(bool b) ;
|
void setEnabled(bool b) ;
|
||||||
bool isEnabled() const ;
|
bool isEnabled() const ;
|
||||||
|
|
||||||
@ -56,7 +59,7 @@ protected:
|
|||||||
virtual void hash_callback(uint32_t client_param, const std::string& name, const RsFileHash& hash, uint64_t size);
|
virtual void hash_callback(uint32_t client_param, const std::string& name, const RsFileHash& hash, uint64_t size);
|
||||||
virtual bool hash_confirm(uint32_t client_param) ;
|
virtual bool hash_confirm(uint32_t client_param) ;
|
||||||
|
|
||||||
void recursUpdateSharedDir(const std::string& cumulated_path,DirectoryStorage::EntryIndex indx);
|
void recursUpdateSharedDir(const std::string& cumulated_path, DirectoryStorage::EntryIndex indx, std::set<std::string>& existing_directories);
|
||||||
void sweepSharedDirectories();
|
void sweepSharedDirectories();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -70,5 +73,7 @@ private:
|
|||||||
|
|
||||||
uint32_t mDelayBetweenDirectoryUpdates;
|
uint32_t mDelayBetweenDirectoryUpdates;
|
||||||
bool mIsEnabled ;
|
bool mIsEnabled ;
|
||||||
|
bool mFollowSymLinks;
|
||||||
|
bool mNeedsFullRebuild ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ static const uint32_t DELAY_BEFORE_DELETE_EMPTY_REMOTE_DIR = 5*24*86400 ;
|
|||||||
static const std::string HASH_CACHE_DURATION_SS = "HASH_CACHE_DURATION" ; // key string to store hash remembering time
|
static const std::string HASH_CACHE_DURATION_SS = "HASH_CACHE_DURATION" ; // key string to store hash remembering time
|
||||||
static const std::string WATCH_FILE_DURATION_SS = "WATCH_FILES_DELAY" ; // key to store delay before re-checking for new files
|
static const std::string WATCH_FILE_DURATION_SS = "WATCH_FILES_DELAY" ; // key to store delay before re-checking for new files
|
||||||
static const std::string WATCH_FILE_ENABLED_SS = "WATCH_FILES_ENABLED"; // key to store ON/OFF flags for file whatch
|
static const std::string WATCH_FILE_ENABLED_SS = "WATCH_FILES_ENABLED"; // key to store ON/OFF flags for file whatch
|
||||||
|
static const std::string FOLLOW_SYMLINKS_SS = "FOLLOW_SYMLINKS"; // dereference symbolic links, or just ignore them.
|
||||||
static const std::string WATCH_HASH_SALT_SS = "WATCH_HASH_SALT"; // Salt that is used to hash directory names
|
static const std::string WATCH_HASH_SALT_SS = "WATCH_HASH_SALT"; // Salt that is used to hash directory names
|
||||||
|
|
||||||
static const std::string FILE_SHARING_DIR_NAME = "file_sharing" ; // hard-coded directory name to store friend file lists, hash cache, etc.
|
static const std::string FILE_SHARING_DIR_NAME = "file_sharing" ; // hard-coded directory name to store friend file lists, hash cache, etc.
|
||||||
@ -54,4 +55,6 @@ static const uint32_t NB_ENTRY_INDEX_BITS = 22 ; // Do not
|
|||||||
static const uint32_t ENTRY_INDEX_BIT_MASK = 0x003fffff ; // used for storing (EntryIndex,Friend) couples into a 32bits pointer. Depends on the two values just before. Dont change!
|
static const uint32_t ENTRY_INDEX_BIT_MASK = 0x003fffff ; // used for storing (EntryIndex,Friend) couples into a 32bits pointer. Depends on the two values just before. Dont change!
|
||||||
static const uint32_t DELAY_BEFORE_DROP_REQUEST = 600; // every 10 min
|
static const uint32_t DELAY_BEFORE_DROP_REQUEST = 600; // every 10 min
|
||||||
|
|
||||||
|
static const bool FOLLOW_SYMLINKS_DEFAULT = true;
|
||||||
|
|
||||||
static const uint32_t FL_BASE_TMP_SECTION_SIZE = 4096 ;
|
static const uint32_t FL_BASE_TMP_SECTION_SIZE = 4096 ;
|
||||||
|
@ -273,19 +273,22 @@ cleanup = true;
|
|||||||
mLocalSharedDirs->getSharedDirectoryList(dirList);
|
mLocalSharedDirs->getSharedDirectoryList(dirList);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(std::list<SharedDirInfo>::iterator it = dirList.begin(); it != dirList.end(); ++it)
|
{
|
||||||
{
|
RS_STACK_MUTEX(mFLSMtx) ;
|
||||||
RsFileConfigItem *fi = new RsFileConfigItem();
|
for(std::list<SharedDirInfo>::iterator it = dirList.begin(); it != dirList.end(); ++it)
|
||||||
|
{
|
||||||
|
RsFileConfigItem *fi = new RsFileConfigItem();
|
||||||
|
|
||||||
fi->file.path = (*it).filename ;
|
fi->file.path = (*it).filename ;
|
||||||
fi->file.name = (*it).virtualname ;
|
fi->file.name = (*it).virtualname ;
|
||||||
fi->flags = (*it).shareflags.toUInt32() ;
|
fi->flags = (*it).shareflags.toUInt32() ;
|
||||||
|
|
||||||
for(std::list<RsNodeGroupId>::const_iterator it2( (*it).parent_groups.begin());it2!=(*it).parent_groups.end();++it2)
|
for(std::list<RsNodeGroupId>::const_iterator it2( (*it).parent_groups.begin());it2!=(*it).parent_groups.end();++it2)
|
||||||
fi->parent_groups.ids.insert(*it2) ;
|
fi->parent_groups.ids.insert(*it2) ;
|
||||||
|
|
||||||
sList.push_back(fi);
|
sList.push_back(fi);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RsConfigKeyValueSet *rskv = new RsConfigKeyValueSet();
|
RsConfigKeyValueSet *rskv = new RsConfigKeyValueSet();
|
||||||
|
|
||||||
@ -314,7 +317,14 @@ cleanup = true;
|
|||||||
|
|
||||||
rskv->tlvkvs.pairs.push_back(kv);
|
rskv->tlvkvs.pairs.push_back(kv);
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
RsTlvKeyValue kv;
|
||||||
|
|
||||||
|
kv.key = FOLLOW_SYMLINKS_SS;
|
||||||
|
kv.value = followSymLinks()?"YES":"NO" ;
|
||||||
|
|
||||||
|
rskv->tlvkvs.pairs.push_back(kv);
|
||||||
|
}
|
||||||
{
|
{
|
||||||
RsTlvKeyValue kv;
|
RsTlvKeyValue kv;
|
||||||
|
|
||||||
@ -373,6 +383,10 @@ bool p3FileDatabase::loadList(std::list<RsItem *>& load)
|
|||||||
if(sscanf(kit->value.c_str(),"%d",&t) == 1)
|
if(sscanf(kit->value.c_str(),"%d",&t) == 1)
|
||||||
setWatchPeriod(t);
|
setWatchPeriod(t);
|
||||||
}
|
}
|
||||||
|
else if(kit->key == FOLLOW_SYMLINKS_SS)
|
||||||
|
{
|
||||||
|
setFollowSymLinks(kit->value == "YES") ;
|
||||||
|
}
|
||||||
else if(kit->key == WATCH_FILE_ENABLED_SS)
|
else if(kit->key == WATCH_FILE_ENABLED_SS)
|
||||||
{
|
{
|
||||||
setWatchEnabled(kit->value == "YES") ;
|
setWatchEnabled(kit->value == "YES") ;
|
||||||
@ -891,6 +905,17 @@ bool p3FileDatabase::inDirectoryCheck()
|
|||||||
RS_STACK_MUTEX(mFLSMtx) ;
|
RS_STACK_MUTEX(mFLSMtx) ;
|
||||||
return mLocalDirWatcher->inDirectoryCheck();
|
return mLocalDirWatcher->inDirectoryCheck();
|
||||||
}
|
}
|
||||||
|
void p3FileDatabase::setFollowSymLinks(bool b)
|
||||||
|
{
|
||||||
|
RS_STACK_MUTEX(mFLSMtx) ;
|
||||||
|
mLocalDirWatcher->setFollowSymLinks(b) ;
|
||||||
|
IndicateConfigChanged();
|
||||||
|
}
|
||||||
|
bool p3FileDatabase::followSymLinks() const
|
||||||
|
{
|
||||||
|
RS_STACK_MUTEX(mFLSMtx) ;
|
||||||
|
return mLocalDirWatcher->followSymLinks() ;
|
||||||
|
}
|
||||||
void p3FileDatabase::setWatchEnabled(bool b)
|
void p3FileDatabase::setWatchEnabled(bool b)
|
||||||
{
|
{
|
||||||
RS_STACK_MUTEX(mFLSMtx) ;
|
RS_STACK_MUTEX(mFLSMtx) ;
|
||||||
|
@ -138,6 +138,9 @@ class p3FileDatabase: public p3Service, public p3Config, public ftSearch //, pub
|
|||||||
void setWatchEnabled(bool b) ;
|
void setWatchEnabled(bool b) ;
|
||||||
bool watchEnabled() ;
|
bool watchEnabled() ;
|
||||||
|
|
||||||
|
bool followSymLinks() const;
|
||||||
|
void setFollowSymLinks(bool b) ;
|
||||||
|
|
||||||
// interfact for directory parsing
|
// interfact for directory parsing
|
||||||
|
|
||||||
void forceDirectoryCheck(); // Force re-sweep the directories and see what's changed
|
void forceDirectoryCheck(); // Force re-sweep the directories and see what's changed
|
||||||
|
@ -804,11 +804,13 @@ bool ftServer::removeSharedDirectory(std::string dir)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool ftServer::watchEnabled() { return mFileDatabase->watchEnabled() ; }
|
bool ftServer::watchEnabled() { return mFileDatabase->watchEnabled() ; }
|
||||||
int ftServer::watchPeriod() const { return mFileDatabase->watchPeriod()/60 ; }
|
int ftServer::watchPeriod() const { return mFileDatabase->watchPeriod()/60 ; }
|
||||||
|
bool ftServer::followSymLinks() const { return mFileDatabase->followSymLinks() ; }
|
||||||
|
|
||||||
void ftServer::setWatchEnabled(bool b) { mFileDatabase->setWatchEnabled(b) ; }
|
void ftServer::setWatchEnabled(bool b) { mFileDatabase->setWatchEnabled(b) ; }
|
||||||
void ftServer::setWatchPeriod(int minutes) { mFileDatabase->setWatchPeriod(minutes*60) ; }
|
void ftServer::setWatchPeriod(int minutes) { mFileDatabase->setWatchPeriod(minutes*60) ; }
|
||||||
|
void ftServer::setFollowSymLinks(bool b) { mFileDatabase->setFollowSymLinks(b) ; }
|
||||||
|
|
||||||
bool ftServer::getShareDownloadDirectory()
|
bool ftServer::getShareDownloadDirectory()
|
||||||
{
|
{
|
||||||
|
@ -215,6 +215,8 @@ public:
|
|||||||
virtual int watchPeriod() const ;
|
virtual int watchPeriod() const ;
|
||||||
virtual void setWatchEnabled(bool b) ;
|
virtual void setWatchEnabled(bool b) ;
|
||||||
virtual bool watchEnabled() ;
|
virtual bool watchEnabled() ;
|
||||||
|
virtual bool followSymLinks() const;
|
||||||
|
virtual void setFollowSymLinks(bool b);
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/*************** Data Transfer Interface ***********************/
|
/*************** Data Transfer Interface ***********************/
|
||||||
|
@ -247,6 +247,8 @@ class RsFiles
|
|||||||
virtual void setWatchEnabled(bool b) =0;
|
virtual void setWatchEnabled(bool b) =0;
|
||||||
virtual int watchPeriod() const =0;
|
virtual int watchPeriod() const =0;
|
||||||
virtual bool watchEnabled() =0;
|
virtual bool watchEnabled() =0;
|
||||||
|
virtual bool followSymLinks() const=0;
|
||||||
|
virtual void setFollowSymLinks(bool b)=0 ;
|
||||||
|
|
||||||
virtual bool getShareDownloadDirectory() = 0;
|
virtual bool getShareDownloadDirectory() = 0;
|
||||||
virtual bool shareDownloadDirectory(bool share) = 0;
|
virtual bool shareDownloadDirectory(bool share) = 0;
|
||||||
|
@ -480,6 +480,21 @@ bool RsDirUtil::checkCreateDirectory(const std::string& dir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string RsDirUtil::removeSymLinks(const std::string& path)
|
||||||
|
{
|
||||||
|
#if defined(WINDOWS_SYS) || defined(__APPLE__)
|
||||||
|
#warning (Mr.Alice): I don't know how to do this on windows/MacOS. See https://msdn.microsoft.com/en-us/library/windows/desktop/hh707084(v=vs.85).aspx
|
||||||
|
//if(!S_OK == PathCchCanonicalizeEx(tmp,...) ;
|
||||||
|
return path ;
|
||||||
|
#else
|
||||||
|
char *tmp = canonicalize_file_name(path.c_str()) ;
|
||||||
|
std::string result(tmp) ;
|
||||||
|
|
||||||
|
free(tmp);
|
||||||
|
return result ;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
bool RsDirUtil::cleanupDirectory(const std::string& cleandir, const std::set<std::string> &keepFiles)
|
bool RsDirUtil::cleanupDirectory(const std::string& cleandir, const std::set<std::string> &keepFiles)
|
||||||
{
|
{
|
||||||
for(librs::util::FolderIterator it(cleandir,false);it.isValid();it.next())
|
for(librs::util::FolderIterator it(cleandir,false);it.isValid();it.next())
|
||||||
|
@ -91,6 +91,10 @@ bool checkFile(const std::string& filename,uint64_t& file_size,bool disallow
|
|||||||
bool checkDirectory(const std::string& dir);
|
bool checkDirectory(const std::string& dir);
|
||||||
bool checkCreateDirectory(const std::string& dir);
|
bool checkCreateDirectory(const std::string& dir);
|
||||||
|
|
||||||
|
// Removes all symbolic links along the path and computes the actual location of the file/dir passed as argument.
|
||||||
|
|
||||||
|
std::string removeSymLinks(const std::string& path) ;
|
||||||
|
|
||||||
bool cleanupDirectory(const std::string& dir, const std::set<std::string> &keepFiles);
|
bool cleanupDirectory(const std::string& dir, const std::set<std::string> &keepFiles);
|
||||||
bool cleanupDirectoryFaster(const std::string& dir, const std::set<std::string> &keepFiles);
|
bool cleanupDirectoryFaster(const std::string& dir, const std::set<std::string> &keepFiles);
|
||||||
|
|
||||||
|
@ -68,6 +68,7 @@ bool DirectoriesPage::save(QString &/*errmsg*/)
|
|||||||
rsFiles->setWatchPeriod(ui.autoCheckDirectoriesDelay_SB->value());
|
rsFiles->setWatchPeriod(ui.autoCheckDirectoriesDelay_SB->value());
|
||||||
|
|
||||||
rsFiles->shareDownloadDirectory(ui.shareDownloadDirectoryCB->isChecked());
|
rsFiles->shareDownloadDirectory(ui.shareDownloadDirectoryCB->isChecked());
|
||||||
|
rsFiles->setFollowSymLinks(ui.followSymLinks_CB->isChecked());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -83,6 +84,7 @@ void DirectoriesPage::load()
|
|||||||
|
|
||||||
ui.incomingDir->setText(QString::fromUtf8(rsFiles->getDownloadDirectory().c_str()));
|
ui.incomingDir->setText(QString::fromUtf8(rsFiles->getDownloadDirectory().c_str()));
|
||||||
ui.partialsDir->setText(QString::fromUtf8(rsFiles->getPartialsDirectory().c_str()));
|
ui.partialsDir->setText(QString::fromUtf8(rsFiles->getPartialsDirectory().c_str()));
|
||||||
|
ui.followSymLinks_CB->setChecked(rsFiles->followSymLinks());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DirectoriesPage::setIncomingDirectory()
|
void DirectoriesPage::setIncomingDirectory()
|
||||||
|
@ -6,114 +6,12 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>895</width>
|
<width>929</width>
|
||||||
<height>549</height>
|
<height>549</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<property name="margin">
|
<item>
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
|
||||||
<property name="title">
|
|
||||||
<string>Incoming Directory</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLineEdit" name="incomingDir">
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QPushButton" name="incomingButton">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>31</width>
|
|
||||||
<height>31</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>31</width>
|
|
||||||
<height>31</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Browse</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../images.qrc">
|
|
||||||
<normaloff>:/images/directoryselect_24x24_shadow.png</normaloff>:/images/directoryselect_24x24_shadow.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>24</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
|
||||||
<property name="title">
|
|
||||||
<string>Partials Directory</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLineEdit" name="partialsDir">
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QPushButton" name="partialButton">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>31</width>
|
|
||||||
<height>31</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>31</width>
|
|
||||||
<height>31</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Browse</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../images.qrc">
|
|
||||||
<normaloff>:/images/directoryselect_24x24_shadow.png</normaloff>:/images/directoryselect_24x24_shadow.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>24</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Shared Directories</string>
|
<string>Shared Directories</string>
|
||||||
@ -176,10 +74,119 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="followSymLinks_CB">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Tells Retroshare to follow the links. Loops and duplicate directories are automatically taken care of. If unchecked, Retroshare will just ignore symbolic links to both files and directories.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>follow symbolic links</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
|
<property name="title">
|
||||||
|
<string>Incoming Directory</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLineEdit" name="incomingDir">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QPushButton" name="incomingButton">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>31</width>
|
||||||
|
<height>31</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>31</width>
|
||||||
|
<height>31</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Browse</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../images.qrc">
|
||||||
|
<normaloff>:/images/directoryselect_24x24_shadow.png</normaloff>:/images/directoryselect_24x24_shadow.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>24</width>
|
||||||
|
<height>24</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
|
<property name="title">
|
||||||
|
<string>Partials Directory</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLineEdit" name="partialsDir">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QPushButton" name="partialButton">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>31</width>
|
||||||
|
<height>31</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>31</width>
|
||||||
|
<height>31</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Browse</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../images.qrc">
|
||||||
|
<normaloff>:/images/directoryselect_24x24_shadow.png</normaloff>:/images/directoryselect_24x24_shadow.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>24</width>
|
||||||
|
<height>24</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>741</width>
|
<width>741</width>
|
||||||
<height>372</height>
|
<height>422</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
Loading…
Reference in New Issue
Block a user