diff options
| author | 2010-04-18 17:48:40 +0000 | |
|---|---|---|
| committer | 2010-04-18 17:48:40 +0000 | |
| commit | 686293b85190ab2e297fb080f4ca99e44f604c73 (patch) | |
| tree | ef72961d849084d6e99c9a24605b7d32dcbcfcdc /src/modules/file/libkvifile.cpp | |
| parent | fixed win32 build (diff) | |
| download | KVIrc-686293b85190ab2e297fb080f4ca99e44f604c73.tar.gz KVIrc-686293b85190ab2e297fb080f4ca99e44f604c73.tar.bz2 KVIrc-686293b85190ab2e297fb080f4ca99e44f604c73.zip | |
removed old Qt3 wrappers;
improved hungarian notation;
added doxygen comments;
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4260 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/file/libkvifile.cpp')
| -rw-r--r-- | src/modules/file/libkvifile.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/modules/file/libkvifile.cpp b/src/modules/file/libkvifile.cpp index 05dbc50e4..5b457ca93 100644 --- a/src/modules/file/libkvifile.cpp +++ b/src/modules/file/libkvifile.cpp @@ -696,7 +696,7 @@ static bool file_kvs_fnc_ls(KviKvsModuleFunctionCall * c) An empty string is returned if a serious error occures.[br] The <filename> is adjusted according to the system that KVIrc is running on.[br] Flags are actually limited to the single letter 'l'. By default the file - is decoded from the ut8 characters set. If 'l' is present the the file + is decoded from the utf8 characters set. If 'l' is present the the file is decoded by using the local 8 bit character set instead. @examples: [example] @@ -904,17 +904,18 @@ static bool file_kvs_cmd_writeLines(KviKvsModuleCommandCall * c) KviFile f(szFile); - if(!f.openForWriting(c->switches()->find('a',"append"))) + bool bAppend = c->switches()->find('a',"append"); + bool bLocal8Bit = c->switches()->find('l',"local-8-bit"); + bool bNoSeparator = c->switches()->find('n',"no-separator"); + bool bAddCR = c->switches()->find('c',"crlf"); + + if(!f.open(QFile::WriteOnly | (bAppend ? QFile::Append : QFile::Truncate))) { if(!c->switches()->find('q',"quiet")) c->warning(__tr2qs("Can't open the file \"%Q\" for writing"),&szFile); return true; } - bool bLocal8Bit = c->switches()->find('l',"local-8-bit"); - bool bNoSeparator = c->switches()->find('n',"no-separator"); - bool bAddCR = c->switches()->find('c',"crlf"); - unsigned int u = 0; while(u < a.array()->size()) { @@ -931,7 +932,7 @@ static bool file_kvs_cmd_writeLines(KviKvsModuleCommandCall * c) if(bAddCR)dat += "\r\n"; else dat += '\n'; } - f.writeBlock(dat.data(),dat.length()); + f.write(dat.data(),dat.length()); } u++; } |
