src/colors.cpp

changeset 1012
413ecd6b9801
parent 998
5be0ce31ce60
child 1014
f0a8ecb6a357
child 1217
314e12e23c3a
equal deleted inserted replaced
1011:4fdd74a04790 1012:413ecd6b9801
22 #include "colors.h" 22 #include "colors.h"
23 #include "ldDocument.h" 23 #include "ldDocument.h"
24 #include "miscallenous.h" 24 #include "miscallenous.h"
25 #include "mainwindow.h" 25 #include "mainwindow.h"
26 #include "documentmanager.h" 26 #include "documentmanager.h"
27 #include "ldpaths.h"
27 28
28 static ColorData* colorData = nullptr; 29 static ColorData* colorData = nullptr;
29 30
30 void initColors() 31 void initColors()
31 { 32 {
172 return m_data[code]; 173 return m_data[code];
173 } 174 }
174 175
175 void ColorData::loadFromLdconfig() 176 void ColorData::loadFromLdconfig()
176 { 177 {
177 if (not g_win) 178 QString path = LDPaths::ldConfigPath();
178 return;
179
180 QString path = g_win->documents()->findDocumentPath ("LDConfig.ldr", false);
181 QFile fp (path); 179 QFile fp (path);
182 180
183 if (not fp.open (QIODevice::ReadOnly)) 181 if (not fp.open (QIODevice::ReadOnly))
184 { 182 {
185 QMessageBox::critical (nullptr, "Error", "Unable to open LDConfig.ldr for parsing: " + fp.errorString()); 183 QMessageBox::critical (nullptr, "Error", "Unable to open LDConfig.ldr for parsing: " + fp.errorString());

mercurial