# HG changeset patch # User Santeri Piippo # Date 1382459325 -10800 # Node ID 47c068f2e7e32e731e9d96b1e0ba7153a5832ee7 # Parent b29b6fc45ba9f15e07c74ebcbb7f859e3291691b more minor changes diff -r b29b6fc45ba9 -r 47c068f2e7e3 src/configDialog.cpp --- a/src/configDialog.cpp Tue Oct 22 19:22:15 2013 +0300 +++ b/src/configDialog.cpp Tue Oct 22 19:28:45 2013 +0300 @@ -441,7 +441,7 @@ // Remove a quick color // ----------------------------------------------------------------------------- void ConfigDialog::slot_delColor() -{ if (ui->quickColorList->selectedItems().size() == 0) +{ if (ui->quickColorList->selectedItems().isEmpty()) return; QListWidgetItem* item = ui->quickColorList->selectedItems() [0]; @@ -455,7 +455,7 @@ void ConfigDialog::slot_moveColor() { const bool up = (static_cast (sender()) == ui->quickColor_moveUp); - if (ui->quickColorList->selectedItems().size() == 0) + if (ui->quickColorList->selectedItems().isEmpty()) return; QListWidgetItem* item = ui->quickColorList->selectedItems() [0]; @@ -544,7 +544,7 @@ // Which quick color is currently selected? // ----------------------------------------------------------------------------- QListWidgetItem* ConfigDialog::getSelectedQuickColor() -{ if (ui->quickColorList->selectedItems().size() == 0) +{ if (ui->quickColorList->selectedItems().isEmpty()) return null; return ui->quickColorList->selectedItems() [0]; diff -r b29b6fc45ba9 -r 47c068f2e7e3 src/file.cpp --- a/src/file.cpp Tue Oct 22 19:22:15 2013 +0300 +++ b/src/file.cpp Tue Oct 22 19:28:45 2013 +0300 @@ -199,7 +199,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- File* openLDrawFile (str relpath, bool subdirs) -{ log ("%1: Try to open %2\n", __func__, relpath); +{ log ("Opening %1...\n", relpath); File* f = new File; str fullPath; @@ -241,7 +241,7 @@ } // Did not find the file. - log ("could not find %1\n", relpath); + log ("Could not find %1.\n", relpath); delete f; return null; } diff -r b29b6fc45ba9 -r 47c068f2e7e3 src/gldraw.cpp --- a/src/gldraw.cpp Tue Oct 22 19:22:15 2013 +0300 +++ b/src/gldraw.cpp Tue Oct 22 19:28:45 2013 +0300 @@ -614,11 +614,11 @@ } elif (editMode() == CircleMode) { // If we have not specified the center point of the circle yet, preview it on the screen. - if (m_drawedVerts.size() == 0) + if (m_drawedVerts.isEmpty()) drawBlip (paint, coordconv3_2 (m_hoverpos)); else { QVector verts, verts2; - const double dist0 = circleDrawDist(0), + const double dist0 = circleDrawDist (0), dist1 = (m_drawedVerts.size() >= 2) ? circleDrawDist (1) : -1; const int segs = lores; const double angleUnit = (2 * pi) / segs; @@ -965,7 +965,7 @@ return; } - if (m_drawedVerts.size() == 0 && ev->modifiers() & Qt::ShiftModifier) + if (m_drawedVerts.isEmpty() && ev->modifiers() & Qt::ShiftModifier) { m_rectdraw = true; updateRectVerts(); } @@ -1821,7 +1821,7 @@ { if (!m_rectdraw) return; - if (m_drawedVerts.size() == 0) + if (m_drawedVerts.isEmpty()) { for (int i = 0; i < 4; ++i) m_rectverts[i] = m_hoverpos; diff -r b29b6fc45ba9 -r 47c068f2e7e3 src/history.cpp --- a/src/history.cpp Tue Oct 22 19:22:15 2013 +0300 +++ b/src/history.cpp Tue Oct 22 19:28:45 2013 +0300 @@ -34,7 +34,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- void History::undo() -{ if (m_changesets.size() == 0 || pos() == -1) +{ if (m_changesets.isEmpty() || pos() == -1) return; const Changeset& set = changeset (pos()); diff -r b29b6fc45ba9 -r 47c068f2e7e3 src/ldtypes.cpp --- a/src/ldtypes.cpp Tue Oct 22 19:22:15 2013 +0300 +++ b/src/ldtypes.cpp Tue Oct 22 19:28:45 2013 +0300 @@ -344,7 +344,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- void LDObject::moveObjects (QList objs, const bool up) -{ if (objs.size() == 0) +{ if (objs.isEmpty()) return; // If we move down, we need to iterate the array in reverse order. @@ -397,7 +397,7 @@ { bool firstDetails = true; str text = ""; - if (objs.size() == 0) + if (objs.isEmpty()) return "nothing"; // :) for (long i = 0; i < LDObject::NumTypes; ++i) @@ -416,7 +416,8 @@ str noun = fmt ("%1%2", typeName (objType), plural (count)); - // Plural of "vertex" is "vertices". Stupid English. + // Plural of "vertex" is "vertices", correct that + if (objType == LDObject::Vertex && count != 1) noun = "vertices"; diff -r b29b6fc45ba9 -r 47c068f2e7e3 src/messagelog.cpp --- a/src/messagelog.cpp Tue Oct 22 19:22:15 2013 +0300 +++ b/src/messagelog.cpp Tue Oct 22 19:28:45 2013 +0300 @@ -88,7 +88,7 @@ // redrawn if something changed. // ----------------------------------------------------------------------------- void MessageManager::tick() -{ if (m_lines.size() == 0) +{ if (m_lines.isEmpty()) return; bool changed = false;