diff options
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r-- | src/fluxbox.cc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 1ee43a1..8a12688 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: fluxbox.cc,v 1.227 2004/01/19 18:33:05 fluxgen Exp $ | 25 | // $Id: fluxbox.cc,v 1.228 2004/01/21 13:33:50 fluxgen Exp $ |
26 | 26 | ||
27 | #include "fluxbox.hh" | 27 | #include "fluxbox.hh" |
28 | 28 | ||
@@ -508,8 +508,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile | |||
508 | char scrname[128], altscrname[128]; | 508 | char scrname[128], altscrname[128]; |
509 | sprintf(scrname, "session.screen%d", i); | 509 | sprintf(scrname, "session.screen%d", i); |
510 | sprintf(altscrname, "session.Screen%d", i); | 510 | sprintf(altscrname, "session.Screen%d", i); |
511 | BScreen *screen = new BScreen(m_screen_rm.lock(), | 511 | BScreen *screen = new BScreen(m_screen_rm.lock(), |
512 | |||
513 | scrname, altscrname, | 512 | scrname, altscrname, |
514 | i, getNumberOfLayers()); | 513 | i, getNumberOfLayers()); |
515 | if (! screen->isScreenManaged()) { | 514 | if (! screen->isScreenManaged()) { |
@@ -563,7 +562,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile | |||
563 | 562 | ||
564 | m_keyscreen = m_mousescreen = m_screen_list.front(); | 563 | m_keyscreen = m_mousescreen = m_screen_list.front(); |
565 | 564 | ||
566 | if (m_screen_list.size() == 0) { | 565 | if (m_screen_list.empty()) { |
567 | //!! TODO: NLS | 566 | //!! TODO: NLS |
568 | throw string("Couldn't find screens to manage.\n" | 567 | throw string("Couldn't find screens to manage.\n" |
569 | "Make sure you don't have another window manager running."); | 568 | "Make sure you don't have another window manager running."); |
@@ -1544,7 +1543,7 @@ void Fluxbox::save_rc() { | |||
1544 | 1543 | ||
1545 | string dbfile(getRcFilename()); | 1544 | string dbfile(getRcFilename()); |
1546 | 1545 | ||
1547 | if (dbfile.size() != 0) { | 1546 | if (!dbfile.empty()) { |
1548 | m_resourcemanager.save(dbfile.c_str(), dbfile.c_str()); | 1547 | m_resourcemanager.save(dbfile.c_str(), dbfile.c_str()); |
1549 | m_screen_rm.save(dbfile.c_str(), dbfile.c_str()); | 1548 | m_screen_rm.save(dbfile.c_str(), dbfile.c_str()); |
1550 | } else | 1549 | } else |
@@ -1593,7 +1592,7 @@ void Fluxbox::save_rc() { | |||
1593 | /// @return filename of resource file | 1592 | /// @return filename of resource file |
1594 | string Fluxbox::getRcFilename() { | 1593 | string Fluxbox::getRcFilename() { |
1595 | 1594 | ||
1596 | if (m_rc_file.size() == 0) { // set default filename | 1595 | if (m_rc_file.empty()) { // set default filename |
1597 | string defaultfile(getenv("HOME") + string("/.") + m_RC_PATH + string("/") + m_RC_INIT_FILE); | 1596 | string defaultfile(getenv("HOME") + string("/.") + m_RC_PATH + string("/") + m_RC_INIT_FILE); |
1598 | return defaultfile; | 1597 | return defaultfile; |
1599 | } | 1598 | } |
@@ -1612,7 +1611,7 @@ void Fluxbox::load_rc() { | |||
1612 | //get resource filename | 1611 | //get resource filename |
1613 | string dbfile(getRcFilename()); | 1612 | string dbfile(getRcFilename()); |
1614 | 1613 | ||
1615 | if (dbfile.size() != 0) { | 1614 | if (!dbfile.empty()) { |
1616 | if (!m_resourcemanager.load(dbfile.c_str())) { | 1615 | if (!m_resourcemanager.load(dbfile.c_str())) { |
1617 | cerr<<"Failed to load database:"<<dbfile<<endl; | 1616 | cerr<<"Failed to load database:"<<dbfile<<endl; |
1618 | cerr<<"Trying with: "<<DEFAULT_INITFILE<<endl; | 1617 | cerr<<"Trying with: "<<DEFAULT_INITFILE<<endl; |
@@ -1624,10 +1623,10 @@ void Fluxbox::load_rc() { | |||
1624 | cerr<<"Failed to load database: "<<DEFAULT_INITFILE<<endl; | 1623 | cerr<<"Failed to load database: "<<DEFAULT_INITFILE<<endl; |
1625 | } | 1624 | } |
1626 | 1625 | ||
1627 | if (m_rc_menufile->size() == 0) | 1626 | if (m_rc_menufile->empty()) |
1628 | m_rc_menufile.setDefaultValue(); | 1627 | m_rc_menufile.setDefaultValue(); |
1629 | 1628 | ||
1630 | if (m_rc_slitlistfile->size() != 0) { | 1629 | if (!m_rc_slitlistfile->empty()) { |
1631 | *m_rc_slitlistfile = StringUtil::expandFilename(*m_rc_slitlistfile); | 1630 | *m_rc_slitlistfile = StringUtil::expandFilename(*m_rc_slitlistfile); |
1632 | } else { | 1631 | } else { |
1633 | string filename; | 1632 | string filename; |
@@ -1640,7 +1639,7 @@ void Fluxbox::load_rc() { | |||
1640 | else if (*m_rc_colors_per_channel > 6) | 1639 | else if (*m_rc_colors_per_channel > 6) |
1641 | *m_rc_colors_per_channel = 6; | 1640 | *m_rc_colors_per_channel = 6; |
1642 | 1641 | ||
1643 | if (m_rc_stylefile->size() == 0) | 1642 | if (m_rc_stylefile->empty()) |
1644 | *m_rc_stylefile = DEFAULTSTYLE; | 1643 | *m_rc_stylefile = DEFAULTSTYLE; |
1645 | else // expand tilde | 1644 | else // expand tilde |
1646 | *m_rc_stylefile = StringUtil::expandFilename(*m_rc_stylefile); | 1645 | *m_rc_stylefile = StringUtil::expandFilename(*m_rc_stylefile); |
@@ -1711,7 +1710,7 @@ void Fluxbox::load_rc(BScreen &screen) { | |||
1711 | FbTk::Image::addSearchPath(paths[i]); | 1710 | FbTk::Image::addSearchPath(paths[i]); |
1712 | } | 1711 | } |
1713 | 1712 | ||
1714 | if (dbfile.size() != 0) { | 1713 | if (!dbfile.empty()) { |
1715 | if (!m_screen_rm.load(dbfile.c_str())) { | 1714 | if (!m_screen_rm.load(dbfile.c_str())) { |
1716 | cerr<<"Failed to load database:"<<dbfile<<endl; | 1715 | cerr<<"Failed to load database:"<<dbfile<<endl; |
1717 | cerr<<"Trying with: "<<DEFAULT_INITFILE<<endl; | 1716 | cerr<<"Trying with: "<<DEFAULT_INITFILE<<endl; |
@@ -1948,7 +1947,7 @@ void Fluxbox::setFocusedWindow(WinClient *client) { | |||
1948 | 1947 | ||
1949 | if (screen != 0) { | 1948 | if (screen != 0) { |
1950 | screen->updateNetizenWindowFocus(); | 1949 | screen->updateNetizenWindowFocus(); |
1951 | for (int i=0; i < m_atomhandler.size(); ++i) { | 1950 | for (size_t i=0; i < m_atomhandler.size(); ++i) { |
1952 | 1951 | ||
1953 | m_atomhandler[i]->updateFocusedWindow(*screen, (m_focused_window ? | 1952 | m_atomhandler[i]->updateFocusedWindow(*screen, (m_focused_window ? |
1954 | m_focused_window->window() : | 1953 | m_focused_window->window() : |
@@ -1958,7 +1957,7 @@ void Fluxbox::setFocusedWindow(WinClient *client) { | |||
1958 | 1957 | ||
1959 | if (old_screen && old_screen != screen) { | 1958 | if (old_screen && old_screen != screen) { |
1960 | old_screen->updateNetizenWindowFocus(); | 1959 | old_screen->updateNetizenWindowFocus(); |
1961 | for (int i=0; i < m_atomhandler.size(); ++i) | 1960 | for (size_t i=0; i < m_atomhandler.size(); ++i) |
1962 | m_atomhandler[i]->updateFocusedWindow(*old_screen, 0); | 1961 | m_atomhandler[i]->updateFocusedWindow(*old_screen, 0); |
1963 | } | 1962 | } |
1964 | 1963 | ||