# HG changeset patch # User Santeri Piippo # Date 1371248986 -10800 # Node ID d7bf5c11d299794afdc4d0621c64496efcd802d2 # Parent 2980d7fd948e6b1e8d73f4ae32f33fdd92cf1863 Nuked parts.lst parsing, that was stupid diff -r 2980d7fd948e -r d7bf5c11d299 src/addObjectDialog.cpp --- a/src/addObjectDialog.cpp Sat Jun 15 01:20:07 2013 +0300 +++ b/src/addObjectDialog.cpp Sat Jun 15 01:29:46 2013 +0300 @@ -102,6 +102,7 @@ }; tw_subfileList = new QTreeWidget (); +/* for (int i : vector ({Parts, Subparts, Primitives, HiRes})) { SubfileListItem* parentItem = new SubfileListItem (tw_subfileList, -1); parentItem->setText (0, (i == Parts) ? "Parts" : @@ -133,6 +134,7 @@ tw_subfileList->addTopLevelItem (parentItem); } +*/ connect (tw_subfileList, SIGNAL (itemSelectionChanged ()), this, SLOT (slot_subfileTypeChanged ())); lb_subfileName = new QLabel ("File:"); @@ -308,13 +310,8 @@ // ============================================================================= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= -str AddObjectDialog::currentSubfileName() { - SubfileListItem* item = static_cast (tw_subfileList->currentItem ()); - - if (item->subfileID == -1) - return ""; // selected a heading - - return g_PartList[item->subfileID].name; +str AddObjectDialog::currentSubfileName () { + return ""; } // ============================================================================= diff -r 2980d7fd948e -r d7bf5c11d299 src/file.cpp --- a/src/file.cpp Sat Jun 15 01:20:07 2013 +0300 +++ b/src/file.cpp Sat Jun 15 01:29:46 2013 +0300 @@ -861,30 +861,6 @@ } // ============================================================================= -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -// ============================================================================= -vector g_PartList; - -void initPartList () { - File* f = openLDrawFile ("parts.lst", false); - - if (!f) - return; - - for (str line : *f) { - int white = line.indexOf (" "); - str name = line.left (white); - str title = line.mid (white + 1); - - // Add it to the array. - partListEntry entry = { name, title }; - g_PartList << entry; - } - - delete f; -} - -// ============================================================================= bool safeToCloseAll () { for (LDOpenFile* f : g_loadedFiles) if (!f->safeToClose ()) diff -r 2980d7fd948e -r d7bf5c11d299 src/file.h --- a/src/file.h Sat Jun 15 01:20:07 2013 +0300 +++ b/src/file.h Sat Jun 15 01:29:46 2013 +0300 @@ -131,17 +131,9 @@ // Is it safe to close all files? bool safeToCloseAll (); -typedef struct { - str name, title; -} partListEntry; - -// Init and parse parts.lst -void initPartList (); - vector loadFileContents (File* f, ulong* numWarnings, bool* ok = null); extern vector g_loadedFiles; -extern vector g_PartList; str basename (str path); str dirname (str path); diff -r 2980d7fd948e -r d7bf5c11d299 src/main.cpp --- a/src/main.cpp Sat Jun 15 01:20:07 2013 +0300 +++ b/src/main.cpp Sat Jun 15 01:29:46 2013 +0300 @@ -75,7 +75,6 @@ LDPaths::initPaths (); initColors (); - initPartList (); ForgeWindow* win = new ForgeWindow; newFile ();