aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-01-21 14:14:40 (GMT)
committerfluxgen <fluxgen>2004-01-21 14:14:40 (GMT)
commit5e5118b4e3b283220533aa4845e879150ae705ee (patch)
tree54686f39a478492fe64e56f8fb8cf39a370f22e6 /src
parent9c0272004e2509a2206d94dfbe30bb035c8c6d67 (diff)
downloadfluxbox_paul-5e5118b4e3b283220533aa4845e879150ae705ee.zip
fluxbox_paul-5e5118b4e3b283220533aa4845e879150ae705ee.tar.bz2
using empty instead of size
Diffstat (limited to 'src')
-rw-r--r--src/FbCommandFactory.cc6
-rw-r--r--src/FbCommands.cc7
-rw-r--r--src/FbWinFrame.cc11
-rw-r--r--src/I18n.cc4
-rw-r--r--src/IconButton.cc4
-rw-r--r--src/IconbarTool.cc4
-rw-r--r--src/Screen.cc4
-rw-r--r--src/Workspace.cc4
8 files changed, 21 insertions, 23 deletions
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc
index c8d9f4b..9e4ec8f 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.25 2004/01/16 11:41:38 fluxgen Exp $ 23// $Id: FbCommandFactory.cc,v 1.26 2004/01/21 14:11:42 fluxgen Exp $
24 24
25#include "FbCommandFactory.hh" 25#include "FbCommandFactory.hh"
26 26
@@ -252,9 +252,9 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
252 // 252 //
253 // Workspace commands 253 // Workspace commands
254 // 254 //
255 else if (command == "nextworkspace" && arguments.size() == 0) 255 else if (command == "nextworkspace" && arguments.empty())
256 return new NextWorkspaceCmd(); 256 return new NextWorkspaceCmd();
257 else if (command == "prevworkspace" && arguments.size() == 0) 257 else if (command == "prevworkspace" && arguments.empty())
258 return new PrevWorkspaceCmd(); 258 return new PrevWorkspaceCmd();
259 else if (command == "rightworkspace") 259 else if (command == "rightworkspace")
260 return new RightWorkspaceCmd(atoi(arguments.c_str())); 260 return new RightWorkspaceCmd(atoi(arguments.c_str()));
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index d4ad87e..99c8eca 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.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: FbCommands.cc,v 1.22 2003/12/20 17:41:32 fluxgen Exp $ 22// $Id: FbCommands.cc,v 1.23 2004/01/21 14:11:15 fluxgen Exp $
23 23
24#include "FbCommands.hh" 24#include "FbCommands.hh"
25#include "fluxbox.hh" 25#include "fluxbox.hh"
@@ -86,11 +86,10 @@ RestartFluxboxCmd::RestartFluxboxCmd(const std::string &cmd):m_cmd(cmd){
86} 86}
87 87
88void RestartFluxboxCmd::execute() { 88void RestartFluxboxCmd::execute() {
89 if (m_cmd.size() == 0) { 89 if (m_cmd.empty())
90 Fluxbox::instance()->restart(); 90 Fluxbox::instance()->restart();
91 } else { 91 else
92 Fluxbox::instance()->restart(m_cmd.c_str()); 92 Fluxbox::instance()->restart(m_cmd.c_str());
93 }
94} 93}
95 94
96void ReconfigureFluxboxCmd::execute() { 95void ReconfigureFluxboxCmd::execute() {
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index 7a32353..cbcdbaf 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.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: FbWinFrame.cc,v 1.70 2004/01/10 20:22:05 rathnor Exp $ 22// $Id: FbWinFrame.cc,v 1.71 2004/01/21 14:12:31 fluxgen Exp $
23 23
24#include "FbWinFrame.hh" 24#include "FbWinFrame.hh"
25 25
@@ -619,7 +619,7 @@ void FbWinFrame::configureNotifyEvent(XConfigureEvent &event) {
619} 619}
620 620
621void FbWinFrame::reconfigure() { 621void FbWinFrame::reconfigure() {
622 if (m_labelbuttons.size() == 0) 622 if (m_labelbuttons.empty())
623 return; 623 return;
624 624
625 m_bevel = theme().bevelWidth(); 625 m_bevel = theme().bevelWidth();
@@ -717,15 +717,14 @@ unsigned int FbWinFrame::buttonHeight() const {
717 aligns and redraws title 717 aligns and redraws title
718*/ 718*/
719void FbWinFrame::redrawTitle() { 719void FbWinFrame::redrawTitle() {
720 if (m_labelbuttons.size() == 0) 720 if (m_labelbuttons.empty())
721 return; 721 return;
722 722
723 int button_width = label().width()/m_labelbuttons.size(); 723 int button_width = label().width()/m_labelbuttons.size();
724 int rounding_error = label().width() - m_labelbuttons.size()*button_width; 724 int rounding_error = label().width() - m_labelbuttons.size()*button_width;
725 //!! TODO: bevel 725 //!! TODO: bevel
726 //int border_width = m_labelbuttons.front()->window().borderWidth(); 726 //int border_width = m_labelbuttons.front()->window().borderWidth();
727 int border_width = m_labelbuttons.size() != 0 ? 727 int border_width = m_labelbuttons.empty() ? 0 : m_labelbuttons.front()->borderWidth();
728 m_labelbuttons.front()->borderWidth() : 0;
729 728
730 LabelList::iterator btn_it = m_labelbuttons.begin(); 729 LabelList::iterator btn_it = m_labelbuttons.begin();
731 LabelList::iterator btn_it_end = m_labelbuttons.end(); 730 LabelList::iterator btn_it_end = m_labelbuttons.end();
@@ -799,7 +798,7 @@ void FbWinFrame::reconfigureTitlebar() {
799 798
800 // space left on titlebar between left and right buttons 799 // space left on titlebar between left and right buttons
801 unsigned int space_left = m_titlebar.width() - next_x; 800 unsigned int space_left = m_titlebar.width() - next_x;
802 if (m_buttons_right.size() != 0) 801 if (!m_buttons_right.empty())
803 space_left -= m_buttons_right.size() * (button_size + m_bevel); 802 space_left -= m_buttons_right.size() * (button_size + m_bevel);
804 803
805 space_left -= m_bevel; 804 space_left -= m_bevel;
diff --git a/src/I18n.cc b/src/I18n.cc
index 222fe03..43f8cea 100644
--- a/src/I18n.cc
+++ b/src/I18n.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: I18n.cc,v 1.5 2004/01/06 13:42:47 grubert Exp $ 25// $Id: I18n.cc,v 1.6 2004/01/21 14:12:51 fluxgen Exp $
26 26
27//usr GNU extensions 27//usr GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -56,7 +56,7 @@ I18n::I18n():m_multibyte(false), m_catalog_fd((nl_catd)(-1)) {
56 //make sure we don't get 0 to m_locale string 56 //make sure we don't get 0 to m_locale string
57 char *temp = setlocale(LC_ALL, ""); 57 char *temp = setlocale(LC_ALL, "");
58 m_locale = ( temp ? temp : ""); 58 m_locale = ( temp ? temp : "");
59 if (m_locale.size() == 0) { 59 if (m_locale.empty()) {
60 cerr<<"Warning: Failed to set locale, reverting to \"C\""<<endl; 60 cerr<<"Warning: Failed to set locale, reverting to \"C\""<<endl;
61#endif // HAVE_SETLOCALE 61#endif // HAVE_SETLOCALE
62 62
diff --git a/src/IconButton.cc b/src/IconButton.cc
index 2ee169f..a994b7d 100644
--- a/src/IconButton.cc
+++ b/src/IconButton.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: IconButton.cc,v 1.16 2004/01/16 09:32:44 fluxgen Exp $ 23// $Id: IconButton.cc,v 1.17 2004/01/21 14:13:32 fluxgen Exp $
24 24
25#include "IconButton.hh" 25#include "IconButton.hh"
26 26
@@ -161,7 +161,7 @@ void IconButton::update(FbTk::Subject *subj) {
161 // so we refresh everything 161 // so we refresh everything
162 162
163 // we need to check our client first 163 // we need to check our client first
164 if (m_win.clientList().size() == 0) 164 if (m_win.clientList().empty())
165 return; 165 return;
166 166
167 XWMHints *hints = XGetWMHints(FbTk::App::instance()->display(), m_win.winClient().window()); 167 XWMHints *hints = XGetWMHints(FbTk::App::instance()->display(), m_win.winClient().window());
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
index e3fc6c5..72e6ce1 100644
--- a/src/IconbarTool.cc
+++ b/src/IconbarTool.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: IconbarTool.cc,v 1.31 2004/01/19 18:28:08 fluxgen Exp $ 23// $Id: IconbarTool.cc,v 1.32 2004/01/21 14:13:57 fluxgen Exp $
24 24
25#include "IconbarTool.hh" 25#include "IconbarTool.hh"
26 26
@@ -682,7 +682,7 @@ void IconbarTool::removeWindow(FluxboxWindow &win) {
682 682
683void IconbarTool::addWindow(FluxboxWindow &win) { 683void IconbarTool::addWindow(FluxboxWindow &win) {
684 // we just want windows that has clients 684 // we just want windows that has clients
685 if (win.clientList().size() == 0) 685 if (win.clientList().empty())
686 return; 686 return;
687 687
688 IconButton *button = new IconButton(m_icon_container, m_theme.focusedText().font(), win); 688 IconButton *button = new IconButton(m_icon_container, m_theme.focusedText().font(), win);
diff --git a/src/Screen.cc b/src/Screen.cc
index 0a22c25..4dec665 100644
--- a/src/Screen.cc
+++ b/src/Screen.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: Screen.cc,v 1.263 2004/01/19 22:07:24 fluxgen Exp $ 25// $Id: Screen.cc,v 1.264 2004/01/21 14:14:18 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -1980,7 +1980,7 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) {
1980 // perform shell style ~ home directory expansion 1980 // perform shell style ~ home directory expansion
1981 string newfile(FbTk::StringUtil::expandFilename(str_label)); 1981 string newfile(FbTk::StringUtil::expandFilename(str_label));
1982 1982
1983 if (newfile.size() != 0) { 1983 if (!newfile.empty()) {
1984 if (!FbTk::Directory::isRegularFile(newfile)) { 1984 if (!FbTk::Directory::isRegularFile(newfile)) {
1985 fprintf(stderr, 1985 fprintf(stderr,
1986 i18n-> 1986 i18n->
diff --git a/src/Workspace.cc b/src/Workspace.cc
index 8e8df5b..304b3c7 100644
--- a/src/Workspace.cc
+++ b/src/Workspace.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: Workspace.cc,v 1.89 2003/12/30 18:16:51 fluxgen Exp $ 25// $Id: Workspace.cc,v 1.90 2004/01/21 14:14:40 fluxgen Exp $
26 26
27#include "Workspace.hh" 27#include "Workspace.hh"
28 28
@@ -365,7 +365,7 @@ void Workspace::update(FbTk::Subject *subj) {
365 365
366 366
367void Workspace::setName(const std::string &name) { 367void Workspace::setName(const std::string &name) {
368 if (name.size() != 0) { 368 if (!name.empty()) {
369 m_name = name; 369 m_name = name;
370 } else { //if name == 0 then set default name from nls 370 } else { //if name == 0 then set default name from nls
371 char tname[128]; 371 char tname[128];