aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-07-01 01:49:13 (GMT)
committerrathnor <rathnor>2003-07-01 01:49:13 (GMT)
commit015c61ede0661fe4e563052b4d8418ac6223e843 (patch)
treeb5c5051cf3bd594ebbb9bb977ff09af308ea9b00
parent17665c37f7a19cf21526bc1ff1654d26446956a2 (diff)
downloadfluxbox_paul-015c61ede0661fe4e563052b4d8418ac6223e843.zip
fluxbox_paul-015c61ede0661fe4e563052b4d8418ac6223e843.tar.bz2
make it work... (fix some small issues)
-rw-r--r--src/CommandParser.cc4
-rw-r--r--src/FbCommandFactory.cc6
-rw-r--r--src/FbTk/StringUtil.cc9
-rw-r--r--src/FbTk/StringUtil.hh4
4 files changed, 16 insertions, 7 deletions
diff --git a/src/CommandParser.cc b/src/CommandParser.cc
index dc2f297..1355cf9 100644
--- a/src/CommandParser.cc
+++ b/src/CommandParser.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: CommandParser.cc,v 1.1 2003/06/30 14:44:43 fluxgen Exp $ 23// $Id: CommandParser.cc,v 1.2 2003/07/01 01:49:09 rathnor Exp $
24 24
25#include "CommandParser.hh" 25#include "CommandParser.hh"
26 26
@@ -79,7 +79,7 @@ FbTk::Command *CommandParser::parseLine(const std::string &line) {
79 command<<"] arguments=["<<arguments<<"]"<<endl; 79 command<<"] arguments=["<<arguments<<"]"<<endl;
80#endif // DEBUG 80#endif // DEBUG
81 81
82 FbTk::StringUtil::toLower(command); 82 command = FbTk::StringUtil::toLower(command);
83 83
84 // we didn't find any matching command in default commands, 84 // we didn't find any matching command in default commands,
85 // so we search in the command creators modules for a matching command string 85 // so we search in the command creators modules for a matching command string
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc
index 8e26918..097c3cd 100644
--- a/src/FbCommandFactory.cc
+++ b/src/FbCommandFactory.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: FbCommandFactory.cc,v 1.5 2003/06/30 22:21:33 fluxgen Exp $ 23// $Id: FbCommandFactory.cc,v 1.6 2003/07/01 01:49:09 rathnor Exp $
24 24
25#include "FbCommandFactory.hh" 25#include "FbCommandFactory.hh"
26 26
@@ -153,10 +153,10 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
153 else if (command == "prevworkspace" && arguments.size() == 0) 153 else if (command == "prevworkspace" && arguments.size() == 0)
154 return new PrevWorkspaceCmd(); 154 return new PrevWorkspaceCmd();
155 else if (command == "workspace") { 155 else if (command == "workspace") {
156 int num = 0; 156 int num = 1; // workspaces appear 1-indexed to the user
157 if (!arguments.empty()) 157 if (!arguments.empty())
158 num = atoi(arguments.c_str()); 158 num = atoi(arguments.c_str());
159 return new JumpToWorkspaceCmd(num); 159 return new JumpToWorkspaceCmd(num-1);
160 } else if (command == "nextwindow") 160 } else if (command == "nextwindow")
161 return new NextWindowCmd(atoi(arguments.c_str())); 161 return new NextWindowCmd(atoi(arguments.c_str()));
162 else if (command == "prevwindow") 162 else if (command == "prevwindow")
diff --git a/src/FbTk/StringUtil.cc b/src/FbTk/StringUtil.cc
index 5d6c742..761014f 100644
--- a/src/FbTk/StringUtil.cc
+++ b/src/FbTk/StringUtil.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: StringUtil.cc,v 1.2 2003/06/12 15:14:02 rathnor Exp $ 22// $Id: StringUtil.cc,v 1.3 2003/07/01 01:49:13 rathnor Exp $
23 23
24#include "StringUtil.hh" 24#include "StringUtil.hh"
25 25
@@ -152,6 +152,13 @@ void toLower(char * const conv) {
152 conv[byte_pos] = tolower(conv[byte_pos]); 152 conv[byte_pos] = tolower(conv[byte_pos]);
153} 153}
154 154
155std::string toLower(const std::string &conv) {
156 char ret_str[conv.size()+1];
157 ::strcpy(ret_str, conv.c_str());
158 toLower(ret_str);
159 return ret_str;
160}
161
155}; // end namespace StringUtil 162}; // end namespace StringUtil
156 163
157}; // end namespace FbTk 164}; // end namespace FbTk
diff --git a/src/FbTk/StringUtil.hh b/src/FbTk/StringUtil.hh
index b193d66..1439308 100644
--- a/src/FbTk/StringUtil.hh
+++ b/src/FbTk/StringUtil.hh
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22//$Id: StringUtil.hh,v 1.2 2003/06/12 15:14:03 rathnor Exp $ 22//$Id: StringUtil.hh,v 1.3 2003/07/01 01:49:13 rathnor Exp $
23 23
24#ifndef FBTK_STRINGUTIL_HH 24#ifndef FBTK_STRINGUTIL_HH
25#define FBTK_STRINGUTIL_HH 25#define FBTK_STRINGUTIL_HH
@@ -46,6 +46,8 @@ int getStringBetween(std::string& out, const char *instr,
46/// converts a string to lover case 46/// converts a string to lover case
47void toLower(char * const conv); 47void toLower(char * const conv);
48 48
49std::string toLower(const std::string &conv);
50
49 51
50/// Breaks a string into tokens 52/// Breaks a string into tokens
51template <typename Container> 53template <typename Container>