aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects/KvsObject_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/objects/KvsObject_file.cpp')
-rw-r--r--src/modules/objects/KvsObject_file.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/modules/objects/KvsObject_file.cpp b/src/modules/objects/KvsObject_file.cpp
index d0f773b85..2b2e10746 100644
--- a/src/modules/objects/KvsObject_file.cpp
+++ b/src/modules/objects/KvsObject_file.cpp
@@ -93,12 +93,12 @@ const QIODevice::OpenMode mod_cod[] = {
Attempts to open the file in specified mode or modes [i]sum[/i].
Valid modes are:[br]
[pre]
- RAW - RAW, non-buffered access[br]
- ReadOnly - opens the file read-only[br]
- WriteOnly - opens the file write-only[br]
- ReadWrite - opens the file in read-write mode[br]
- Append - opens the file in append mode. The file index is set to the end of the file.[br]
- Truncate - truncates the file[br]
+ RAW - RAW, non-buffered access
+ ReadOnly - opens the file read-only
+ WriteOnly - opens the file write-only
+ ReadWrite - opens the file in read-write mode
+ Append - opens the file in append mode. The file index is set to the end of the file.
+ Truncate - truncates the file
[/pre]
If you call this function without any parameters, the file is
opened in read-only mode.[br]
@@ -335,8 +335,8 @@ KVSO_CLASS_FUNCTION(file, putch)
KVSO_PARAMETERS_END(c)
if(szChar.length() > 1)
c->warning(__tr2qs_ctx("Argument too long, using only first char", "objects"));
- const char * ch = szChar.toUtf8().data();
- if(!m_pFile->putChar(ch[0]))
+ QByteArray szCh = szChar.toUtf8();
+ if(!m_pFile->putChar(szCh[0]))
c->warning(__tr2qs_ctx("Write error occurred!", "objects"));
return true;
}
@@ -375,8 +375,8 @@ KVSO_CLASS_FUNCTION(file, unGetch)
KVSO_PARAMETERS_END(c)
if(szChar.length() > 1)
c->warning(__tr2qs_ctx("Argument too long, using only the first char", "objects"));
- const char * ch = szChar.toUtf8().data();
- m_pFile->ungetChar(ch[0]);
+ QByteArray szCh = szChar.toUtf8();
+ m_pFile->ungetChar(szCh[0]);
return true;
}
@@ -554,8 +554,8 @@ KVSO_CLASS_FUNCTION(file, writeBlock)
}
QString szBlock;
pVariantData->asString(szBlock);
- const char * block = szBlock.toUtf8().data();
- int rlen = m_pFile->write(block, uLen);
+ QByteArray block = szBlock.toUtf8();
+ int rlen = m_pFile->write(block.data(), uLen);
c->returnValue()->setInteger(rlen);
}
}