From 957d48b5fc4c68b9239eb6accb60ade28bbc1ec9 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 9 Oct 2016 21:03:01 +0200 Subject: [PATCH] removed folderIterator::d_name() because it duplicates file_name() --- libretroshare/src/plugins/pluginmanager.cc | 3 +-- libretroshare/src/rsserver/rsaccounts.cc | 3 +-- libretroshare/src/util/folderiterator.cc | 21 +-------------------- libretroshare/src/util/folderiterator.h | 2 -- retroshare-nogui/src/introserver.cc | 3 +-- 5 files changed, 4 insertions(+), 28 deletions(-) diff --git a/libretroshare/src/plugins/pluginmanager.cc b/libretroshare/src/plugins/pluginmanager.cc index 98335ea5a..19980c812 100644 --- a/libretroshare/src/plugins/pluginmanager.cc +++ b/libretroshare/src/plugins/pluginmanager.cc @@ -147,8 +147,7 @@ void RsPluginManager::loadPlugins(const std::vector& plugin_directo for(;dirIt.isValid();dirIt.next()) { - std::string fname; - dirIt.d_name(fname); + std::string fname = dirIt.file_name(); char lc = plugin_directories[i][plugin_directories[i].length()-1] ; // length cannot be 0 here. diff --git a/libretroshare/src/rsserver/rsaccounts.cc b/libretroshare/src/rsserver/rsaccounts.cc index 9bb8b49ed..c55fadd53 100644 --- a/libretroshare/src/rsserver/rsaccounts.cc +++ b/libretroshare/src/rsserver/rsaccounts.cc @@ -536,8 +536,7 @@ bool RsAccountsDetail::getAvailableAccounts(std::map & for(;dirIt.isValid();dirIt.next()) { /* check entry type */ - std::string fname; - dirIt.d_name(fname); + std::string fname = dirIt.file_name(); std::string fullname = mBaseDirectory + "/" + fname; #ifdef FIM_DEBUG std::cerr << "calling stats on " << fullname <d_name ; if(mFileName == "." || mFileName == "..") continue ; @@ -145,25 +145,6 @@ bool FolderIterator::readdir() #endif } -bool FolderIterator::d_name(std::string& dest) -{ - if(!validity) - return false; - -#ifdef WINDOWS_SYS - if(! ConvertUtf16ToUtf8(fileInfo.cFileName, dest)) { - validity = false; - return false; - } -#else - if(ent == 0) - return false; - dest = ent->d_name; -#endif - - return true; -} - time_t FolderIterator::dir_modtime() const { return mFolderModTime ; } const std::string& FolderIterator::file_fullpath() { return mFullPath ; } diff --git a/libretroshare/src/util/folderiterator.h b/libretroshare/src/util/folderiterator.h index 21ebacd06..f31e555f8 100644 --- a/libretroshare/src/util/folderiterator.h +++ b/libretroshare/src/util/folderiterator.h @@ -39,8 +39,6 @@ public: bool readdir(); void next(); -#warning this one should go, as it reports the same information than file_name() - bool d_name(std::string& dest); bool closedir(); const std::string& file_name() ; diff --git a/retroshare-nogui/src/introserver.cc b/retroshare-nogui/src/introserver.cc index 3734154b2..bc373c2da 100644 --- a/retroshare-nogui/src/introserver.cc +++ b/retroshare-nogui/src/introserver.cc @@ -293,8 +293,7 @@ int RsIntroServer::checkForNewCerts() for(;dirIt.isValid();dirIt.next()) { /* check entry type */ - std::string fname; - dirIt.d_name(fname); + std::string fname = dirIt.file_name(); std::string fullname = mCertLoadPath + "/" + fname; #ifdef RSIS_DEBUG std::cerr << "calling stats on " << fullname <