# HG changeset patch # User Santeri Piippo # Date 1381931260 -10800 # Node ID 6a1fa662bfc171f7e8cd3c5fdc7e042e5f7c4462 # Parent bebe09014dd611d6a592b5504ab404b6839449d8 Removed the List -> QList alias, use QList directly diff -r bebe09014dd6 -r 6a1fa662bfc1 src/configDialog.cpp --- 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& haystack) +int ConfigDialog::getItemRow (QListWidgetItem* item, QList& haystack) { int i = 0; for (QListWidgetItem * it : haystack) diff -r bebe09014dd6 -r 6a1fa662bfc1 src/configDialog.h --- 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 quickColors; + QList quickColors; QDoubleSpinBox* dsb_gridData[3][4]; private: Ui_ConfigUI* ui; QLabel* lb_gridLabels[3]; QLabel* lb_gridIcons[3]; - List quickColorItems; + QList 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& haystack); + int getItemRow (QListWidgetItem* item, QList& haystack); str quickColorString(); QListWidgetItem* getSelectedQuickColor(); QList getShortcutSelection(); diff -r bebe09014dd6 -r 6a1fa662bfc1 src/dialogs.h --- 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> m_cameraArgs; + QList> m_cameraArgs; private slots: void slot_fpath(); diff -r bebe09014dd6 -r 6a1fa662bfc1 src/download.cpp --- 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); diff -r bebe09014dd6 -r 6a1fa662bfc1 src/download.h --- 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 m_filesToDownload; - List m_requests; + QList m_filesToDownload; + QList m_requests; QPushButton* m_downloadButton; }; diff -r bebe09014dd6 -r 6a1fa662bfc1 src/extprogs.cpp --- 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& objects, File& f) +void writeObjects (QList& objects, File& f) { for (LDObject * obj : objects) { if (obj->getType() == LDObject::Subfile) { LDSubfile* ref = static_cast (obj); - List objs = ref->inlineContents (LDSubfile::DeepInline); + QList objs = ref->inlineContents (LDSubfile::DeepInline); writeObjects (objs, f); @@ -166,7 +166,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -void writeObjects (List& objects, str fname) +void writeObjects (QList& objects, str fname) { // Write the input file File f (fname, File::Write); @@ -188,7 +188,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- void writeColorGroup (const short colnum, str fname) -{ List objects; +{ QList 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 colorsToReplace) +static void insertOutput (str fname, bool replace, QList colorsToReplace) { #ifndef RELEASE QFile::copy (fname, "./debug_lastOutput"); @@ -274,7 +274,7 @@ return; } - List objs = loadFileContents (&f, null); + QList objs = loadFileContents (&f, null); // If we replace the objects, delete the selection now. if (replace) diff -r bebe09014dd6 -r 6a1fa662bfc1 src/file.cpp --- 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 loadFileContents (File* f, int* numWarnings, bool* ok) -{ List lines; - List objs; +QList loadFileContents (File* f, int* numWarnings, bool* ok) +{ QList lines; + QList objs; if (numWarnings) *numWarnings = 0; @@ -417,7 +417,7 @@ int numWarnings; bool ok; - List objs = loadFileContents (f, &numWarnings, &ok); + QList 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 files = g_loadedFiles; + QList files = g_loadedFiles; for (LDFile * file : files) delete file; @@ -883,7 +883,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -void LDFile::addObjects (const List objs) +void LDFile::addObjects (const QList objs) { for (LDObject * obj : objs) if (obj) addObject (obj); @@ -932,8 +932,8 @@ // ============================================================================= // ----------------------------------------------------------------------------- -static List getFilesUsed (LDFile* node) -{ List filesUsed; +static QList getFilesUsed (LDFile* node) +{ QList 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 filesUsed = getFilesUsed (LDFile::current()); +{ QList filesUsed = getFilesUsed (LDFile::current()); // Anything that's explicitly opened must not be closed for (LDFile* file : g_loadedFiles) @@ -1021,7 +1021,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -List LDFile::inlineContents (LDSubfile::InlineFlags flags) +QList 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 objs, objcache; + QList 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 otherobjs = ref->inlineContents (flags & ~ (LDSubfile::CacheInline)); + QList otherobjs = ref->inlineContents (flags & ~ (LDSubfile::CacheInline)); for (LDObject * otherobj : otherobjs) { // Cache this object, if desired diff -r bebe09014dd6 -r 6a1fa662bfc1 src/file.h --- 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, objects, setObjects) + READ_PROPERTY (QList, objects, setObjects) READ_PROPERTY (History, history, setHistory) - READ_PROPERTY (List, vertices, setVertices) + READ_PROPERTY (QList, vertices, setVertices) PROPERTY (str, name, setName) PROPERTY (str, defaultName, setDefaultName) PROPERTY (bool, implicit, setImplicit) - PROPERTY (List, cache, setCache) + PROPERTY (QList, 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 objs); + void addObjects (const QList 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 inlineContents (LDSubfile::InlineFlags flags); + QList 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 loadFileContents (File* f, int* numWarnings, bool* ok = null); +QList loadFileContents (File* f, int* numWarnings, bool* ok = null); -extern List g_loadedFiles; +extern QList g_loadedFiles; void addRecentFile (str path); void loadLogoedStuds(); str basename (str path); str dirname (str path); -extern List g_loadedFiles; // Vector of all currently opened files. +extern QList g_loadedFiles; // Vector of all currently opened files. // ============================================================================= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -172,11 +172,11 @@ // ============================================================================= class FileLoader : public QObject { Q_OBJECT - READ_PROPERTY (List, objs, setObjects) + READ_PROPERTY (QList, objs, setObjects) READ_PROPERTY (bool, done, setDone) READ_PROPERTY (int, progress, setProgress) READ_PROPERTY (bool, aborted, setAborted) - PROPERTY (List, lines, setLines) + PROPERTY (QList, lines, setLines) PROPERTY (int*, warningsPointer, setWarningsPointer) PROPERTY (bool, concurrent, setConcurrent) diff -r bebe09014dd6 -r 6a1fa662bfc1 src/gldraw.cpp --- 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 g_warnedColors; +static QList g_warnedColors; // ============================================================================= // ----------------------------------------------------------------------------- @@ -845,7 +845,7 @@ case LDObject::Subfile: { LDSubfile* ref = static_cast (obj); - List objs; + QList 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 oldsel = g_win->sel(); + { QList 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& verts = m_drawedVerts; - List objs; + QList& verts = m_drawedVerts; + QList objs; switch (editMode()) { case Draw: @@ -1427,7 +1427,7 @@ } else { // Last resort: draw the ring with quads - List c0, c1; + QList c0, c1; makeCircle (segs, divs, dist0, c0); makeCircle (segs, divs, dist1, c1); @@ -1492,8 +1492,8 @@ // ============================================================================= // ----------------------------------------------------------------------------- -static List getVertices (LDObject* obj) -{ List verts; +static QList getVertices (LDObject* obj) +{ QList 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 (obj); - List objs = ref->inlineContents (LDSubfile::DeepCacheInline); + QList objs = ref->inlineContents (LDSubfile::DeepCacheInline); for (LDObject * obj : objs) { verts << getVertices (obj); @@ -1531,7 +1531,7 @@ } // Mark in known vertices of this object - List verts = getVertices (obj); + QList verts = getVertices (obj); m_knownVerts << verts; removeDuplicates (m_knownVerts); diff -r bebe09014dd6 -r 6a1fa662bfc1 src/gldraw.h --- 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 m_drawedVerts; + QList m_drawedVerts; bool m_rectdraw; vertex m_rectverts[4]; QColor m_bgcolor; double m_depthValues[6]; LDGLOverlay m_overlays[6]; - List m_knownVerts; + QList m_knownVerts; bool m_panning; void addDrawnVertex (vertex m_hoverpos); diff -r bebe09014dd6 -r 6a1fa662bfc1 src/gui.cpp --- 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 quickColorsFromConfig() -{ List colors; +QList quickColorsFromConfig() +{ QList colors; for (str colorname : gui_colortoolbar.value.split (":")) { if (colorname == "|") @@ -251,7 +251,7 @@ { if (m_sel.size() == 0) return 0; - List selCopy = m_sel; + QList selCopy = m_sel; int num = 0; // Delete the objects that were being selected @@ -402,7 +402,7 @@ if (m_renderer->picking()) return; - List priorSelection = m_sel; + QList priorSelection = m_sel; // Get the objects from the object list selection m_sel.clear(); @@ -617,7 +617,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -void ForgeWindow::deleteObjVector (List objs) +void ForgeWindow::deleteObjVector (QList objs) { for (LDObject * obj : objs) { LDFile::current()->forgetObject (obj); delete obj; @@ -627,7 +627,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- void ForgeWindow::deleteByColor (const short colnum) -{ List objs; +{ QList objs; for (LDObject * obj : LDFile::current()->objects()) { if (!obj->isColored() || obj->color() != colnum) diff -r bebe09014dd6 -r 6a1fa662bfc1 src/gui.h --- 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& sel() + inline QList& sel() { return m_sel; } - inline void setQuickColors (List& colors) + inline void setQuickColors (QList& colors) { m_quickColors = colors; } @@ -152,10 +152,10 @@ GLRenderer* m_renderer; QProgressBar* m_primLoaderBar; QWidget* m_primLoaderWidget; - List m_sel; - List m_quickColors; - List m_colorButtons; - List m_recentFiles; + QList m_sel; + QList m_quickColors; + QList m_colorButtons; + QList 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 quickColorsFromConfig(); // Make a list of quick colors based on config +QList 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 T radioSwitch (const T& defval, List> haystack) +template T radioSwitch (const T& defval, QList> haystack) { for (pair 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 void radioDefault (const T& expr, List> haystack) +template void radioDefault (const T& expr, QList> haystack) { for (pair i : haystack) { if (i.second == expr) { i.first->setChecked (true); diff -r bebe09014dd6 -r 6a1fa662bfc1 src/gui_actions.cpp --- 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 objs = loadFileContents (&f, null); + QList objs = loadFileContents (&f, null); g_win->sel().clear(); diff -r bebe09014dd6 -r 6a1fa662bfc1 src/gui_editactions.cpp --- 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 objs = g_win->sel(); +{ QList objs = g_win->sel(); int num = 0; // Clear the clipboard first. @@ -108,7 +108,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- static void doInline (bool deep) -{ List sel = g_win->sel(); +{ QList 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 objs; + QList objs; if (obj->getType() == LDObject::Subfile) objs = static_cast (obj)->inlineContents ( @@ -159,7 +159,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- DEFINE_ACTION (SplitQuads, 0) -{ List objs = g_win->sel(); +{ QList objs = g_win->sel(); int num = 0; for (LDObject* obj : objs) @@ -172,7 +172,7 @@ if (index == -1) return; - List triangles = static_cast (obj)->splitToTriangles(); + QList triangles = static_cast (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 objs = g_win->sel(); + QList 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 objs = g_win->sel(); +{ QList objs = g_win->sel(); int num = 0; for (LDObject* obj : objs) @@ -330,7 +330,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- static void doMoveSelection (const bool up) -{ List objs = g_win->sel(); +{ QList objs = g_win->sel(); LDObject::moveObjects (objs, up); g_win->buildObjList(); } @@ -400,7 +400,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- DEFINE_ACTION (Invert, CTRL_SHIFT (W)) -{ List sel = g_win->sel(); +{ QList 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 sel = g_win->sel(); - List queue; +{ QList sel = g_win->sel(); + QList 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 sel; + QList sel; int num = 0; if (ui.x->isChecked()) sel << X; @@ -607,7 +607,7 @@ if (!dlg->exec()) return; - List sel; + QList sel; if (ui.x->isChecked()) sel << X; if (ui.y->isChecked()) sel << Y; @@ -630,7 +630,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- DEFINE_ACTION (Demote, 0) -{ List sel = g_win->sel(); +{ QList sel = g_win->sel(); int num = 0; for (LDObject* obj : sel) diff -r bebe09014dd6 -r 6a1fa662bfc1 src/history.h --- 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 Changeset; + typedef QList Changeset; enum Type { Del, @@ -72,7 +72,7 @@ private: Changeset m_currentArchive; - List m_changesets; + QList m_changesets; }; // ============================================================================= @@ -160,10 +160,10 @@ { public: IMPLEMENT_HISTORY_TYPE (Move) - List indices; + QList indices; vertex dest; - MoveHistory (List indices, vertex dest) : + MoveHistory (QList indices, vertex dest) : indices (indices), dest (dest) {} }; diff -r bebe09014dd6 -r 6a1fa662bfc1 src/ldtypes.cpp --- 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 g_LDObjects; +QList g_LDObjects; // ============================================================================= // LDObject constructors @@ -192,7 +192,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -List LDQuad::splitToTriangles() +QList 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 triangles; + QList triangles; triangles << tri1; triangles << tri2; return triangles; @@ -300,8 +300,8 @@ // ============================================================================= // ----------------------------------------------------------------------------- -List LDSubfile::inlineContents (InlineFlags flags) -{ List objs = fileInfo()->inlineContents (flags); +QList LDSubfile::inlineContents (InlineFlags flags) +{ QList objs = fileInfo()->inlineContents (flags); // Transform the objects for (LDObject * obj : objs) @@ -330,7 +330,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -void LDObject::moveObjects (List objs, const bool up) +void LDObject::moveObjects (QList 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 objsToCompile; + QList objsToCompile; LDFile* file = objs[0]->file(); for (long i = start; i != end; i += incr) @@ -380,7 +380,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -str LDObject::objectListContents (const List& objs) +str LDObject::objectListContents (const QList& objs) { bool firstDetails = true; str text = ""; diff -r bebe09014dd6 -r 6a1fa662bfc1 src/ldtypes.h --- 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 objs, const bool up); // TODO: move this to LDFile? - static str objectListContents (const List& objs); // Get a description of a list of LDObjects + static void moveObjects (QList objs, const bool up); // TODO: move this to LDFile? + static str objectListContents (const QList& 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 inlineContents (InlineFlags flags); + QList 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 splitToTriangles(); + QList splitToTriangles(); }; // ============================================================================= diff -r bebe09014dd6 -r 6a1fa662bfc1 src/main.cpp --- 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 g_loadedFiles; +QList g_loadedFiles; ForgeWindow* g_win = null; const QApplication* g_app = null; File g_file_stdout (stdout, File::Write); diff -r bebe09014dd6 -r 6a1fa662bfc1 src/messagelog.cpp --- 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::getLines() const +const QList& MessageManager::getLines() const { return m_lines; } diff -r bebe09014dd6 -r 6a1fa662bfc1 src/messagelog.h --- 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& getLines() const; + const QList& getLines() const; private: - List m_lines; + QList m_lines; QTimer* m_ticker; private slots: diff -r bebe09014dd6 -r 6a1fa662bfc1 src/misc.cpp --- 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& objs) +vertex rotPoint (const QList& objs) { LDBoundingBox box; switch (edit_rotpoint) diff -r bebe09014dd6 -r 6a1fa662bfc1 src/misc.h --- 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& objs); +vertex rotPoint (const QList& objs); void configRotationPoint(); // ============================================================================= @@ -98,7 +98,7 @@ double scale; }; - typedef List SolutionType; + typedef QList SolutionType; RingFinder() {} bool findRings (double r0, double r1); diff -r bebe09014dd6 -r 6a1fa662bfc1 src/primitives.cpp --- 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 g_PrimitiveCategories; -List g_primitives; +QList g_PrimitiveCategories; +QList 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& fnames) +static void recursiveGetFilenames (QDir dir, QList& 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 fnames; + QList fnames; assert (dir.exists()); recursiveGetFilenames (dir, fnames); @@ -300,7 +300,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -void makeCircle (int segs, int divs, double radius, List& lines) +void makeCircle (int segs, int divs, double radius, QList& 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 makePrimitive (PrimitiveType type, int segs, int divs, int num) -{ List objs; - List condLineSegs; - List circle; +QList makePrimitive (PrimitiveType type, int segs, int divs, int num) +{ QList objs; + QList condLineSegs; + QList circle; makeCircle (segs, divs, 1, circle); diff -r bebe09014dd6 -r 6a1fa662bfc1 src/primitives.h --- 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 regexes; - List prims; - static List uncat; + QList regexes; + QList prims; + static QList uncat; }; // ============================================================================= @@ -74,10 +74,10 @@ void update (int i); private: - List m_prims; + QList m_prims; }; -extern List g_PrimitiveCategories; +extern QList g_PrimitiveCategories; void loadPrimitives(); bool primitiveLoaderBusy(); @@ -104,7 +104,7 @@ void hiResToggled (bool on); }; -void makeCircle (int segs, int divs, double radius, List& lines); +void makeCircle (int segs, int divs, double radius, QList& 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 diff -r bebe09014dd6 -r 6a1fa662bfc1 src/types.cpp --- 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 args) +str DoFormat (QList args) { assert (args.size() >= 1); str text = args[0].value(); @@ -523,7 +523,7 @@ case LDObject::Subfile: { LDSubfile* ref = static_cast (obj); - List objs = ref->inlineContents (LDSubfile::DeepCacheInline); + QList objs = ref->inlineContents (LDSubfile::DeepCacheInline); for (LDObject * obj : objs) { calcObject (obj); diff -r bebe09014dd6 -r 6a1fa662bfc1 src/types.h --- 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 using List = QList; template using initlist = std::initializer_list; template using pair = std::pair; using std::size_t; @@ -204,7 +203,7 @@ StringFormatArg (const FloatConfig& v); StringFormatArg (const void* v); - template StringFormatArg (const List& v) + template StringFormatArg (const QList& v) { m_val = "{ "; int i = 0; @@ -313,7 +312,7 @@ }; // Formatter function -str DoFormat (List args); +str DoFormat (QList args); // printf replacement void doPrint (File& f, initlist args); diff -r bebe09014dd6 -r 6a1fa662bfc1 src/widgets.h --- 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::Iterator Iterator; + typedef QList::Iterator Iterator; explicit RadioGroup() { init (Qt::Vertical); @@ -75,8 +75,8 @@ void valueChanged (int val); private: - List m_objects; - List m_layouts; + QList m_objects; + QList m_layouts; QBoxLayout* m_coreLayout; QBoxLayout* m_currentLayout; bool m_vert;