Nuked parts.lst parsing, that was stupid

Sat, 15 Jun 2013 01:29:46 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sat, 15 Jun 2013 01:29:46 +0300
changeset 289
d7bf5c11d299
parent 288
2980d7fd948e
child 290
be0c367e7420

Nuked parts.lst parsing, that was stupid

src/addObjectDialog.cpp file | annotate | diff | comparison | revisions
src/file.cpp file | annotate | diff | comparison | revisions
src/file.h file | annotate | diff | comparison | revisions
src/main.cpp file | annotate | diff | comparison | revisions
--- 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<int> ({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<SubfileListItem*> (tw_subfileList->currentItem ());
-	
-	if (item->subfileID == -1)
-		return ""; // selected a heading
-	
-	return g_PartList[item->subfileID].name;
+str AddObjectDialog::currentSubfileName () {
+	return "";
 }
 
 // =============================================================================
--- 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<partListEntry> 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 ())
--- 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<LDObject*> loadFileContents (File* f, ulong* numWarnings, bool* ok = null);
 
 extern vector<LDOpenFile*> g_loadedFiles;
-extern vector<partListEntry> g_PartList;
 
 str basename (str path);
 str dirname (str path);
--- 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 ();

mercurial