src/primitives.cc

changeset 882
2f3cc8e045d5
parent 866
4951b737f8cb
child 927
409b82a4765e
child 945
c310073e4f22
equal deleted inserted replaced
881:82a9c3549db1 882:2f3cc8e045d5
166 // Done with primitives, now save to a config file 166 // Done with primitives, now save to a config file
167 QString path = Config::FilePath ("prims.cfg"); 167 QString path = Config::FilePath ("prims.cfg");
168 QFile conf (path); 168 QFile conf (path);
169 169
170 if (not conf.open (QIODevice::WriteOnly | QIODevice::Text)) 170 if (not conf.open (QIODevice::WriteOnly | QIODevice::Text))
171 CriticalError (format ("Couldn't write primitive list %1: %2", 171 Critical (format ("Couldn't write primitive list %1: %2",
172 path, conf.errorString())); 172 path, conf.errorString()));
173 else 173 else
174 { 174 {
175 for (Primitive& info : m_prims) 175 for (Primitive& info : m_prims)
176 fprint (conf, "%1 %2\r\n", info.name, info.title); 176 fprint (conf, "%1 %2\r\n", info.name, info.title);
290 290
291 QFile f (path); 291 QFile f (path);
292 292
293 if (not f.open (QIODevice::ReadOnly)) 293 if (not f.open (QIODevice::ReadOnly))
294 { 294 {
295 CriticalError (format (QObject::tr ("Failed to open primitive categories: %1"), f.errorString())); 295 Critical (format (QObject::tr ("Failed to open primitive categories: %1"), f.errorString()));
296 return; 296 return;
297 } 297 }
298 298
299 PrimitiveCategory* cat = null; 299 PrimitiveCategory* cat = null;
300 300

mercurial