make it work... (fix some small issues)
rathnor rathnor
4 files changed,
16 insertions(+),
7 deletions(-)
M
src/CommandParser.cc
→
src/CommandParser.cc
@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: CommandParser.cc,v 1.1 2003/06/30 14:44:43 fluxgen Exp $ +// $Id: CommandParser.cc,v 1.2 2003/07/01 01:49:09 rathnor Exp $ #include "CommandParser.hh"@@ -79,7 +79,7 @@ cerr<<__FILE__<<"("<<__FUNCTION__<<"): command = ["<<
command<<"] arguments=["<<arguments<<"]"<<endl; #endif // DEBUG - FbTk::StringUtil::toLower(command); + command = FbTk::StringUtil::toLower(command); // we didn't find any matching command in default commands, // so we search in the command creators modules for a matching command string
M
src/FbCommandFactory.cc
→
src/FbCommandFactory.cc
@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommandFactory.cc,v 1.5 2003/06/30 22:21:33 fluxgen Exp $ +// $Id: FbCommandFactory.cc,v 1.6 2003/07/01 01:49:09 rathnor Exp $ #include "FbCommandFactory.hh"@@ -153,10 +153,10 @@ return new NextWorkspaceCmd();
else if (command == "prevworkspace" && arguments.size() == 0) return new PrevWorkspaceCmd(); else if (command == "workspace") { - int num = 0; + int num = 1; // workspaces appear 1-indexed to the user if (!arguments.empty()) num = atoi(arguments.c_str()); - return new JumpToWorkspaceCmd(num); + return new JumpToWorkspaceCmd(num-1); } else if (command == "nextwindow") return new NextWindowCmd(atoi(arguments.c_str())); else if (command == "prevwindow")
M
src/FbTk/StringUtil.cc
→
src/FbTk/StringUtil.cc
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: StringUtil.cc,v 1.2 2003/06/12 15:14:02 rathnor Exp $ +// $Id: StringUtil.cc,v 1.3 2003/07/01 01:49:13 rathnor Exp $ #include "StringUtil.hh"@@ -150,6 +150,13 @@
void toLower(char * const conv) { for (size_t byte_pos = 0; byte_pos < strlen(conv); ++byte_pos) conv[byte_pos] = tolower(conv[byte_pos]); +} + +std::string toLower(const std::string &conv) { + char ret_str[conv.size()+1]; + ::strcpy(ret_str, conv.c_str()); + toLower(ret_str); + return ret_str; } }; // end namespace StringUtil
M
src/FbTk/StringUtil.hh
→
src/FbTk/StringUtil.hh
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -//$Id: StringUtil.hh,v 1.2 2003/06/12 15:14:03 rathnor Exp $ +//$Id: StringUtil.hh,v 1.3 2003/07/01 01:49:13 rathnor Exp $ #ifndef FBTK_STRINGUTIL_HH #define FBTK_STRINGUTIL_HH@@ -45,6 +45,8 @@ const char *ok_chars=" \t\n", bool allow_nesting = false);
/// converts a string to lover case void toLower(char * const conv); + +std::string toLower(const std::string &conv); /// Breaks a string into tokens