From 14ac234daf1680b0685f6bea3e74aa09dfcf38ef Mon Sep 17 00:00:00 2001 From: Tannin Date: Sat, 14 Dec 2013 13:23:13 +0100 Subject: - plugin list now highlights plugins with attached ini files - bugfix: opening nexus through the globe icon used the nmm.nexusmods.com url --- src/shared/directoryentry.cpp | 4 ++-- src/shared/directoryentry.h | 9 ++++----- src/shared/util.cpp | 3 --- 3 files changed, 6 insertions(+), 10 deletions(-) (limited to 'src/shared') diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp index 685e14a9..a232ea19 100644 --- a/src/shared/directoryentry.cpp +++ b/src/shared/directoryentry.cpp @@ -759,7 +759,7 @@ DirectoryEntry *DirectoryEntry::findSubDirectoryRecursive(const std::wstring &pa } -const FileEntry::Ptr DirectoryEntry::findFile(const std::wstring &name) +const FileEntry::Ptr DirectoryEntry::findFile(const std::wstring &name) const { auto iter = m_Files.find(name); if (iter != m_Files.end()) { @@ -840,7 +840,7 @@ FileEntry::Ptr FileRegister::createFile(const std::wstring &name, DirectoryEntry } -FileEntry::Ptr FileRegister::getFile(FileEntry::Index index) +FileEntry::Ptr FileRegister::getFile(FileEntry::Index index) const { auto iter = m_Files.find(index); if (iter != m_Files.end()) { diff --git a/src/shared/directoryentry.h b/src/shared/directoryentry.h index 1ad9816c..22f00a74 100644 --- a/src/shared/directoryentry.h +++ b/src/shared/directoryentry.h @@ -168,7 +168,7 @@ public: bool indexValid(FileEntry::Index index) const; FileEntry::Ptr createFile(const std::wstring &name, DirectoryEntry *parent); - FileEntry::Ptr getFile(FileEntry::Index index); + FileEntry::Ptr getFile(FileEntry::Index index) const; void removeFile(FileEntry::Index index); void removeOrigin(FileEntry::Index index, int originID); @@ -233,11 +233,10 @@ public: * @param name name of the file * @return fileentry object for the file or NULL if no file matches */ - const FileEntry::Ptr findFile(const std::wstring &name); + const FileEntry::Ptr findFile(const std::wstring &name) const; - /** search through this directory and all subdirectories for a file by the specified name. - if directory is not NULL, the referenced variable will be set to true if the path refers to a directory. - the returned pointer is NULL in that case */ + /** search through this directory and all subdirectories for a file by the specified name (relative path). + if directory is not NULL, the referenced variable will be set to the path containing the file */ const FileEntry::Ptr searchFile(const std::wstring &path, const DirectoryEntry **directory) const; void insertFile(const std::wstring &filePath, FilesOrigin &origin, FILETIME fileTime); diff --git a/src/shared/util.cpp b/src/shared/util.cpp index 4378e03c..22657e6c 100644 --- a/src/shared/util.cpp +++ b/src/shared/util.cpp @@ -69,7 +69,6 @@ std::string ToString(const std::wstring &source, bool utf8) ::WideCharToMultiByte(CP_UTF8, 0, source.c_str(), -1, buffer, MAX_PATH, NULL, NULL); } else { ::WideCharToMultiByte(GetACP(), 0, source.c_str(), -1, buffer, MAX_PATH, NULL, NULL); -// wcstombs(buffer, source.c_str(), MAX_PATH); } return std::string(buffer); } @@ -80,9 +79,7 @@ std::wstring ToWString(const std::string &source, bool utf8) if (utf8) { ::MultiByteToWideChar(CP_UTF8, 0, source.c_str(), -1, buffer, MAX_PATH); } else { - // codepage encoding ::MultiByteToWideChar(GetACP(), 0, source.c_str(), -1, buffer, MAX_PATH); -// mbstowcs(buffer, source.c_str(), MAX_PATH); } return std::wstring(buffer); } -- cgit v1.3.1