all repos — fluxbox @ 007fb25e821c0ea8fb6419626464a8d9d79aa9b2

custom fork of the fluxbox windowmanager

more namespace corrections (doh)
rathnor rathnor
commit

007fb25e821c0ea8fb6419626464a8d9d79aa9b2

parent

9fa14bd5ffb7caac30232e9014ccc114424c678e

1 files changed, 18 insertions(+), 16 deletions(-)

jump to
M src/Remember.ccsrc/Remember.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: Remember.cc,v 1.2 2003/04/26 11:24:55 rathnor Exp $ +// $Id: Remember.cc,v 1.3 2003/04/26 12:01:55 rathnor Exp $ #include "Remember.hh" #include "StringUtil.hh"

@@ -46,6 +46,8 @@

#ifndef MAXPATHLEN #define MAXPATHLEN 255 #endif // MAXPATHLEN + +using namespace std; namespace {

@@ -155,7 +157,7 @@ if (XGetClassHint(FbTk::App::instance()->display(), w, &ch) == 0) {

cerr<<"Failed to read class hint!"<<endl; return 0; } else { - std::string m_class_name; + string m_class_name; if (ch.res_name != 0) { //m_instance_name = const_cast<char *>(ch.res_name); XFree(ch.res_name);

@@ -192,15 +194,15 @@ else

return NULL; } -int Remember::parseApp(std::ifstream &file, Application *a) { - std::string line; +int Remember::parseApp(ifstream &file, Application *a) { + string line; int row = 0; while (! file.eof()) { if (getline(file, line)) { row++; if (line[0] != '#') { //the line is commented int parse_pos = 0, err = 0; - std::string str_key, str_label; + string str_key, str_label; err = StringUtil::getStringBetween(str_key, line.c_str(), '[', ']'); if (err > 0 ) { parse_pos += err;

@@ -214,17 +216,17 @@ if (!str_key.size())

continue; //read next line if (str_key == "Workspace") { unsigned int w; - std::istringstream iss(str_label.c_str()); + istringstream iss(str_label.c_str()); iss >> w; a->rememberWorkspace(w); } else if (str_key == "Dimensions") { unsigned int h,w; - std::istringstream iss(str_label.c_str()); + istringstream iss(str_label.c_str()); iss >> w >> h; a->rememberDimensions(w,h); } else if (str_key == "Position") { unsigned int x,y; - std::istringstream iss(str_label); + istringstream iss(str_label); iss >> x >> y; a->rememberPosition(x,y); } else if (str_key == "Shaded") {

@@ -251,7 +253,7 @@ } else {

unsigned int mask; const char * str = str_label.c_str(); // it'll have at least one char and \0, so this is safe - std::istringstream iss(str); + istringstream iss(str); // check for hex if (str[0] == '0' && str[1] == 'x') { iss.seekg(2);

@@ -281,23 +283,23 @@ void Remember::load() {

#ifdef DEBUG cerr << "Loading apps file..." << endl; #endif // DEBUG - std::string apps_string = getenv("HOME")+std::string("/.")+RC_PATH+std::string("/")+"apps"; - std::ifstream apps_file(apps_string.c_str()); + string apps_string = getenv("HOME")+string("/.")+RC_PATH+string("/")+"apps"; + ifstream apps_file(apps_string.c_str()); if (!apps_file.fail()) { if (!apps_file.eof()) { - std::string line; + string line; int row = 0; while (getline(apps_file, line) && ! apps_file.eof()) { row++; if (line[0] == '#') continue; - std::string key; + string key; int pos=0; int err = StringUtil::getStringBetween(key, line.c_str(), '[', ']'); if (err >0 && key == "app") { pos += err; - std::string label; + string label; err = StringUtil::getStringBetween(label, line.c_str()+pos, '(', ')'); if (err>0) { Application *a;

@@ -328,8 +330,8 @@ void Remember::save() {

#ifdef DEBUG cerr << "Saving apps file..." << endl; #endif // DEBUG - std::string apps_string = getenv("HOME")+std::string("/.")+RC_PATH+std::string("/")+"apps"; - std::ofstream apps_file(apps_string.c_str()); + string apps_string = getenv("HOME")+string("/.")+RC_PATH+string("/")+"apps"; + ofstream apps_file(apps_string.c_str()); Apps::iterator it = apps.begin(); Apps::iterator it_end = apps.end(); for (; it != it_end; ++it) {