diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2026-02-21 11:03:45 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2026-02-21 20:54:51 +0900 |
| commit | 4d13f1a2267c6864b98c5a46631b1e2bbe3c024a (patch) | |
| tree | 72d524c66325b2c554bafcf86225d26664373444 /src/modules/objects/class_file.cpp | |
| parent | f14a1c5c8c988ef6901545040aabedf8027ecc18 (diff) | |
| download | kvirc-feat/more-fixes-for-cmake.tar.gz kvirc-feat/more-fixes-for-cmake.zip | |
Fix conversion of TQString to const char* (modules)feat/more-fixes-for-cmake
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/modules/objects/class_file.cpp')
| -rw-r--r-- | src/modules/objects/class_file.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/modules/objects/class_file.cpp b/src/modules/objects/class_file.cpp index 9195f117..89237ed4 100644 --- a/src/modules/objects/class_file.cpp +++ b/src/modules/objects/class_file.cpp @@ -296,8 +296,7 @@ bool KviKvsObject_file::functionputch(KviKvsObjectFunctionCall *c) if (m_pFile) { if (szChar.length()>1)c->warning(__tr2qs("Argument to long, using only first char")); - const char *ch=szChar; - if (m_pFile->putch(ch[0])<0) c->warning(__tr2qs("Write error occured !")); + if (m_pFile->putch(szChar.utf8().data()[0])<0) c->warning(__tr2qs("Write error occured !")); } return true; @@ -328,8 +327,7 @@ bool KviKvsObject_file::functionunGetch(KviKvsObjectFunctionCall *c) else { if (szChar.length()>1) c->warning(__tr2qs("Argument to long, using only first char")); - const char *ch=szChar; - if (m_pFile->ungetch(ch[0])<0) c->warning(__tr2qs("An error occured !"));// c->error ? + if (m_pFile->ungetch(szChar.utf8().data()[0])<0) c->warning(__tr2qs("An error occured !"));// c->error ? } return true; } @@ -365,8 +363,7 @@ bool KviKvsObject_file::functionwriteBlock(KviKvsObjectFunctionCall *c) if (!m_pFile) return true; if(!m_pFile->isOpen()) c->warning(__tr("File is not open !")); - const char *block=szBlock; - int rlen = m_pFile->writeBlock(block, uLen); + int rlen = m_pFile->writeBlock(szBlock.utf8().data(), uLen); c->returnValue()->setInteger(rlen); m_pFile->flush(); return true; |
