summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate/document/katebuffer.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/tinykate/libkate/document/katebuffer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katebuffer.cpp89
1 files changed, 45 insertions, 44 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katebuffer.cpp b/noncore/apps/tinykate/libkate/document/katebuffer.cpp
index 22a4917..4c15fd0 100644
--- a/noncore/apps/tinykate/libkate/document/katebuffer.cpp
+++ b/noncore/apps/tinykate/libkate/document/katebuffer.cpp
@@ -24,13 +24,10 @@
#include "katebuffer.h"
+#include "kdebug.h"
-// Includes for reading file
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
+/* OPIE */
+#include <opie2/odebug.h>
+/* QT */
#include <qfile.h>
#include <qtextstream.h>
-
#include <qtimer.h>
@@ -38,6 +35,10 @@
-//
-
+/* STD */
+// Includes for reading file
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
#include <assert.h>
-#include <kdebug.h>
@@ -67,31 +68,31 @@ KWBuffer::insertFile(int line, const QString &file, QTextCodec *codec)
{
- if (line) {
- qDebug("insert File only supports insertion at line 0 == file opening");
- return;
- }
- clear();
- QFile iofile(file);
- iofile.open(IO_ReadOnly);
- QTextStream stream(&iofile);
- stream.setCodec(codec);
- QString qsl;
- int count=0;
- for (count=0;((qsl=stream.readLine())!=QString::null); count++)
- {
- if (count==0)
- {
- (*m_stringListIt)->append(qsl.unicode(),qsl.length());
- }
- else
- {
- TextLine::Ptr tl=new TextLine();
- tl ->append(qsl.unicode(),qsl.length());
- m_stringListIt=m_stringList.append(tl);
- }
- }
- if (count!=0)
- {
- m_stringListCurrent=count-1;
- m_lineCount=count;
- }
+ if (line) {
+ odebug << "insert File only supports insertion at line 0 == file opening" << oendl;
+ return;
+ }
+ clear();
+ QFile iofile(file);
+ iofile.open(IO_ReadOnly);
+ QTextStream stream(&iofile);
+ stream.setCodec(codec);
+ QString qsl;
+ int count=0;
+ for (count=0;((qsl=stream.readLine())!=QString::null); count++)
+ {
+ if (count==0)
+ {
+ (*m_stringListIt)->append(qsl.unicode(),qsl.length());
+ }
+ else
+ {
+ TextLine::Ptr tl=new TextLine();
+ tl ->append(qsl.unicode(),qsl.length());
+ m_stringListIt=m_stringList.append(tl);
+ }
+ }
+ if (count!=0)
+ {
+ m_stringListCurrent=count-1;
+ m_lineCount=count;
+ }
}
@@ -123,5 +124,5 @@ KWBuffer::count()
{
- qDebug("m_stringList.count %d",m_stringList.count());
+ odebug << "m_stringList.count " << m_stringList.count() << "" << oendl;
return m_lineCount;
-// return m_stringList.count();
+// return m_stringList.count();
// return m_totalLines;
@@ -150,5 +151,5 @@ KWBuffer::line(int i)
{
- if (i>=m_stringList.count()) return 0;
- seek(i);
- return *m_stringListIt;
+ if (i>=m_stringList.count()) return 0;
+ seek(i);
+ return *m_stringListIt;
}