src/primitives.cpp

changeset 436
4268a5507725
parent 421
7d26db0be944
child 455
c5d14d112034
equal deleted inserted replaced
435:bc3a51394953 436:4268a5507725
43 void loadPrimitives() { 43 void loadPrimitives() {
44 print ("Loading primitives...\n"); 44 print ("Loading primitives...\n");
45 loadPrimitiveCatgories(); 45 loadPrimitiveCatgories();
46 46
47 // Try to load prims.cfg 47 // Try to load prims.cfg
48 File conf (config::dirpath() + "prims.cfg", File::Read); 48 File conf (config::filepath ("prims.cfg"), File::Read);
49 49
50 if (!conf) { 50 if (!conf) {
51 // No prims.cfg, build it 51 // No prims.cfg, build it
52 PrimitiveLister::start(); 52 PrimitiveLister::start();
53 } else { 53 } else {
122 m_prims << info; 122 m_prims << info;
123 emit update (++i); 123 emit update (++i);
124 } 124 }
125 125
126 // Save to a config file 126 // Save to a config file
127 File conf (config::dirpath() + "prims.cfg", File::Write); 127 File conf (config::filepath ("prims.cfg"), File::Write);
128 128
129 for (Primitive & info : m_prims) 129 for (Primitive & info : m_prims)
130 fprint (conf, "%1 %2\n", info.name, info.title); 130 fprint (conf, "%1 %2\n", info.name, info.title);
131 131
132 conf.close(); 132 conf.close();

mercurial