Wed, 16 Oct 2013 16:47:40 +0300
Removed the List -> QList alias, use QList directly
--- a/src/configDialog.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/configDialog.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -514,7 +514,7 @@ // ============================================================================= // Finds the given list widget item in the list of widget items given. // ----------------------------------------------------------------------------- -int ConfigDialog::getItemRow (QListWidgetItem* item, List<QListWidgetItem*>& haystack) +int ConfigDialog::getItemRow (QListWidgetItem* item, QList<QListWidgetItem*>& haystack) { int i = 0; for (QListWidgetItem * it : haystack)
--- a/src/configDialog.h Wed Oct 16 16:40:42 2013 +0300 +++ b/src/configDialog.h Wed Oct 16 16:47:40 2013 +0300 @@ -55,14 +55,14 @@ virtual ~ConfigDialog(); float getGridValue (int i, int j) const; - List<LDQuickColor> quickColors; + QList<LDQuickColor> quickColors; QDoubleSpinBox* dsb_gridData[3][4]; private: Ui_ConfigUI* ui; QLabel* lb_gridLabels[3]; QLabel* lb_gridIcons[3]; - List<QListWidgetItem*> quickColorItems; + QList<QListWidgetItem*> quickColorItems; void applySettings(); void addShortcut (KeySequenceConfig& cfg, QAction* act, int& i); @@ -70,7 +70,7 @@ void pickColor (StringConfig& cfg, QPushButton* button); void updateQuickColorList (LDQuickColor* sel = null); void setShortcutText (ShortcutListItem* item); - int getItemRow (QListWidgetItem* item, List<QListWidgetItem*>& haystack); + int getItemRow (QListWidgetItem* item, QList<QListWidgetItem*>& haystack); str quickColorString(); QListWidgetItem* getSelectedQuickColor(); QList<ShortcutListItem*> getShortcutSelection();
--- a/src/dialogs.h Wed Oct 16 16:40:42 2013 +0300 +++ b/src/dialogs.h Wed Oct 16 16:47:40 2013 +0300 @@ -56,7 +56,7 @@ private: Ui_OverlayUI* ui; - List<pair<QRadioButton*, int>> m_cameraArgs; + QList<pair<QRadioButton*, int>> m_cameraArgs; private slots: void slot_fpath();
--- a/src/download.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/download.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -188,13 +188,14 @@ void PartDownloader::buttonClicked (QAbstractButton* btn) { if (btn == getButton (Close)) { reject(); - } elif (btn == getButton (Abort)) - + } + elif (btn == getButton (Abort)) { setAborted (true); - for (PartDownloadRequest * req : m_requests) + for (PartDownloadRequest* req : m_requests) req->abort(); - } elif (btn == getButton (Download)) + } + elif (btn == getButton (Download)) { str dest = ui->fname->text(); setPrimaryFile (null); setAborted (false);
--- a/src/download.h Wed Oct 16 16:40:42 2013 +0300 +++ b/src/download.h Wed Oct 16 16:47:40 2013 +0300 @@ -78,8 +78,8 @@ friend class PartDownloadRequest; private: - List<str> m_filesToDownload; - List<PartDownloadRequest*> m_requests; + QList<str> m_filesToDownload; + QList<PartDownloadRequest*> m_requests; QPushButton* m_downloadButton; };
--- a/src/extprogs.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/extprogs.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -148,11 +148,11 @@ // ============================================================================= // ----------------------------------------------------------------------------- -void writeObjects (List<LDObject*>& objects, File& f) +void writeObjects (QList<LDObject*>& objects, File& f) { for (LDObject * obj : objects) { if (obj->getType() == LDObject::Subfile) { LDSubfile* ref = static_cast<LDSubfile*> (obj); - List<LDObject*> objs = ref->inlineContents (LDSubfile::DeepInline); + QList<LDObject*> objs = ref->inlineContents (LDSubfile::DeepInline); writeObjects (objs, f); @@ -166,7 +166,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -void writeObjects (List<LDObject*>& objects, str fname) +void writeObjects (QList<LDObject*>& objects, str fname) { // Write the input file File f (fname, File::Write); @@ -188,7 +188,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- void writeColorGroup (const short colnum, str fname) -{ List<LDObject*> objects; +{ QList<LDObject*> objects; for (LDObject * obj : LDFile::current()->objects()) { if (obj->isColored() == false || obj->color() != colnum) @@ -260,7 +260,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -static void insertOutput (str fname, bool replace, List<short> colorsToReplace) +static void insertOutput (str fname, bool replace, QList<short> colorsToReplace) { #ifndef RELEASE QFile::copy (fname, "./debug_lastOutput"); @@ -274,7 +274,7 @@ return; } - List<LDObject*> objs = loadFileContents (&f, null); + QList<LDObject*> objs = loadFileContents (&f, null); // If we replace the objects, delete the selection now. if (replace)
--- a/src/file.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/file.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -356,9 +356,9 @@ // ============================================================================= // ----------------------------------------------------------------------------- -List<LDObject*> loadFileContents (File* f, int* numWarnings, bool* ok) -{ List<str> lines; - List<LDObject*> objs; +QList<LDObject*> loadFileContents (File* f, int* numWarnings, bool* ok) +{ QList<str> lines; + QList<LDObject*> objs; if (numWarnings) *numWarnings = 0; @@ -417,7 +417,7 @@ int numWarnings; bool ok; - List<LDObject*> objs = loadFileContents (f, &numWarnings, &ok); + QList<LDObject*> objs = loadFileContents (f, &numWarnings, &ok); if (!ok) return null; @@ -492,7 +492,7 @@ // ----------------------------------------------------------------------------- void closeAll() { // Remove all loaded files and the objects they contain - List<LDFile*> files = g_loadedFiles; + QList<LDFile*> files = g_loadedFiles; for (LDFile * file : files) delete file; @@ -883,7 +883,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -void LDFile::addObjects (const List<LDObject*> objs) +void LDFile::addObjects (const QList<LDObject*> objs) { for (LDObject * obj : objs) if (obj) addObject (obj); @@ -932,8 +932,8 @@ // ============================================================================= // ----------------------------------------------------------------------------- -static List<LDFile*> getFilesUsed (LDFile* node) -{ List<LDFile*> filesUsed; +static QList<LDFile*> getFilesUsed (LDFile* node) +{ QList<LDFile*> filesUsed; for (LDObject * obj : node->objects()) { if (obj->getType() != LDObject::Subfile) @@ -951,7 +951,7 @@ // Find out which files are unused and close them. // ----------------------------------------------------------------------------- void LDFile::closeUnused() -{ List<LDFile*> filesUsed = getFilesUsed (LDFile::current()); +{ QList<LDFile*> filesUsed = getFilesUsed (LDFile::current()); // Anything that's explicitly opened must not be closed for (LDFile* file : g_loadedFiles) @@ -1021,7 +1021,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -List<LDObject*> LDFile::inlineContents (LDSubfile::InlineFlags flags) +QList<LDObject*> LDFile::inlineContents (LDSubfile::InlineFlags flags) { // Possibly substitute with logoed studs: // stud.dat -> stud-logo.dat // stud2.dat -> stud-logo2.dat @@ -1033,7 +1033,7 @@ return g_logoedStud2->inlineContents (flags); } - List<LDObject*> objs, objcache; + QList<LDObject*> objs, objcache; bool deep = flags & LDSubfile::DeepInline, doCache = flags & LDSubfile::CacheInline; @@ -1060,7 +1060,7 @@ // We only want to cache immediate subfiles, so shed the caching // flag when recursing deeper in hierarchy. - List<LDObject*> otherobjs = ref->inlineContents (flags & ~ (LDSubfile::CacheInline)); + QList<LDObject*> otherobjs = ref->inlineContents (flags & ~ (LDSubfile::CacheInline)); for (LDObject * otherobj : otherobjs) { // Cache this object, if desired
--- a/src/file.h Wed Oct 16 16:40:42 2013 +0300 +++ b/src/file.h Wed Oct 16 16:47:40 2013 +0300 @@ -53,13 +53,13 @@ // ============================================================================= class LDFile : public QObject { Q_OBJECT - READ_PROPERTY (List<LDObject*>, objects, setObjects) + READ_PROPERTY (QList<LDObject*>, objects, setObjects) READ_PROPERTY (History, history, setHistory) - READ_PROPERTY (List<LDObject*>, vertices, setVertices) + READ_PROPERTY (QList<LDObject*>, vertices, setVertices) PROPERTY (str, name, setName) PROPERTY (str, defaultName, setDefaultName) PROPERTY (bool, implicit, setImplicit) - PROPERTY (List<LDObject*>, cache, setCache) + PROPERTY (QList<LDObject*>, cache, setCache) PROPERTY (long, savePos, setSavePos) DECLARE_PROPERTY (QListWidgetItem*, listItem, setListItem) @@ -68,11 +68,11 @@ ~LDFile(); int addObject (LDObject* obj); // Adds an object to this file at the end of the file. - void addObjects (const List<LDObject*> objs); + void addObjects (const QList<LDObject*> objs); void forgetObject (LDObject* obj); // Deletes the given object from the object chain. str getShortName(); bool hasUnsavedChanges() const; // Does this file have unsaved changes? - List<LDObject*> inlineContents (LDSubfile::InlineFlags flags); + QList<LDObject*> inlineContents (LDSubfile::InlineFlags flags); void insertObj (int pos, LDObject* obj); int numObjs() const; LDObject* object (int pos) const; @@ -151,16 +151,16 @@ // Is it safe to close all files? bool safeToCloseAll(); -List<LDObject*> loadFileContents (File* f, int* numWarnings, bool* ok = null); +QList<LDObject*> loadFileContents (File* f, int* numWarnings, bool* ok = null); -extern List<LDFile*> g_loadedFiles; +extern QList<LDFile*> g_loadedFiles; void addRecentFile (str path); void loadLogoedStuds(); str basename (str path); str dirname (str path); -extern List<LDFile*> g_loadedFiles; // Vector of all currently opened files. +extern QList<LDFile*> g_loadedFiles; // Vector of all currently opened files. // ============================================================================= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -172,11 +172,11 @@ // ============================================================================= class FileLoader : public QObject { Q_OBJECT - READ_PROPERTY (List<LDObject*>, objs, setObjects) + READ_PROPERTY (QList<LDObject*>, objs, setObjects) READ_PROPERTY (bool, done, setDone) READ_PROPERTY (int, progress, setProgress) READ_PROPERTY (bool, aborted, setAborted) - PROPERTY (List<str>, lines, setLines) + PROPERTY (QList<str>, lines, setLines) PROPERTY (int*, warningsPointer, setWarningsPointer) PROPERTY (bool, concurrent, setConcurrent)
--- a/src/gldraw.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/gldraw.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -96,7 +96,7 @@ }; static bool g_glInvert = false; -static List<short> g_warnedColors; +static QList<short> g_warnedColors; // ============================================================================= // ----------------------------------------------------------------------------- @@ -845,7 +845,7 @@ case LDObject::Subfile: { LDSubfile* ref = static_cast<LDSubfile*> (obj); - List<LDObject*> objs; + QList<LDObject*> objs; objs = ref->inlineContents ( LDSubfile::DeepInline | @@ -1142,7 +1142,7 @@ // Clear the selection if we do not wish to add to it. if (!m_addpick) - { List<LDObject*> oldsel = g_win->sel(); + { QList<LDObject*> oldsel = g_win->sel(); g_win->sel().clear(); for (LDObject* obj : oldsel) @@ -1338,8 +1338,8 @@ { (void) accept; // Clean the selection and create the object - List<vertex>& verts = m_drawedVerts; - List<LDObject*> objs; + QList<vertex>& verts = m_drawedVerts; + QList<LDObject*> objs; switch (editMode()) { case Draw: @@ -1427,7 +1427,7 @@ } else { // Last resort: draw the ring with quads - List<QLineF> c0, c1; + QList<QLineF> c0, c1; makeCircle (segs, divs, dist0, c0); makeCircle (segs, divs, dist1, c1); @@ -1492,8 +1492,8 @@ // ============================================================================= // ----------------------------------------------------------------------------- -static List<vertex> getVertices (LDObject* obj) -{ List<vertex> verts; +static QList<vertex> getVertices (LDObject* obj) +{ QList<vertex> verts; if (obj->vertices() >= 2) { for (int i = 0; i < obj->vertices(); ++i) @@ -1501,7 +1501,7 @@ } elif (obj->getType() == LDObject::Subfile) { LDSubfile* ref = static_cast<LDSubfile*> (obj); - List<LDObject*> objs = ref->inlineContents (LDSubfile::DeepCacheInline); + QList<LDObject*> objs = ref->inlineContents (LDSubfile::DeepCacheInline); for (LDObject * obj : objs) { verts << getVertices (obj); @@ -1531,7 +1531,7 @@ } // Mark in known vertices of this object - List<vertex> verts = getVertices (obj); + QList<vertex> verts = getVertices (obj); m_knownVerts << verts; removeDuplicates (m_knownVerts);
--- a/src/gldraw.h Wed Oct 16 16:40:42 2013 +0300 +++ b/src/gldraw.h Wed Oct 16 16:47:40 2013 +0300 @@ -159,13 +159,13 @@ int m_width, m_height, m_totalmove; - List<vertex> m_drawedVerts; + QList<vertex> m_drawedVerts; bool m_rectdraw; vertex m_rectverts[4]; QColor m_bgcolor; double m_depthValues[6]; LDGLOverlay m_overlays[6]; - List<vertex> m_knownVerts; + QList<vertex> m_knownVerts; bool m_panning; void addDrawnVertex (vertex m_hoverpos);
--- a/src/gui.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/gui.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -167,8 +167,8 @@ // ============================================================================= // ----------------------------------------------------------------------------- -List<LDQuickColor> quickColorsFromConfig() -{ List<LDQuickColor> colors; +QList<LDQuickColor> quickColorsFromConfig() +{ QList<LDQuickColor> colors; for (str colorname : gui_colortoolbar.value.split (":")) { if (colorname == "|") @@ -251,7 +251,7 @@ { if (m_sel.size() == 0) return 0; - List<LDObject*> selCopy = m_sel; + QList<LDObject*> selCopy = m_sel; int num = 0; // Delete the objects that were being selected @@ -402,7 +402,7 @@ if (m_renderer->picking()) return; - List<LDObject*> priorSelection = m_sel; + QList<LDObject*> priorSelection = m_sel; // Get the objects from the object list selection m_sel.clear(); @@ -617,7 +617,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -void ForgeWindow::deleteObjVector (List<LDObject*> objs) +void ForgeWindow::deleteObjVector (QList<LDObject*> objs) { for (LDObject * obj : objs) { LDFile::current()->forgetObject (obj); delete obj; @@ -627,7 +627,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- void ForgeWindow::deleteByColor (const short colnum) -{ List<LDObject*> objs; +{ QList<LDObject*> objs; for (LDObject * obj : LDFile::current()->objects()) { if (!obj->isColored() || obj->color() != colnum)
--- a/src/gui.h Wed Oct 16 16:40:42 2013 +0300 +++ b/src/gui.h Wed Oct 16 16:47:40 2013 +0300 @@ -110,7 +110,7 @@ LDObject::Type uniformSelectedType(); void scrollToSelection(); void spawnContextMenu (const QPoint pos); - void deleteObjVector (List< LDObject* > objs); + void deleteObjVector (QList< LDObject* > objs); int deleteSelection(); void deleteByColor (const short int colnum); void save (LDFile* f, bool saveAs); @@ -119,11 +119,11 @@ { return m_renderer; } - inline List<LDObject*>& sel() + inline QList<LDObject*>& sel() { return m_sel; } - inline void setQuickColors (List<LDQuickColor>& colors) + inline void setQuickColors (QList<LDQuickColor>& colors) { m_quickColors = colors; } @@ -152,10 +152,10 @@ GLRenderer* m_renderer; QProgressBar* m_primLoaderBar; QWidget* m_primLoaderWidget; - List<LDObject*> m_sel; - List<LDQuickColor> m_quickColors; - List<QToolButton*> m_colorButtons; - List<QAction*> m_recentFiles; + QList<LDObject*> m_sel; + QList<LDQuickColor> m_quickColors; + QList<QToolButton*> m_colorButtons; + QList<QAction*> m_recentFiles; MessageManager* m_msglog; Ui_LDForgeUI* ui; @@ -181,7 +181,7 @@ // ----------------------------------------------------------------------------- // Other GUI-related stuff not directly part of ForgeWindow: QPixmap getIcon (str iconName); // Get an icon from the resource dir -List<LDQuickColor> quickColorsFromConfig(); // Make a list of quick colors based on config +QList<LDQuickColor> quickColorsFromConfig(); // Make a list of quick colors based on config bool confirm (str title, str msg); // Generic confirm prompt bool confirm (str msg); // Generic confirm prompt void critical (str msg); // Generic error prompt @@ -194,7 +194,7 @@ // Takes in pairs of radio buttons and respective values and returns the value of // the first found radio button that was checked. // ============================================================================= -template<class T> T radioSwitch (const T& defval, List<pair<QRadioButton*, T>> haystack) +template<class T> T radioSwitch (const T& defval, QList<pair<QRadioButton*, T>> haystack) { for (pair<QRadioButton*, const T&> i : haystack) if (i.first->isChecked()) return i.second; @@ -207,7 +207,7 @@ // Takes in pairs of radio buttons and respective values and checks the first // found radio button to have the given value. // ============================================================================= -template<class T> void radioDefault (const T& expr, List<pair<QRadioButton*, T>> haystack) +template<class T> void radioDefault (const T& expr, QList<pair<QRadioButton*, T>> haystack) { for (pair<QRadioButton*, const T&> i : haystack) { if (i.second == expr) { i.first->setChecked (true);
--- a/src/gui_actions.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/gui_actions.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -362,7 +362,7 @@ return; } - List<LDObject*> objs = loadFileContents (&f, null); + QList<LDObject*> objs = loadFileContents (&f, null); g_win->sel().clear();
--- a/src/gui_editactions.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/gui_editactions.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -41,7 +41,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- static int copyToClipboard() -{ List<LDObject*> objs = g_win->sel(); +{ QList<LDObject*> objs = g_win->sel(); int num = 0; // Clear the clipboard first. @@ -108,7 +108,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- static void doInline (bool deep) -{ List<LDObject*> sel = g_win->sel(); +{ QList<LDObject*> sel = g_win->sel(); for (LDObject* obj : sel) { // Get the index of the subfile so we know where to insert the @@ -118,7 +118,7 @@ if (idx == -1) continue; - List<LDObject*> objs; + QList<LDObject*> objs; if (obj->getType() == LDObject::Subfile) objs = static_cast<LDSubfile*> (obj)->inlineContents ( @@ -159,7 +159,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- DEFINE_ACTION (SplitQuads, 0) -{ List<LDObject*> objs = g_win->sel(); +{ QList<LDObject*> objs = g_win->sel(); int num = 0; for (LDObject* obj : objs) @@ -172,7 +172,7 @@ if (index == -1) return; - List<LDTriangle*> triangles = static_cast<LDQuad*> (obj)->splitToTriangles(); + QList<LDTriangle*> triangles = static_cast<LDQuad*> (obj)->splitToTriangles(); // Replace the quad with the first triangle and add the second triangle // after the first one. @@ -235,7 +235,7 @@ short colnum; short defcol = -1; - List<LDObject*> objs = g_win->sel(); + QList<LDObject*> objs = g_win->sel(); // If all selected objects have the same color, said color is our default // value to the color selection dialog. @@ -258,7 +258,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- DEFINE_ACTION (Borders, CTRL_SHIFT (B)) -{ List<LDObject*> objs = g_win->sel(); +{ QList<LDObject*> objs = g_win->sel(); int num = 0; for (LDObject* obj : objs) @@ -330,7 +330,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- static void doMoveSelection (const bool up) -{ List<LDObject*> objs = g_win->sel(); +{ QList<LDObject*> objs = g_win->sel(); LDObject::moveObjects (objs, up); g_win->buildObjList(); } @@ -400,7 +400,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- DEFINE_ACTION (Invert, CTRL_SHIFT (W)) -{ List<LDObject*> sel = g_win->sel(); +{ QList<LDObject*> sel = g_win->sel(); for (LDObject* obj : sel) { obj->invert(); @@ -421,8 +421,8 @@ // ============================================================================= // ----------------------------------------------------------------------------- static void doRotate (const short l, const short m, const short n) -{ List<LDObject*> sel = g_win->sel(); - List<vertex*> queue; +{ QList<LDObject*> sel = g_win->sel(); + QList<vertex*> queue; const vertex rotpoint = rotPoint (sel); const double angle = (pi * currentGrid().confs[Grid::Angle]->value) / 180, cosangle = cos (angle), @@ -564,7 +564,7 @@ const bool any = ui.any->isChecked(), rel = ui.relative->isChecked(); - List<Axis> sel; + QList<Axis> sel; int num = 0; if (ui.x->isChecked()) sel << X; @@ -607,7 +607,7 @@ if (!dlg->exec()) return; - List<Axis> sel; + QList<Axis> sel; if (ui.x->isChecked()) sel << X; if (ui.y->isChecked()) sel << Y; @@ -630,7 +630,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- DEFINE_ACTION (Demote, 0) -{ List<LDObject*> sel = g_win->sel(); +{ QList<LDObject*> sel = g_win->sel(); int num = 0; for (LDObject* obj : sel)
--- a/src/history.h Wed Oct 16 16:40:42 2013 +0300 +++ b/src/history.h Wed Oct 16 16:47:40 2013 +0300 @@ -37,7 +37,7 @@ READ_PROPERTY (bool, opened, setOpened) public: - typedef List<AbstractHistoryEntry*> Changeset; + typedef QList<AbstractHistoryEntry*> Changeset; enum Type { Del, @@ -72,7 +72,7 @@ private: Changeset m_currentArchive; - List<Changeset> m_changesets; + QList<Changeset> m_changesets; }; // ============================================================================= @@ -160,10 +160,10 @@ { public: IMPLEMENT_HISTORY_TYPE (Move) - List<int> indices; + QList<int> indices; vertex dest; - MoveHistory (List<int> indices, vertex dest) : + MoveHistory (QList<int> indices, vertex dest) : indices (indices), dest (dest) {} };
--- a/src/ldtypes.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/ldtypes.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -30,7 +30,7 @@ cfg (Int, ld_defaultlicense, 0); // List of all LDObjects -List<LDObject*> g_LDObjects; +QList<LDObject*> g_LDObjects; // ============================================================================= // LDObject constructors @@ -192,7 +192,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -List<LDTriangle*> LDQuad::splitToTriangles() +QList<LDTriangle*> LDQuad::splitToTriangles() { // Create the two triangles based on this quadrilateral: // 0---3 0---3 3 // | | | / /| @@ -206,7 +206,7 @@ tri1->setColor (color()); tri2->setColor (color()); - List<LDTriangle*> triangles; + QList<LDTriangle*> triangles; triangles << tri1; triangles << tri2; return triangles; @@ -300,8 +300,8 @@ // ============================================================================= // ----------------------------------------------------------------------------- -List<LDObject*> LDSubfile::inlineContents (InlineFlags flags) -{ List<LDObject*> objs = fileInfo()->inlineContents (flags); +QList<LDObject*> LDSubfile::inlineContents (InlineFlags flags) +{ QList<LDObject*> objs = fileInfo()->inlineContents (flags); // Transform the objects for (LDObject * obj : objs) @@ -330,7 +330,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -void LDObject::moveObjects (List<LDObject*> objs, const bool up) +void LDObject::moveObjects (QList<LDObject*> objs, const bool up) { if (objs.size() == 0) return; @@ -338,7 +338,7 @@ const long start = up ? 0 : (objs.size() - 1); const long end = up ? objs.size() : -1; const long incr = up ? 1 : -1; - List<LDObject*> objsToCompile; + QList<LDObject*> objsToCompile; LDFile* file = objs[0]->file(); for (long i = start; i != end; i += incr) @@ -380,7 +380,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -str LDObject::objectListContents (const List<LDObject*>& objs) +str LDObject::objectListContents (const QList<LDObject*>& objs) { bool firstDetails = true; str text = "";
--- a/src/ldtypes.h Wed Oct 16 16:40:42 2013 +0300 +++ b/src/ldtypes.h Wed Oct 16 16:47:40 2013 +0300 @@ -116,8 +116,8 @@ static str typeName (LDObject::Type type); // Get type name by enumerator static LDObject* getDefault (const LDObject::Type type); // Returns a sample object by the given enumerator - static void moveObjects (List<LDObject*> objs, const bool up); // TODO: move this to LDFile? - static str objectListContents (const List<LDObject*>& objs); // Get a description of a list of LDObjects + static void moveObjects (QList<LDObject*> objs, const bool up); // TODO: move this to LDFile? + static str objectListContents (const QList<LDObject*>& objs); // Get a description of a list of LDObjects static LDObject* fromID (int id); // TODO: make these private! @@ -301,7 +301,7 @@ // Inlines this subfile. Note that return type is an array of heap-allocated // LDObject-clones, they must be deleted one way or another. - List<LDObject*> inlineContents (InlineFlags flags); + QList<LDObject*> inlineContents (InlineFlags flags); }; Q_DECLARE_OPERATORS_FOR_FLAGS (LDSubfile::InlineFlags) @@ -387,7 +387,7 @@ LDQuad() {} // Split this quad into two triangles (note: heap-allocated) - List<LDTriangle*> splitToTriangles(); + QList<LDTriangle*> splitToTriangles(); }; // =============================================================================
--- a/src/main.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/main.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -31,7 +31,7 @@ #include "gldraw.h" #include "configDialog.h" -List<LDFile*> g_loadedFiles; +QList<LDFile*> g_loadedFiles; ForgeWindow* g_win = null; const QApplication* g_app = null; File g_file_stdout (stdout, File::Write);
--- a/src/messagelog.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/messagelog.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -108,7 +108,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -const List<MessageManager::Line>& MessageManager::getLines() const +const QList<MessageManager::Line>& MessageManager::getLines() const { return m_lines; }
--- a/src/messagelog.h Wed Oct 16 16:40:42 2013 +0300 +++ b/src/messagelog.h Wed Oct 16 16:47:40 2013 +0300 @@ -55,10 +55,10 @@ explicit MessageManager (QObject* parent = 0); void addLine (str line); - const List<Line>& getLines() const; + const QList<Line>& getLines() const; private: - List<Line> m_lines; + QList<Line> m_lines; QTimer* m_ticker; private slots:
--- a/src/misc.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/misc.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -208,7 +208,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -vertex rotPoint (const List<LDObject*>& objs) +vertex rotPoint (const QList<LDObject*>& objs) { LDBoundingBox box; switch (edit_rotpoint)
--- a/src/misc.h Wed Oct 16 16:40:42 2013 +0300 +++ b/src/misc.h Wed Oct 16 16:47:40 2013 +0300 @@ -65,7 +65,7 @@ CustomPoint }; -vertex rotPoint (const List<LDObject*>& objs); +vertex rotPoint (const QList<LDObject*>& objs); void configRotationPoint(); // ============================================================================= @@ -98,7 +98,7 @@ double scale; }; - typedef List<SolutionComponent> SolutionType; + typedef QList<SolutionComponent> SolutionType; RingFinder() {} bool findRings (double r0, double r1);
--- a/src/primitives.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/primitives.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -28,8 +28,8 @@ #include "colors.h" #include "moc_primitives.cpp" -List<PrimitiveCategory> g_PrimitiveCategories; -List<Primitive> g_primitives; +QList<PrimitiveCategory> g_PrimitiveCategories; +QList<Primitive> g_primitives; static PrimitiveLister* g_activePrimLister = null; static bool g_primListerMutex = false; static const str g_Other = PrimitiveLister::tr ("Other"); @@ -79,7 +79,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -static void recursiveGetFilenames (QDir dir, List<str>& fnames) +static void recursiveGetFilenames (QDir dir, QList<str>& fnames) { QFileInfoList flist = dir.entryInfoList(); for (const QFileInfo & info : flist) @@ -102,7 +102,7 @@ QDir dir (LDPaths::prims()); int baselen = dir.absolutePath().length(); int i = 0; - List<str> fnames; + QList<str> fnames; assert (dir.exists()); recursiveGetFilenames (dir, fnames); @@ -300,7 +300,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -void makeCircle (int segs, int divs, double radius, List<QLineF>& lines) +void makeCircle (int segs, int divs, double radius, QList<QLineF>& lines) { for (int i = 0; i < segs; ++i) { double x0 = radius * radialPoint (i, divs, cos), x1 = radius * radialPoint (i + 1, divs, cos), @@ -313,10 +313,10 @@ // ============================================================================= // ----------------------------------------------------------------------------- -List<LDObject*> makePrimitive (PrimitiveType type, int segs, int divs, int num) -{ List<LDObject*> objs; - List<int> condLineSegs; - List<QLineF> circle; +QList<LDObject*> makePrimitive (PrimitiveType type, int segs, int divs, int num) +{ QList<LDObject*> objs; + QList<int> condLineSegs; + QList<QLineF> circle; makeCircle (segs, divs, 1, circle);
--- a/src/primitives.h Wed Oct 16 16:40:42 2013 +0300 +++ b/src/primitives.h Wed Oct 16 16:47:40 2013 +0300 @@ -46,9 +46,9 @@ Type type; }; - List<RegexEntry> regexes; - List<Primitive> prims; - static List<Primitive> uncat; + QList<RegexEntry> regexes; + QList<Primitive> prims; + static QList<Primitive> uncat; }; // ============================================================================= @@ -74,10 +74,10 @@ void update (int i); private: - List<Primitive> m_prims; + QList<Primitive> m_prims; }; -extern List<PrimitiveCategory> g_PrimitiveCategories; +extern QList<PrimitiveCategory> g_PrimitiveCategories; void loadPrimitives(); bool primitiveLoaderBusy(); @@ -104,7 +104,7 @@ void hiResToggled (bool on); }; -void makeCircle (int segs, int divs, double radius, List<QLineF>& lines); +void makeCircle (int segs, int divs, double radius, QList<QLineF>& lines); LDFile* generatePrimitive (PrimitiveType type, int segs, int divs, int num); // Gets a primitive by the given specs. If the primitive cannot be found, it will
--- a/src/types.cpp Wed Oct 16 16:40:42 2013 +0300 +++ b/src/types.cpp Wed Oct 16 16:47:40 2013 +0300 @@ -29,7 +29,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -str DoFormat (List<StringFormatArg> args) +str DoFormat (QList<StringFormatArg> args) { assert (args.size() >= 1); str text = args[0].value(); @@ -523,7 +523,7 @@ case LDObject::Subfile: { LDSubfile* ref = static_cast<LDSubfile*> (obj); - List<LDObject*> objs = ref->inlineContents (LDSubfile::DeepCacheInline); + QList<LDObject*> objs = ref->inlineContents (LDSubfile::DeepCacheInline); for (LDObject * obj : objs) { calcObject (obj);
--- a/src/types.h Wed Oct 16 16:40:42 2013 +0300 +++ b/src/types.h Wed Oct 16 16:47:40 2013 +0300 @@ -46,7 +46,6 @@ typedef quint32 uint32; typedef quint64 uint64; -template<class T> using List = QList<T>; template<class T> using initlist = std::initializer_list<T>; template<class T, class R> using pair = std::pair<T, R>; using std::size_t; @@ -204,7 +203,7 @@ StringFormatArg (const FloatConfig& v); StringFormatArg (const void* v); - template<class T> StringFormatArg (const List<T>& v) + template<class T> StringFormatArg (const QList<T>& v) { m_val = "{ "; int i = 0; @@ -313,7 +312,7 @@ }; // Formatter function -str DoFormat (List<StringFormatArg> args); +str DoFormat (QList<StringFormatArg> args); // printf replacement void doPrint (File& f, initlist<StringFormatArg> args);
--- a/src/widgets.h Wed Oct 16 16:40:42 2013 +0300 +++ b/src/widgets.h Wed Oct 16 16:47:40 2013 +0300 @@ -40,7 +40,7 @@ { Q_OBJECT public: - typedef List<QRadioButton*>::Iterator Iterator; + typedef QList<QRadioButton*>::Iterator Iterator; explicit RadioGroup() { init (Qt::Vertical); @@ -75,8 +75,8 @@ void valueChanged (int val); private: - List<QRadioButton*> m_objects; - List<QBoxLayout*> m_layouts; + QList<QRadioButton*> m_objects; + QList<QBoxLayout*> m_layouts; QBoxLayout* m_coreLayout; QBoxLayout* m_currentLayout; bool m_vert;