aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_file.cpp
diff options
context:
space:
mode:
authorGravatar Noldor2009-09-02 15:56:45 +0000
committerGravatar Noldor2009-09-02 15:56:45 +0000
commit6d86b51b1030208d99649829cea96de0b64b5ed7 (patch)
treec226a1dc617171c0a8f74fcce7d492486fcf24d8 /src/modules/objects/class_file.cpp
parent- trailing whitespace cleanups all over the place (diff)
downloadKVIrc-6d86b51b1030208d99649829cea96de0b64b5ed7.tar.gz
KVIrc-6d86b51b1030208d99649829cea96de0b64b5ed7.tar.bz2
KVIrc-6d86b51b1030208d99649829cea96de0b64b5ed7.zip
Some fix in code and doc + removed obsolete code
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3466 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/objects/class_file.cpp')
-rw-r--r--src/modules/objects/class_file.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/modules/objects/class_file.cpp b/src/modules/objects/class_file.cpp
index b1b383f5c..dc3c6ea49 100644
--- a/src/modules/objects/class_file.cpp
+++ b/src/modules/objects/class_file.cpp
@@ -1,11 +1,11 @@
//=============================================================================
//
-// File : class_memorybuffer.cpp
+// File : class_file.cpp
// Creation date : Fri Mar 18 21:30:48 CEST 2005
// by Tonino Imbesi(Grifisx) and Alessandro Carbone(Noldor)
//
// This file is part of the KVirc irc client distribution
-// Copyright (C) 2005-2008 Alessandro Carbone (elfonol at gmail dot com)
+// Copyright (C) 2000-2009 Szymon Stefanek (pragma at kvirc dot net)
//
// This program is FREE software. You can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -235,23 +235,24 @@ KVSO_CLASS_FUNCTION(file,open)
{
for ( int idx=0;idx<modes.count();idx++)
{
- mod = QIODevice::ReadOnly;
- for(unsigned int j = 0; j < mod_num; j++)
+ int found=false;
+ for(unsigned int j = 0; j < mod_num; j++)
{
- if(KviQString::equalCI(modes.at(idx), mod_tbl[j]))
+
+ if(KviQString::equalCI(modes.at(idx), mod_tbl[j]))
{
- mod=mod_cod[j];
+ mod=mod_cod[j];
+ found=true;
break;
}
}
- if(mod!=QIODevice::ReadOnly)
+ if(found)
sum = sum | mod;
else
c->warning(__tr2qs_ctx("No such open mode '%Q'","objects"),&modes.at(idx));
}
}
-
- m_pFile->open(QIODevice::ReadOnly);
+ c->returnValue()->setBoolean(m_pFile->open(sum));
return true;
}
@@ -533,8 +534,9 @@ KVSO_CLASS_FUNCTION(file,readLine)
CHECK_INTERNAL_POINTER(m_pFile)
CHECK_FILE_IS_OPEN
QString buffer;
- bool ok=KviFileUtils::readLine(m_pFile,buffer);
- debug("ok %d",ok);
+ //bool ok=KviFileUtils::readLine(m_pFile,buffer);
+ buffer=m_pFile->readLine();
+ // debug("ok %d",ok);
c->returnValue()->setString(buffer);
return true;
}