File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,8 @@ void ProjectServiceHandler::getRootFiles(std::vector<FileInfo>& return_)
124124 return_.push_back (makeFileInfo (f));
125125 }
126126 });
127+
128+ std::sort (return_.begin (), return_.end (), fileInfoOrder);
127129}
128130
129131void ProjectServiceHandler::getChildFiles (
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ class WorkspaceServiceHandler : virtual public WorkspaceServiceIf
1818 void getWorkspaces (std::vector<WorkspaceInfo>& _return) override ;
1919
2020private:
21+ /* *
22+ * This function defines an ordering between WorkspaceInfo objects by name.
23+ */
24+ static bool workspaceInfoOrder (const WorkspaceInfo& left, const WorkspaceInfo& right);
25+
2126 std::string _workspace;
2227};
2328
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ WorkspaceServiceHandler::WorkspaceServiceHandler(const std::string& workspace_)
1313{
1414}
1515
16- void WorkspaceServiceHandler::getWorkspaces (std::vector<WorkspaceInfo>& _return )
16+ void WorkspaceServiceHandler::getWorkspaces (std::vector<WorkspaceInfo>& return_ )
1717{
1818 namespace fs = boost::filesystem;
1919
@@ -35,8 +35,17 @@ void WorkspaceServiceHandler::getWorkspaces(std::vector<WorkspaceInfo>& _return)
3535 info.id = filename;
3636 info.description = filename;
3737
38- _return .push_back (std::move (info));
38+ return_ .push_back (std::move (info));
3939 }
40+
41+ std::sort (return_.begin (), return_.end (), workspaceInfoOrder);
42+ }
43+
44+ bool WorkspaceServiceHandler::workspaceInfoOrder (
45+ const WorkspaceInfo& left_,
46+ const WorkspaceInfo& right_)
47+ {
48+ return left_.id < right_.id ;
4049}
4150
4251} // workspace
You can’t perform that action at this time.
0 commit comments