aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-01-21 13:36:09 (GMT)
committerfluxgen <fluxgen>2004-01-21 13:36:09 (GMT)
commit9c0272004e2509a2206d94dfbe30bb035c8c6d67 (patch)
treea97b2a4257af1ea1f1f4398314d1c9abe9808b44
parent5685dc91951477ee0e0a280d1f30ec737cc95550 (diff)
downloadfluxbox-9c0272004e2509a2206d94dfbe30bb035c8c6d67.zip
fluxbox-9c0272004e2509a2206d94dfbe30bb035c8c6d67.tar.bz2
using empty instead of size
-rw-r--r--src/SystemTray.cc6
-rw-r--r--src/Toolbar.cc4
-rw-r--r--src/fluxbox.cc25
3 files changed, 17 insertions, 18 deletions
diff --git a/src/SystemTray.cc b/src/SystemTray.cc
index 781d784..1a69a48 100644
--- a/src/SystemTray.cc
+++ b/src/SystemTray.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: SystemTray.cc,v 1.5 2004/01/19 18:22:57 fluxgen Exp $ 22// $Id: SystemTray.cc,v 1.6 2004/01/21 13:35:10 fluxgen Exp $
23 23
24#include "SystemTray.hh" 24#include "SystemTray.hh"
25 25
@@ -215,7 +215,7 @@ void SystemTray::addClient(Window win) {
215#ifdef DEBUG 215#ifdef DEBUG
216 cerr<<__FILE__<<"("<<__FUNCTION__<<"): 0x"<<hex<<win<<dec<<endl; 216 cerr<<__FILE__<<"("<<__FUNCTION__<<"): 0x"<<hex<<win<<dec<<endl;
217#endif // DEBUG 217#endif // DEBUG
218 if (m_clients.size() == 0) 218 if (m_clients.empty())
219 show(); 219 show();
220 220
221 FbTk::FbWindow *traywin = new TrayWindow(win); 221 FbTk::FbWindow *traywin = new TrayWindow(win);
@@ -244,7 +244,7 @@ void SystemTray::removeClient(Window win) {
244 delete traywin; 244 delete traywin;
245 resize(width(), height()); 245 resize(width(), height());
246 rearrangeClients(); 246 rearrangeClients();
247 if (m_clients.size() == 0) { 247 if (m_clients.empty()) {
248 // so we send configurenotify signal to parent 248 // so we send configurenotify signal to parent
249 m_window.resize(1, 1); 249 m_window.resize(1, 1);
250 hide(); 250 hide();
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 7cda0b0..7dd4c58 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.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: Toolbar.cc,v 1.137 2004/01/16 11:41:38 fluxgen Exp $ 25// $Id: Toolbar.cc,v 1.138 2004/01/21 13:36:09 fluxgen Exp $
26 26
27#include "Toolbar.hh" 27#include "Toolbar.hh"
28 28
@@ -370,7 +370,7 @@ void Toolbar::reconfigure() {
370 tools.begin(), 370 tools.begin(),
371 FbTk::StringUtil::toLower); 371 FbTk::StringUtil::toLower);
372 372
373 if (tools.size() == m_tools.size() && tools.size() != 0) { 373 if (!tools.empty() && tools.size() == m_tools.size()) {
374 StringList::const_iterator tool_it = tools.begin(); 374 StringList::const_iterator tool_it = tools.begin();
375 StringList::const_iterator current_tool_it = m_tools.begin(); 375 StringList::const_iterator current_tool_it = m_tools.begin();
376 StringList::const_iterator tool_it_end = tools.end(); 376 StringList::const_iterator tool_it_end = tools.end();
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
1594string Fluxbox::getRcFilename() { 1593string 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