Skip to content

Commit

Permalink
Merge pull request #4512 from TrenchBroom/4511
Browse files Browse the repository at this point in the history
4511: Return a copy of recent documents for safety
  • Loading branch information
kduske authored Mar 3, 2024
2 parents e112975 + c8d78e3 commit a6800a8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common/src/TrenchBroomApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ void TrenchBroomApp::loadStyle()
}
}

const std::vector<std::filesystem::path>& TrenchBroomApp::recentDocuments() const
std::vector<std::filesystem::path> TrenchBroomApp::recentDocuments() const
{
return m_recentDocuments->recentDocuments();
}
Expand Down
2 changes: 1 addition & 1 deletion common/src/TrenchBroomApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class TrenchBroomApp : public QApplication
void loadStyle();

public:
const std::vector<std::filesystem::path>& recentDocuments() const;
std::vector<std::filesystem::path> recentDocuments() const;
void addRecentDocumentMenu(QMenu& menu);
void removeRecentDocumentMenu(QMenu& menu);
void updateRecentDocument(const std::filesystem::path& path);
Expand Down
2 changes: 1 addition & 1 deletion common/src/View/RecentDocuments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ RecentDocuments::RecentDocuments(
assert(m_maxSize > 0);
}

const std::vector<std::filesystem::path>& RecentDocuments::recentDocuments() const
std::vector<std::filesystem::path> RecentDocuments::recentDocuments() const
{
return m_filteredDocuments;
}
Expand Down
2 changes: 1 addition & 1 deletion common/src/View/RecentDocuments.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class RecentDocuments : public QObject
std::function<bool(std::filesystem::path)> filterPredicate,
QObject* parent = nullptr);

const std::vector<std::filesystem::path>& recentDocuments() const;
std::vector<std::filesystem::path> recentDocuments() const;

void reload();

Expand Down

0 comments on commit a6800a8

Please sign in to comment.