From 5f3dd43893130100e42ac47d32cc21be799b7212 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 21 Feb 2015 13:48:26 +0100 Subject: [PATCH] CmdCompletionContext: Implement the context completion list --- src/commands/CmdContext.cpp | 6 +++++- src/commands/CmdContext.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/CmdContext.cpp b/src/commands/CmdContext.cpp index 9813f0196..55866419b 100644 --- a/src/commands/CmdContext.cpp +++ b/src/commands/CmdContext.cpp @@ -220,7 +220,11 @@ CmdCompletionContext::CmdCompletionContext () //////////////////////////////////////////////////////////////////////////////// int CmdCompletionContext::execute (std::string& output) { - std::vector contexts; + std::vector userContexts = CmdContext::getContexts (); + + std::vector ::iterator userContext; + for (userContext = userContexts.begin (); userContext != userContexts.end (); ++userContext) + output += *userContext + "\n"; return 0; } diff --git a/src/commands/CmdContext.h b/src/commands/CmdContext.h index 41ff887cf..d13745416 100644 --- a/src/commands/CmdContext.h +++ b/src/commands/CmdContext.h @@ -36,7 +36,7 @@ public: CmdContext (); int execute (std::string&); std::string joinWords (std::vector & words, unsigned int from, unsigned int to = 0); - std::vector getContexts (); + static std::vector getContexts (); int defineContext (std::vector & words, std::stringstream& out); int deleteContext (std::vector & words, std::stringstream& out); int listContexts (std::vector & words, std::stringstream& out);