diff options
| author | Al <gabriel.cortesi@outlook.com> | 2019-06-01 09:54:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-01 09:54:09 +0200 |
| commit | f00314442b9c3c28e846c64da3c3f776e50656de (patch) | |
| tree | 371f52175eaa83db0b3b354b95d382bd7080ca38 /src/shared | |
| parent | 41f8da011d1df7a368e3fb73f972cee1f4efd0c0 (diff) | |
| parent | d2eb890f2b9df13c402db6adeaafa7e3f4a7d736 (diff) | |
Merge pull request #740 from isanae/new-conflict-list
New conflict list, new "go to" conflict menu item
Diffstat (limited to 'src/shared')
| -rw-r--r-- | src/shared/directoryentry.cpp | 5 | ||||
| -rw-r--r-- | src/shared/directoryentry.h | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp index 1179110a..bde515a9 100644 --- a/src/shared/directoryentry.cpp +++ b/src/shared/directoryentry.cpp @@ -220,6 +220,11 @@ std::vector<FileEntry::Ptr> FilesOrigin::getFiles() const return result;
}
+FileEntry::Ptr FilesOrigin::findFile(FileEntry::Index index) const
+{
+ return m_FileRegister.lock()->getFile(index);
+}
+
bool FilesOrigin::containsArchive(std::wstring archiveName)
{
for (FileEntry::Index fileIdx : m_Files)
diff --git a/src/shared/directoryentry.h b/src/shared/directoryentry.h index 12cef11d..785c3ff6 100644 --- a/src/shared/directoryentry.h +++ b/src/shared/directoryentry.h @@ -49,8 +49,8 @@ class FileEntry { public:
typedef unsigned int Index;
-
typedef boost::shared_ptr<FileEntry> Ptr;
+ typedef std::vector<std::pair<int, std::pair<std::wstring, int>>> AlternativesVector;
public:
@@ -72,7 +72,7 @@ public: // gets the list of alternative origins (origins with lower priority than the primary one).
// if sortOrigins has been called, it is sorted by priority (ascending)
- const std::vector<std::pair<int, std::pair<std::wstring, int>>> &getAlternatives() const { return m_Alternatives; }
+ const AlternativesVector &getAlternatives() const { return m_Alternatives; }
const std::wstring &getName() const { return m_Name; }
int getOrigin() const { return m_Origin; }
@@ -98,7 +98,7 @@ private: std::wstring m_Name;
int m_Origin = -1;
std::pair<std::wstring, int> m_Archive;
- std::vector<std::pair<int, std::pair<std::wstring, int>>> m_Alternatives;
+ AlternativesVector m_Alternatives;
DirectoryEntry *m_Parent;
mutable FILETIME m_FileTime;
@@ -135,6 +135,7 @@ public: const std::wstring &getPath() const { return m_Path; }
std::vector<FileEntry::Ptr> getFiles() const;
+ FileEntry::Ptr findFile(FileEntry::Index index) const;
void enable(bool enabled, time_t notAfter = LONG_MAX);
bool isDisabled() const { return m_Disabled; }
|
