author | ar <ar> | 2004-05-03 21:35:18 (UTC) |
---|---|---|
committer | ar <ar> | 2004-05-03 21:35:18 (UTC) |
commit | 412619441fab46fc79c695a23ccf9e38135bdfad (patch) (unidiff) | |
tree | 19d9b8af14cf6c345ef532bb32368b9c7b43c50f /noncore/apps/tinykate/libkate/document/katebuffer.cpp | |
parent | d1095d71394779557f446e2a67ba55bc62eec859 (diff) | |
download | opie-412619441fab46fc79c695a23ccf9e38135bdfad.zip opie-412619441fab46fc79c695a23ccf9e38135bdfad.tar.gz opie-412619441fab46fc79c695a23ccf9e38135bdfad.tar.bz2 |
- convert qDebug to odebug
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.cpp | 89 |
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 | |||
@@ -22,24 +22,25 @@ | |||
22 | 22 | ||
23 | 23 | ||
24 | #include "katebuffer.h" | 24 | #include "katebuffer.h" |
25 | #include "kdebug.h" | ||
25 | 26 | ||
26 | // Includes for reading file | 27 | /* OPIE */ |
27 | #include <sys/types.h> | 28 | #include <opie2/odebug.h> |
28 | #include <sys/stat.h> | ||
29 | #include <fcntl.h> | ||
30 | #include <errno.h> | ||
31 | #include <unistd.h> | ||
32 | 29 | ||
30 | /* QT */ | ||
33 | #include <qfile.h> | 31 | #include <qfile.h> |
34 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
35 | |||
36 | #include <qtimer.h> | 33 | #include <qtimer.h> |
37 | #include <qtextcodec.h> | 34 | #include <qtextcodec.h> |
38 | 35 | ||
39 | // | 36 | /* STD */ |
40 | 37 | // Includes for reading file | |
38 | #include <sys/types.h> | ||
39 | #include <sys/stat.h> | ||
40 | #include <fcntl.h> | ||
41 | #include <errno.h> | ||
42 | #include <unistd.h> | ||
41 | #include <assert.h> | 43 | #include <assert.h> |
42 | #include <kdebug.h> | ||
43 | 44 | ||
44 | /** | 45 | /** |
45 | * Create an empty buffer. | 46 | * Create an empty buffer. |
@@ -65,35 +66,35 @@ KWBuffer::clear() | |||
65 | void | 66 | void |
66 | KWBuffer::insertFile(int line, const QString &file, QTextCodec *codec) | 67 | KWBuffer::insertFile(int line, const QString &file, QTextCodec *codec) |
67 | { | 68 | { |
68 | if (line) { | 69 | if (line) { |
69 | qDebug("insert File only supports insertion at line 0 == file opening"); | 70 | odebug << "insert File only supports insertion at line 0 == file opening" << oendl; |
70 | return; | 71 | return; |
71 | } | 72 | } |
72 | clear(); | 73 | clear(); |
73 | QFile iofile(file); | 74 | QFile iofile(file); |
74 | iofile.open(IO_ReadOnly); | 75 | iofile.open(IO_ReadOnly); |
75 | QTextStream stream(&iofile); | 76 | QTextStream stream(&iofile); |
76 | stream.setCodec(codec); | 77 | stream.setCodec(codec); |
77 | QString qsl; | 78 | QString qsl; |
78 | int count=0; | 79 | int count=0; |
79 | for (count=0;((qsl=stream.readLine())!=QString::null);count++) | 80 | for (count=0;((qsl=stream.readLine())!=QString::null); count++) |
80 | { | 81 | { |
81 | if (count==0) | 82 | if (count==0) |
82 | { | 83 | { |
83 | (*m_stringListIt)->append(qsl.unicode(),qsl.length()); | 84 | (*m_stringListIt)->append(qsl.unicode(),qsl.length()); |
84 | } | 85 | } |
85 | else | 86 | else |
86 | { | 87 | { |
87 | TextLine::Ptr tl=new TextLine(); | 88 | TextLine::Ptr tl=new TextLine(); |
88 | tl ->append(qsl.unicode(),qsl.length()); | 89 | tl ->append(qsl.unicode(),qsl.length()); |
89 | m_stringListIt=m_stringList.append(tl); | 90 | m_stringListIt=m_stringList.append(tl); |
90 | } | 91 | } |
91 | } | 92 | } |
92 | if (count!=0) | 93 | if (count!=0) |
93 | { | 94 | { |
94 | m_stringListCurrent=count-1; | 95 | m_stringListCurrent=count-1; |
95 | m_lineCount=count; | 96 | m_lineCount=count; |
96 | } | 97 | } |
97 | } | 98 | } |
98 | 99 | ||
99 | void | 100 | void |
@@ -121,9 +122,9 @@ KWBuffer::slotLoadFile() | |||
121 | int | 122 | int |
122 | KWBuffer::count() | 123 | KWBuffer::count() |
123 | { | 124 | { |
124 | qDebug("m_stringList.count %d",m_stringList.count()); | 125 | odebug << "m_stringList.count " << m_stringList.count() << "" << oendl; |
125 | return m_lineCount; | 126 | return m_lineCount; |
126 | //return m_stringList.count(); | 127 | // return m_stringList.count(); |
127 | // return m_totalLines; | 128 | // return m_totalLines; |
128 | } | 129 | } |
129 | 130 | ||
@@ -148,9 +149,9 @@ void KWBuffer::seek(int i) | |||
148 | TextLine::Ptr | 149 | TextLine::Ptr |
149 | KWBuffer::line(int i) | 150 | KWBuffer::line(int i) |
150 | { | 151 | { |
151 | if (i>=m_stringList.count()) return 0; | 152 | if (i>=m_stringList.count()) return 0; |
152 | seek(i); | 153 | seek(i); |
153 | return *m_stringListIt; | 154 | return *m_stringListIt; |
154 | } | 155 | } |
155 | 156 | ||
156 | void | 157 | void |