Skip to content

Commit a6800a8

Browse files
authored
Merge pull request #4512 from TrenchBroom/4511
4511: Return a copy of recent documents for safety
2 parents e112975 + c8d78e3 commit a6800a8

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

common/src/TrenchBroomApp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ void TrenchBroomApp::loadStyle()
334334
}
335335
}
336336

337-
const std::vector<std::filesystem::path>& TrenchBroomApp::recentDocuments() const
337+
std::vector<std::filesystem::path> TrenchBroomApp::recentDocuments() const
338338
{
339339
return m_recentDocuments->recentDocuments();
340340
}

common/src/TrenchBroomApp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class TrenchBroomApp : public QApplication
6969
void loadStyle();
7070

7171
public:
72-
const std::vector<std::filesystem::path>& recentDocuments() const;
72+
std::vector<std::filesystem::path> recentDocuments() const;
7373
void addRecentDocumentMenu(QMenu& menu);
7474
void removeRecentDocumentMenu(QMenu& menu);
7575
void updateRecentDocument(const std::filesystem::path& path);

common/src/View/RecentDocuments.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ RecentDocuments::RecentDocuments(
7878
assert(m_maxSize > 0);
7979
}
8080

81-
const std::vector<std::filesystem::path>& RecentDocuments::recentDocuments() const
81+
std::vector<std::filesystem::path> RecentDocuments::recentDocuments() const
8282
{
8383
return m_filteredDocuments;
8484
}

common/src/View/RecentDocuments.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class RecentDocuments : public QObject
5252
std::function<bool(std::filesystem::path)> filterPredicate,
5353
QObject* parent = nullptr);
5454

55-
const std::vector<std::filesystem::path>& recentDocuments() const;
55+
std::vector<std::filesystem::path> recentDocuments() const;
5656

5757
void reload();
5858

0 commit comments

Comments
 (0)