aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommands.cc
diff options
context:
space:
mode:
authormathias <mathias>2006-10-30 19:31:15 (GMT)
committermathias <mathias>2006-10-30 19:31:15 (GMT)
commite5e76e7761f52ba7c0deca75bcecae4fbd3e2ff5 (patch)
treec84838a84802805e9b1463045e86200b7cef917f /src/FbCommands.cc
parent426c12c25c2ef095a882619ad7424684b88465b8 (diff)
downloadfluxbox-e5e76e7761f52ba7c0deca75bcecae4fbd3e2ff5.zip
fluxbox-e5e76e7761f52ba7c0deca75bcecae4fbd3e2ff5.tar.bz2
Cosmetic patch from Slava Semushin
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r--src/FbCommands.cc31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index 08f1f93..83025ec 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.cc
@@ -54,7 +54,12 @@
54#include <process.h> // for P_NOWAIT 54#include <process.h> // for P_NOWAIT
55#endif // __EMX__ 55#endif // __EMX__
56 56
57using namespace std; 57using std::string;
58using std::pair;
59using std::set;
60using std::ofstream;
61using std::endl;
62using std::ios;
58 63
59namespace { 64namespace {
60 65
@@ -107,7 +112,7 @@ void showMenu(const BScreen &screen, FbTk::Menu &menu) {
107 112
108namespace FbCommands { 113namespace FbCommands {
109 114
110ExecuteCmd::ExecuteCmd(const std::string &cmd, int screen_num):m_cmd(cmd), m_screen_num(screen_num) { 115ExecuteCmd::ExecuteCmd(const string &cmd, int screen_num):m_cmd(cmd), m_screen_num(screen_num) {
111 116
112} 117}
113 118
@@ -125,7 +130,7 @@ int ExecuteCmd::run() {
125 if (pid) 130 if (pid)
126 return pid; 131 return pid;
127 132
128 std::string displaystring("DISPLAY="); 133 string displaystring("DISPLAY=");
129 displaystring += DisplayString(FbTk::App::instance()->display()); 134 displaystring += DisplayString(FbTk::App::instance()->display());
130 char intbuff[64]; 135 char intbuff[64];
131 int screen_num = m_screen_num; 136 int screen_num = m_screen_num;
@@ -149,7 +154,7 @@ int ExecuteCmd::run() {
149 return pid; // compiler happy -> we are happy ;) 154 return pid; // compiler happy -> we are happy ;)
150} 155}
151 156
152SetModKeyCmd::SetModKeyCmd(const std::string& modkey) : m_modkey(modkey) { } 157SetModKeyCmd::SetModKeyCmd(const string& modkey) : m_modkey(modkey) { }
153 158
154void SetModKeyCmd::execute() { 159void SetModKeyCmd::execute() {
155 Fluxbox::instance()->setModKey(m_modkey.c_str()); 160 Fluxbox::instance()->setModKey(m_modkey.c_str());
@@ -158,7 +163,7 @@ void SetModKeyCmd::execute() {
158 Fluxbox::instance()->reconfigure(); 163 Fluxbox::instance()->reconfigure();
159} 164}
160 165
161ExportCmd::ExportCmd(const std::string& name, const std::string& value) : 166ExportCmd::ExportCmd(const string& name, const string& value) :
162 m_name(name), m_value(value) { 167 m_name(name), m_value(value) {
163} 168}
164 169
@@ -167,7 +172,7 @@ void ExportCmd::execute() {
167 // the setenv()-routine is not everywhere available and 172 // the setenv()-routine is not everywhere available and
168 // putenv() doesnt manage the strings in the environment 173 // putenv() doesnt manage the strings in the environment
169 // and hence we have to do that on our own to avoid memleaking 174 // and hence we have to do that on our own to avoid memleaking
170 static std::set<char*> stored; 175 static set<char*> stored;
171 char* newenv = new char[m_name.size() + m_value.size() + 2]; 176 char* newenv = new char[m_name.size() + m_value.size() + 2];
172 if (newenv) { 177 if (newenv) {
173 178
@@ -203,7 +208,7 @@ void SaveResources::execute() {
203 Fluxbox::instance()->save_rc(); 208 Fluxbox::instance()->save_rc();
204} 209}
205 210
206RestartFluxboxCmd::RestartFluxboxCmd(const std::string &cmd):m_cmd(cmd){ 211RestartFluxboxCmd::RestartFluxboxCmd(const string &cmd):m_cmd(cmd){
207} 212}
208 213
209void RestartFluxboxCmd::execute() { 214void RestartFluxboxCmd::execute() {
@@ -223,7 +228,7 @@ void ReloadStyleCmd::execute() {
223 cmd.execute(); 228 cmd.execute();
224} 229}
225 230
226SetStyleCmd::SetStyleCmd(const std::string &filename):m_filename(filename) { 231SetStyleCmd::SetStyleCmd(const string &filename):m_filename(filename) {
227 232
228} 233}
229 234
@@ -234,7 +239,7 @@ void SetStyleCmd::execute() {
234 Fluxbox::instance()->getStyleOverlayFilename()); 239 Fluxbox::instance()->getStyleOverlayFilename());
235} 240}
236 241
237KeyModeCmd::KeyModeCmd(const std::string &arguments):m_keymode(arguments),m_end_args("None Escape") { 242KeyModeCmd::KeyModeCmd(const string &arguments):m_keymode(arguments),m_end_args("None Escape") {
238 string::size_type second_pos = m_keymode.find_first_of(" \t", 0); 243 string::size_type second_pos = m_keymode.find_first_of(" \t", 0);
239 if (second_pos != string::npos) { 244 if (second_pos != string::npos) {
240 // ok we have arguments, parsing them here 245 // ok we have arguments, parsing them here
@@ -267,7 +272,7 @@ void ShowWorkspaceMenuCmd::execute() {
267 272
268 273
269 274
270SetWorkspaceNameCmd::SetWorkspaceNameCmd(const std::string &name, int spaceid): 275SetWorkspaceNameCmd::SetWorkspaceNameCmd(const string &name, int spaceid):
271 m_name(name), m_workspace(spaceid) { } 276 m_name(name), m_workspace(spaceid) { }
272 277
273void SetWorkspaceNameCmd::execute() { 278void SetWorkspaceNameCmd::execute() {
@@ -312,8 +317,8 @@ void CommandDialogCmd::execute() {
312} 317}
313 318
314 319
315SetResourceValueCmd::SetResourceValueCmd(const std::string &resname, 320SetResourceValueCmd::SetResourceValueCmd(const string &resname,
316 const std::string &value): 321 const string &value):
317 m_resname(resname), 322 m_resname(resname),
318 m_value(value) { 323 m_value(value) {
319 324
@@ -336,7 +341,7 @@ void SetResourceValueDialogCmd::execute() {
336 win->show(); 341 win->show();
337}; 342};
338 343
339BindKeyCmd::BindKeyCmd(const std::string &keybind):m_keybind(keybind) { } 344BindKeyCmd::BindKeyCmd(const string &keybind):m_keybind(keybind) { }
340 345
341void BindKeyCmd::execute() { 346void BindKeyCmd::execute() {
342 if (Fluxbox::instance()->keys() != 0) { 347 if (Fluxbox::instance()->keys() != 0) {