diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2020-09-01 12:36:09 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-09-01 12:36:09 +0200 |
commit | 40420b140dae57640a553643766112af9902b7b0 (patch) | |
tree | 77b8670df921d1c9c2bc22a5f713bb5fac2cf28f /kpacman/painter.cpp | |
parent | 7e43acd8185cad93e5aeb91b199a89bd8b3eb069 (diff) | |
download | tdepacman-40420b140dae57640a553643766112af9902b7b0.tar.gz tdepacman-40420b140dae57640a553643766112af9902b7b0.zip |
Added controlled conversions to char* instead of automatic
ascii conversions. Removed unnecessary conversions to char*.
The definition of -UTQT_NO_ASCII_CAST is no longer needed.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'kpacman/painter.cpp')
-rw-r--r-- | kpacman/painter.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/kpacman/painter.cpp b/kpacman/painter.cpp index 16c0083..4c897c8 100644 --- a/kpacman/painter.cpp +++ b/kpacman/painter.cpp @@ -70,7 +70,7 @@ TQPtrList<TQPixmap> *Painter::loadPixmap(TQWidget *parent, TQString pixmapName, "or is of an unknown format."); msg.replace(TQRegExp("@PIXMAPNAME@"), pixmapName); // TQMessageBox::critical(parent, i18n("Initialization Error"), msg); - printf("%s\n", msg.local8Bit()); + printf("%s\n", msg.local8Bit().data()); return 0; } @@ -389,8 +389,8 @@ void Painter::initPixmaps() } if (lastFruitScorePixmapName != fruitScorePixmapName.at(level) || - (const char *) *fruitScorePixmapName.at(level) == '\0') { - if ((const char *) *fruitScorePixmapName.at(level) == '\0') { + *fruitScorePixmapName.at(level) == '\0') { + if (*fruitScorePixmapName.at(level) == '\0') { fruitScorePix = textPixmap(fruitScoreString, fruitScorePix, PINK); } else { fruitScorePix = loadPixmap(w, fruitScorePixmapName.at(level), @@ -400,8 +400,8 @@ void Painter::initPixmaps() } if (lastMonsterScorePixmapName != monsterScorePixmapName.at(level) || - (const char *) *monsterScorePixmapName.at(level) == '\0') { - if ((const char *) *monsterScorePixmapName.at(level) == '\0') { + *monsterScorePixmapName.at(level) == '\0') { + if (*monsterScorePixmapName.at(level) == '\0') { monsterScorePix = textPixmap(monsterScoreString, monsterScorePix, CYAN); } else { monsterScorePix = loadPixmap(w, monsterScorePixmapName.at(level), @@ -654,7 +654,7 @@ TQString Painter::decodeHexOctString(TQString s) c = '\0'; len = 0; value = s.mid(pos+leadin, 3); - ptr = (const char *) value; + ptr = value.latin1(); while (*ptr != '\0' && (v = valids.find(*ptr++, 0, FALSE)) != -1) { c = (c * valids.length()) + v; @@ -692,7 +692,7 @@ void Painter::fillScoreString(TQStrList &list, TQMemArray<int> &values) s.insert(0, char (values[i] / 1000 + 0x10)); } - list.append(s.local8Bit()); + list.append(s.latin1()); } } @@ -739,7 +739,7 @@ void Painter::fillStrList(TQStrList &list, TQString values, int max) } if (!value.isEmpty()) last = decodeHexOctString(value); - list.append(last); + list.append(last.latin1()); } } @@ -763,8 +763,8 @@ void Painter::fillPixmapName(TQStrList &pixmapName) fileInfo.setFile(pixmap); if (!fileInfo.isReadable() || !fileInfo.isFile()) pixmap = ""; - - pixmapName.append(pixmap); + + pixmapName.append(pixmap.utf8()); } } @@ -897,9 +897,9 @@ void Painter::confScheme() confScoring(FALSE); } - if ((const char *) *fruitScoreString.at(0) == '\0') + if (*fruitScoreString.at(0) == '\0') fillScoreString(fruitScoreString, fruitScore); - if ((const char *) *monsterScoreString.at(0) == '\0') + if (*monsterScoreString.at(0) == '\0') fillScoreString(monsterScoreString, monsterScore); fillPixmapName(pointPixmapName); |