From 5e5118b4e3b283220533aa4845e879150ae705ee Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 21 Jan 2004 14:14:40 +0000 Subject: using empty instead of size --- src/FbCommandFactory.cc | 6 +++--- src/FbCommands.cc | 7 +++---- src/FbWinFrame.cc | 11 +++++------ src/I18n.cc | 4 ++-- src/IconButton.cc | 4 ++-- src/IconbarTool.cc | 4 ++-- src/Screen.cc | 4 ++-- src/Workspace.cc | 4 ++-- 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommandFactory.cc,v 1.25 2004/01/16 11:41:38 fluxgen Exp $ +// $Id: FbCommandFactory.cc,v 1.26 2004/01/21 14:11:42 fluxgen Exp $ #include "FbCommandFactory.hh" @@ -252,9 +252,9 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, // // Workspace commands // - else if (command == "nextworkspace" && arguments.size() == 0) + else if (command == "nextworkspace" && arguments.empty()) return new NextWorkspaceCmd(); - else if (command == "prevworkspace" && arguments.size() == 0) + else if (command == "prevworkspace" && arguments.empty()) return new PrevWorkspaceCmd(); else if (command == "rightworkspace") 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommands.cc,v 1.22 2003/12/20 17:41:32 fluxgen Exp $ +// $Id: FbCommands.cc,v 1.23 2004/01/21 14:11:15 fluxgen Exp $ #include "FbCommands.hh" #include "fluxbox.hh" @@ -86,11 +86,10 @@ RestartFluxboxCmd::RestartFluxboxCmd(const std::string &cmd):m_cmd(cmd){ } void RestartFluxboxCmd::execute() { - if (m_cmd.size() == 0) { + if (m_cmd.empty()) Fluxbox::instance()->restart(); - } else { + else Fluxbox::instance()->restart(m_cmd.c_str()); - } } void 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.cc,v 1.70 2004/01/10 20:22:05 rathnor Exp $ +// $Id: FbWinFrame.cc,v 1.71 2004/01/21 14:12:31 fluxgen Exp $ #include "FbWinFrame.hh" @@ -619,7 +619,7 @@ void FbWinFrame::configureNotifyEvent(XConfigureEvent &event) { } void FbWinFrame::reconfigure() { - if (m_labelbuttons.size() == 0) + if (m_labelbuttons.empty()) return; m_bevel = theme().bevelWidth(); @@ -717,15 +717,14 @@ unsigned int FbWinFrame::buttonHeight() const { aligns and redraws title */ void FbWinFrame::redrawTitle() { - if (m_labelbuttons.size() == 0) + if (m_labelbuttons.empty()) return; int button_width = label().width()/m_labelbuttons.size(); int rounding_error = label().width() - m_labelbuttons.size()*button_width; //!! TODO: bevel //int border_width = m_labelbuttons.front()->window().borderWidth(); - int border_width = m_labelbuttons.size() != 0 ? - m_labelbuttons.front()->borderWidth() : 0; + int border_width = m_labelbuttons.empty() ? 0 : m_labelbuttons.front()->borderWidth(); LabelList::iterator btn_it = m_labelbuttons.begin(); LabelList::iterator btn_it_end = m_labelbuttons.end(); @@ -799,7 +798,7 @@ void FbWinFrame::reconfigureTitlebar() { // space left on titlebar between left and right buttons unsigned int space_left = m_titlebar.width() - next_x; - if (m_buttons_right.size() != 0) + if (!m_buttons_right.empty()) space_left -= m_buttons_right.size() * (button_size + m_bevel); 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: I18n.cc,v 1.5 2004/01/06 13:42:47 grubert Exp $ +// $Id: I18n.cc,v 1.6 2004/01/21 14:12:51 fluxgen Exp $ //usr GNU extensions #ifndef _GNU_SOURCE @@ -56,7 +56,7 @@ I18n::I18n():m_multibyte(false), m_catalog_fd((nl_catd)(-1)) { //make sure we don't get 0 to m_locale string char *temp = setlocale(LC_ALL, ""); m_locale = ( temp ? temp : ""); - if (m_locale.size() == 0) { + if (m_locale.empty()) { cerr<<"Warning: Failed to set locale, reverting to \"C\""<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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconbarTool.cc,v 1.31 2004/01/19 18:28:08 fluxgen Exp $ +// $Id: IconbarTool.cc,v 1.32 2004/01/21 14:13:57 fluxgen Exp $ #include "IconbarTool.hh" @@ -682,7 +682,7 @@ void IconbarTool::removeWindow(FluxboxWindow &win) { void IconbarTool::addWindow(FluxboxWindow &win) { // we just want windows that has clients - if (win.clientList().size() == 0) + if (win.clientList().empty()) return; 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.263 2004/01/19 22:07:24 fluxgen Exp $ +// $Id: Screen.cc,v 1.264 2004/01/21 14:14:18 fluxgen Exp $ #include "Screen.hh" @@ -1980,7 +1980,7 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) { // perform shell style ~ home directory expansion string newfile(FbTk::StringUtil::expandFilename(str_label)); - if (newfile.size() != 0) { + if (!newfile.empty()) { if (!FbTk::Directory::isRegularFile(newfile)) { fprintf(stderr, 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Workspace.cc,v 1.89 2003/12/30 18:16:51 fluxgen Exp $ +// $Id: Workspace.cc,v 1.90 2004/01/21 14:14:40 fluxgen Exp $ #include "Workspace.hh" @@ -365,7 +365,7 @@ void Workspace::update(FbTk::Subject *subj) { void Workspace::setName(const std::string &name) { - if (name.size() != 0) { + if (!name.empty()) { m_name = name; } else { //if name == 0 then set default name from nls char tname[128]; -- cgit v0.11.2