Add CModules::GetModPathInfo()

This function works like GetModInfo(), but takes the full path to the module,
too.

This is used to speed up GetAvailableMods(). Before it created a list of module
paths, extracted the names and then called GetModInfo() on those module names
which looked up the path for the modules again. This extra step is now skipped
and the module's path is used directly.

To make this work, the call to FindModPath() was moved from OpenModule() into
its two callers LoadModule() and GetModInfo().


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1613 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-08-23 14:11:37 +00:00
parent ab9e2dfd33
commit 64b0e392fe
2 changed files with 24 additions and 11 deletions
+2 -1
View File
@@ -462,6 +462,7 @@ public:
bool ReloadModule(const CString& sModule, const CString& sArgs, CUser* pUser, CString& sRetMsg);
bool GetModInfo(CModInfo& ModInfo, const CString& sModule, CString &sRetMsg);
bool GetModPathInfo(CModInfo& ModInfo, const CString& sModule, const CString& sModPath, CString &sRetMsg);
void GetAvailableMods(set<CModInfo>& ssMods, bool bGlobal = false);
// This returns the path to the .so and to the data dir
@@ -474,7 +475,7 @@ public:
static ModDirList GetModDirs();
private:
ModHandle OpenModule(const CString& sModule, CString& sModPath, CString& sDataPath,
ModHandle OpenModule(const CString& sModule, const CString& sModPath,
bool &bVersionMismatch, bool &bIsGlobal, CString& sDesc, CString& sRetMsg);
protected: