equal
deleted
inserted
replaced
163 "Please check your installation"). |
163 "Please check your installation"). |
164 arg(datadir->absolutePath()+"/hedgewars/Data")); |
164 arg(datadir->absolutePath()+"/hedgewars/Data")); |
165 return 1; |
165 return 1; |
166 } |
166 } |
167 |
167 |
|
168 // copy data/default css files to cfgdir as templates |
|
169 QString userCssDir = cfgdir->absolutePath() + "/Data/css"; |
|
170 if (checkForDir(userCssDir)) |
|
171 { |
|
172 QString defaultCssDir = ":res/css"; |
|
173 QStringList cssFiles = QDir(defaultCssDir).entryList(QDir::Files); |
|
174 foreach (const QString & cssFile, cssFiles) |
|
175 { |
|
176 QString srcName = datadir->absolutePath()+"/css/"+cssFile; |
|
177 |
|
178 if (!QFile::exists(srcName)) |
|
179 srcName = defaultCssDir+"/"+cssFile; |
|
180 |
|
181 QString tmpName = userCssDir + "/template_" + cssFile; |
|
182 if (QFile::exists(tmpName)) |
|
183 QFile::remove(tmpName); |
|
184 |
|
185 QFile(srcName).copy(tmpName); |
|
186 } |
|
187 } |
|
188 |
168 { |
189 { |
169 QStringList themes; |
190 QStringList themes; |
170 |
191 |
171 themes.append(HWDataManager::instance().entryList( |
192 themes.append(HWDataManager::instance().entryList( |
172 "Themes", |
193 "Themes", |