summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate/document/katedocument.cpp
Unidiff
Diffstat (limited to 'noncore/apps/tinykate/libkate/document/katedocument.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katedocument.cpp53
1 files changed, 27 insertions, 26 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katedocument.cpp b/noncore/apps/tinykate/libkate/document/katedocument.cpp
index 0c742d7..6dc4fd2 100644
--- a/noncore/apps/tinykate/libkate/document/katedocument.cpp
+++ b/noncore/apps/tinykate/libkate/document/katedocument.cpp
@@ -36,50 +36,51 @@
36 along with this library; see the file COPYING.LIB. If not, write to 36 along with this library; see the file COPYING.LIB. If not, write to
37 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 37 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
38 Boston, MA 02111-1307, USA. 38 Boston, MA 02111-1307, USA.
39*/ 39*/
40 40
41#include "katedocument.h" 41#include "katedocument.h"
42#include "kmessagebox.h"
43#include "kglobal.h"
42 44
45//#include "kcharsets.h"
46#include "kdebug.h"
47//#include "kinstance.h"
43 48
44#include <qfileinfo.h> 49#include "kglobalsettings.h"
45#include <qdatetime.h> 50//#include "kaction.h"
51//#include "kstdaction.h"
46 52
47#include <kmessagebox.h> 53#include "../view/kateview.h"
48#include <qpe/config.h> 54#include "katebuffer.h"
49#include <qstring.h> 55#include "katetextline.h"
50 56
51#include <sys/time.h> 57#include "katecmd.h"
52#include <unistd.h>
53 58
54#include <stdio.h> 59/* OPIE */
60#include <opie2/odebug.h>
61#include <qpe/config.h>
55 62
63/* QT */
64#include <qfileinfo.h>
65#include <qdatetime.h>
66#include <qstring.h>
56#include <qtimer.h> 67#include <qtimer.h>
57#include <qobject.h> 68#include <qobject.h>
58#include <qapplication.h> 69#include <qapplication.h>
59#include <qclipboard.h> 70#include <qclipboard.h>
60#include <qfont.h> 71#include <qfont.h>
61#include <qpainter.h> 72#include <qpainter.h>
62#include <qfile.h> 73#include <qfile.h>
63#include <qtextstream.h> 74#include <qtextstream.h>
64#include <qtextcodec.h> 75#include <qtextcodec.h>
65#include <kglobal.h>
66
67//#include <kcharsets.h>
68#include <kdebug.h>
69//#include <kinstance.h>
70
71#include <kglobalsettings.h>
72//#include <kaction.h>
73//#include <kstdaction.h>
74
75#include "../view/kateview.h"
76#include "katebuffer.h"
77#include "katetextline.h"
78 76
79#include "katecmd.h" 77/* STD */
78#include <sys/time.h>
79#include <unistd.h>
80#include <stdio.h>
80 81
81KateAction::KateAction(Action a, PointStruc &cursor, int len, const QString &text) 82KateAction::KateAction(Action a, PointStruc &cursor, int len, const QString &text)
82 : action(a), cursor(cursor), len(len), text(text) { 83 : action(a), cursor(cursor), len(len), text(text) {
83} 84}
84 85
85KateActionGroup::KateActionGroup(PointStruc &aStart, int type) 86KateActionGroup::KateActionGroup(PointStruc &aStart, int type)
@@ -295,20 +296,20 @@ void KateDocument::openURL(const QString &filename)
295 m_file=filename; 296 m_file=filename;
296 fileInfo->setFile (m_file); 297 fileInfo->setFile (m_file);
297 setMTime(); 298 setMTime();
298 299
299 if (!fileInfo->exists() || !fileInfo->isReadable()) 300 if (!fileInfo->exists() || !fileInfo->isReadable())
300 { 301 {
301 qDebug("File doesn't exit or couldn't be read"); 302 odebug << "File doesn't exit or couldn't be read" << oendl;
302 return ; 303 return ;
303 } 304 }
304 305
305 buffer->clear(); 306 buffer->clear();
306#warning fixme 307#warning fixme
307// buffer->insertFile(0, m_file, KGlobal::charsets()->codecForName(myEncoding)); 308// buffer->insertFile(0, m_file, KGlobal::charsets()->codecForName(myEncoding));
308 qDebug("Telling buffer to open file"); 309 odebug << "Telling buffer to open file" << oendl;
309 buffer->insertFile(0, m_file, QTextCodec::codecForLocale()); 310 buffer->insertFile(0, m_file, QTextCodec::codecForLocale());
310 311
311 setMTime(); 312 setMTime();
312 313
313 if (myWordWrap) 314 if (myWordWrap)
314 wrapText (myWordWrapAt); 315 wrapText (myWordWrapAt);
@@ -680,13 +681,13 @@ void KateDocument::setHighlight(int n) {
680 PreHighlightedTill=0; 681 PreHighlightedTill=0;
681 RequestPreHighlightTill=0; 682 RequestPreHighlightTill=0;
682 emit(highlightChanged()); 683 emit(highlightChanged());
683} 684}
684 685
685void KateDocument::makeAttribs() { 686void KateDocument::makeAttribs() {
686 qDebug("KateDocument::makeAttribs()"); 687 odebug << "KateDocument::makeAttribs()" << oendl;
687 m_numAttribs = hlManager->makeAttribs(m_highlight, m_attribs, maxAttribs); 688 m_numAttribs = hlManager->makeAttribs(m_highlight, m_attribs, maxAttribs);
688 updateFontData(); 689 updateFontData();
689 updateLines(); 690 updateLines();
690} 691}
691 692
692void KateDocument::updateFontData() { 693void KateDocument::updateFontData() {
@@ -1920,13 +1921,13 @@ void KateDocument::updateLines(int startLine, int endLine, int flags, int cursor
1920 if (textLine==0) kdDebug(13020)<<"****updateLines()>> error textLine==0"<<endl; 1921 if (textLine==0) kdDebug(13020)<<"****updateLines()>> error textLine==0"<<endl;
1921 if (line <= endLine && line != cursorY) { 1922 if (line <= endLine && line != cursorY) {
1922 if (flags & KateView::cfRemoveSpaces) textLine->removeSpaces(); 1923 if (flags & KateView::cfRemoveSpaces) textLine->removeSpaces();
1923 updateMaxLength(textLine); 1924 updateMaxLength(textLine);
1924 } 1925 }
1925 endCtx = textLine->getContext(); 1926 endCtx = textLine->getContext();
1926// qDebug("DOHIGHLIGHT"); 1927// odebug << "DOHIGHLIGHT" << oendl;
1927 1928
1928 ctxNum = m_highlight->doHighlight(ctxNum,textLine); 1929 ctxNum = m_highlight->doHighlight(ctxNum,textLine);
1929 textLine->setContext(ctxNum); 1930 textLine->setContext(ctxNum);
1930 line++; 1931 line++;
1931 } while ((buffer->line(line)!=0) && (line <= endLine || endCtx != ctxNum)); 1932 } while ((buffer->line(line)!=0) && (line <= endLine || endCtx != ctxNum));
1932// kdDebug(13020)<<"updateLines :: while loop left"<<endl; 1933// kdDebug(13020)<<"updateLines :: while loop left"<<endl;