Tue, 22 Oct 2013 19:22:15 +0300
style corrections
src/addObjectDialog.cpp | file | annotate | diff | comparison | revisions | |
src/configDialog.cpp | file | annotate | diff | comparison | revisions | |
src/dialogs.cpp | file | annotate | diff | comparison | revisions | |
src/download.cpp | file | annotate | diff | comparison | revisions | |
src/extprogs.cpp | file | annotate | diff | comparison | revisions | |
src/gldraw.cpp | file | annotate | diff | comparison | revisions | |
src/gui.cpp | file | annotate | diff | comparison | revisions |
--- 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<LDSubfile> (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"
--- 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"
--- 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 ("<PROGRAM>", progName); ui->m_label->setText (labelText); - connect (ui->m_findPath, SIGNAL (clicked (bool)), this, SLOT (findPath())); }
--- 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<QPushButton*> (btnbox->button (QDBB::Abort)); + { return qobject_cast<QPushButton*> (btnbox->button (QDBB::Abort)); + } case Close: - return qobject_cast<QPushButton*> (btnbox->button (QDBB::Close)); + { return qobject_cast<QPushButton*> (btnbox->button (QDBB::Close)); + } } return null; @@ -347,7 +349,7 @@ switch (m_state) { case Requesting: case Downloading: - prog = qobject_cast<QProgressBar*> (table->cellWidget (tableRow(), progcol)); + { prog = qobject_cast<QProgressBar*> (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) ? "<b><span style=\"color: #080\">FINISHED</span></b>" : + { QLabel* lb = new QLabel ((m_state == Finished) ? "<b><span style=\"color: #080\">FINISHED</span></b>" : "<b><span style=\"color: #800\">FAILED</span></b>"); lb->setAlignment (Qt::AlignCenter); table->setCellWidget (tableRow(), progcol, lb); - } - break; + } break; } QLabel* lb = qobject_cast<QLabel*> (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();
--- 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;
--- 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<LDSubfile*> (obj); QList<LDObject*> 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;
--- 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;