mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2025-04-21 12:27:27 +03:00
Zero-pad hex values when saving config
writeSkinConfig() had a very naughty bug when RGBA values were written to config file unpadded. This lead to a problem that, for example, 0x00000080 was written as 0x00080 in config file (Somehow gmenu2x reads and re-saves config on selection). This, in turn, led to problem when reading skin config file in strtorgba function, because it parses the color string in token of two symbols (substr(0,2) and etc).
This commit is contained in:
@@ -655,9 +655,15 @@ void GMenu2X::writeSkinConfig() {
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < NUM_COLORS; ++i) {
|
for (i = 0; i < NUM_COLORS; ++i) {
|
||||||
inf << colorToString((enum color)i) << "=#" << hex << skinConfColors[i].r << hex
|
inf << colorToString((enum color)i) << "=#";
|
||||||
<< skinConfColors[i].g << hex << skinConfColors[i].b << hex
|
inf.width(2); inf.fill('0');
|
||||||
<< skinConfColors[i].a << endl;
|
inf << right << hex << skinConfColors[i].r;
|
||||||
|
inf.width(2); inf.fill('0');
|
||||||
|
inf << right << hex << skinConfColors[i].g;
|
||||||
|
inf.width(2); inf.fill('0');
|
||||||
|
inf << right << hex << skinConfColors[i].b;
|
||||||
|
inf.width(2); inf.fill('0');
|
||||||
|
inf << right << hex << skinConfColors[i].a << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
inf.close();
|
inf.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user