# HG changeset patch # User Santeri Piippo # Date 1382458935 -10800 # Node ID b29b6fc45ba9f15e07c74ebcbb7f859e3291691b # Parent 4f6e46a3bfc3f62e15ffd213979725045578abcb style corrections diff -r 4f6e46a3bfc3 -r b29b6fc45ba9 src/addObjectDialog.cpp --- a/src/addObjectDialog.cpp Tue Oct 22 13:53:24 2013 +0300 +++ b/src/addObjectDialog.cpp Tue Oct 22 19:22:15 2013 +0300 @@ -34,6 +34,7 @@ #include "widgets.h" #include "misc.h" #include "primitives.h" +#include "moc_addObjectDialog.cpp" // ============================================================================= // ----------------------------------------------------------------------------- @@ -387,7 +388,7 @@ LDSubfile* ref = initObj (obj); - for (const Axis ax : g_Axes) + for (const Axis ax : g_Axes) ref->setCoordinate (ax, dlg.dsb_coords[ax]->value()); ref->setTransform (transform); @@ -409,4 +410,3 @@ g_win->fullRefresh(); } -#include "moc_addObjectDialog.cpp" diff -r 4f6e46a3bfc3 -r b29b6fc45ba9 src/configDialog.cpp --- a/src/configDialog.cpp Tue Oct 22 13:53:24 2013 +0300 +++ b/src/configDialog.cpp Tue Oct 22 19:22:15 2013 +0300 @@ -38,6 +38,7 @@ #include "colorSelectDialog.h" #include "gldraw.h" #include "ui_config.h" +#include "moc_configDialog.cpp" extern_cfg (String, gl_bgcolor); extern_cfg (String, gl_maincolor); @@ -713,4 +714,3 @@ { seq = ev->key() + ev->modifiers(); updateOutput(); } -#include "moc_configDialog.cpp" diff -r 4f6e46a3bfc3 -r b29b6fc45ba9 src/dialogs.cpp --- a/src/dialogs.cpp Tue Oct 22 13:53:24 2013 +0300 +++ b/src/dialogs.cpp Tue Oct 22 19:22:15 2013 +0300 @@ -209,7 +209,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- void LDrawPathDialog::slot_exit() -{ exit (1); +{ exit (0); } // ============================================================================= @@ -238,7 +238,6 @@ { ui = new Ui_OpenProgressUI; ui->setupUi (this); ui->progressText->setText ("Parsing..."); - setNumLines (0); m_progress = 0; } @@ -282,12 +281,11 @@ ExtProgPathPrompt::ExtProgPathPrompt (str progName, QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f), ui (new Ui_ExtProgPath) -{ ui->setupUi (this); - +{ + ui->setupUi (this); str labelText = ui->m_label->text(); labelText.replace ("", progName); ui->m_label->setText (labelText); - connect (ui->m_findPath, SIGNAL (clicked (bool)), this, SLOT (findPath())); } diff -r 4f6e46a3bfc3 -r b29b6fc45ba9 src/download.cpp --- a/src/download.cpp Tue Oct 22 13:53:24 2013 +0300 +++ b/src/download.cpp Tue Oct 22 19:22:15 2013 +0300 @@ -161,11 +161,10 @@ if (QRegExp (subpartRegex).exactMatch (dest)) dest.prepend ("parts/s/"); - elif (QRegExp (partRegex).exactMatch (dest)) - dest.prepend ("parts/"); + dest.prepend ("parts/"); elif (dest.left (6) != "parts/" && dest.left (2) != "p/") - dest.prepend ("p/"); + dest.prepend ("p/"); } // ============================================================================= @@ -288,13 +287,16 @@ switch (i) { case Download: - return m_downloadButton; + { return m_downloadButton; + } case Abort: - return qobject_cast (btnbox->button (QDBB::Abort)); + { return qobject_cast (btnbox->button (QDBB::Abort)); + } case Close: - return qobject_cast (btnbox->button (QDBB::Close)); + { return qobject_cast (btnbox->button (QDBB::Close)); + } } return null; @@ -347,7 +349,7 @@ switch (m_state) { case Requesting: case Downloading: - prog = qobject_cast (table->cellWidget (tableRow(), progcol)); + { prog = qobject_cast (table->cellWidget (tableRow(), progcol)); if (!prog) { prog = new QProgressBar; @@ -356,16 +358,15 @@ prog->setRange (0, m_bytesTotal); prog->setValue (m_bytesRead); - break; + } break; case Finished: case Failed: - { QLabel* lb = new QLabel ( (m_state == Finished) ? "FINISHED" : + { QLabel* lb = new QLabel ((m_state == Finished) ? "FINISHED" : "FAILED"); lb->setAlignment (Qt::AlignCenter); table->setCellWidget (tableRow(), progcol, lb); - } - break; + } break; } QLabel* lb = qobject_cast (table->cellWidget (tableRow(), labelcol)); @@ -391,8 +392,7 @@ m_state = Failed; } elif (state() != Failed) - - m_state = Finished; + m_state = Finished; m_bytesRead = m_bytesTotal; updateToTable(); diff -r 4f6e46a3bfc3 -r b29b6fc45ba9 src/extprogs.cpp --- a/src/extprogs.cpp Tue Oct 22 13:53:24 2013 +0300 +++ b/src/extprogs.cpp Tue Oct 22 19:22:15 2013 +0300 @@ -208,12 +208,10 @@ QStringList argv = argvstr.split (" ", QString::SkipEmptyParts); #ifndef _WIN32 - if (*g_extProgWine[prog]) { argv.insert (0, path); path = "wine"; } - #endif // _WIN32 log ("cmdline: %1 %2\n", path, argv.join (" ")); @@ -237,10 +235,6 @@ // Wait while it runs proc.waitForFinished(); -#ifndef RELEASE - log ("%1", str (proc.readAllStandardOutput())); -#endif // RELEASE - str err = ""; if (proc.exitStatus() != QProcess::NormalExit) @@ -419,7 +413,7 @@ short inCol, cutCol; const bool repeatInverse = ui.cb_repeat->isChecked(); - for (;;) + forever { if (!dlg->exec()) return; @@ -505,7 +499,7 @@ short in1Col, in2Col; - for (;;) + forever { if (!dlg->exec()) return; @@ -563,7 +557,7 @@ short in1Col, in2Col; // Run the dialog and validate input - for (;;) + forever { if (!dlg->exec()) return; diff -r 4f6e46a3bfc3 -r b29b6fc45ba9 src/gldraw.cpp --- a/src/gldraw.cpp Tue Oct 22 13:53:24 2013 +0300 +++ b/src/gldraw.cpp Tue Oct 22 19:22:15 2013 +0300 @@ -1080,7 +1080,6 @@ m_panY -= 0.03f * dy * (zoom() / 7.5f); m_panning = true; } elif (left && !m_rangepick && camera() == Free) - { m_rotX = m_rotX + (dy); m_rotY = m_rotY + (dx); @@ -1547,11 +1546,10 @@ { for (int i = 0; i < obj->vertices(); ++i) verts << obj->getVertex (i); } elif (obj->getType() == LDObject::Subfile) - { LDSubfile* ref = static_cast (obj); QList objs = ref->inlineContents (LDSubfile::DeepCacheInline); - for (LDObject * obj : objs) + for (LDObject* obj : objs) { verts << getVertices (obj); delete obj; } @@ -1665,15 +1663,13 @@ if (info.lw == 0) info.lw = (info.lh * img->width()) / img->height(); - elif (info.lh == 0) - info.lh = (info.lw * img->height()) / img->width(); + info.lh = (info.lw * img->height()) / img->width(); const Axis x2d = cameraAxis (false, cam), - y2d = cameraAxis (true, cam); - - double negXFac = g_FixedCameras[cam].negX ? -1 : 1, - negYFac = g_FixedCameras[cam].negY ? -1 : 1; + y2d = cameraAxis (true, cam); + const double negXFac = g_FixedCameras[cam].negX ? -1 : 1, + negYFac = g_FixedCameras[cam].negY ? -1 : 1; info.v0 = info.v1 = g_origin; info.v0[x2d] = - (info.ox * info.lw * negXFac) / img->width(); @@ -1901,8 +1897,7 @@ { delete meta.img; meta.img = null; } elif (ovlobj && (!meta.img || meta.fname != ovlobj->filename())) - - setupOverlay (cam, ovlobj->filename(), ovlobj->x(), ovlobj->y(), ovlobj->width(), ovlobj->height()); + setupOverlay (cam, ovlobj->filename(), ovlobj->x(), ovlobj->y(), ovlobj->width(), ovlobj->height()); } } @@ -1930,7 +1925,6 @@ m_file->forgetObject (ovlobj); delete ovlobj; } elif (meta.img && !ovlobj) - { // Inverse case: image is there but the overlay object is // not, thus create the object. ovlobj = new LDOverlay; diff -r 4f6e46a3bfc3 -r b29b6fc45ba9 src/gui.cpp --- a/src/gui.cpp Tue Oct 22 13:53:24 2013 +0300 +++ b/src/gui.cpp Tue Oct 22 19:22:15 2013 +0300 @@ -814,7 +814,7 @@ void ForgeWindow::updateFileList() { ui->fileList->clear(); -for (LDFile * f : g_loadedFiles) + for (LDFile* f : g_loadedFiles) { // Don't list implicit files unless explicitly desired. if (f->implicit() && !gui_implicitfiles) continue;