Diffstat (limited to 'noncore/apps/tinykate/libkate/document/katedocument.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/tinykate/libkate/document/katedocument.cpp | 73 |
1 files changed, 37 insertions, 36 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 | |||
@@ -7,5 +7,5 @@ | |||
7 | email : crossfire@babylon2k.de | 7 | email : crossfire@babylon2k.de |
8 | jowenn@kde.org | 8 | jowenn@kde.org |
9 | 9 | ||
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
@@ -40,18 +40,29 @@ | |||
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> |
@@ -63,19 +74,9 @@ | |||
63 | #include <qtextstream.h> | 74 | #include <qtextstream.h> |
64 | #include <qtextcodec.h> | 75 | #include <qtextcodec.h> |
65 | #include <kglobal.h> | ||
66 | 76 | ||
67 | //#include <kcharsets.h> | 77 | /* STD */ |
68 | #include <kdebug.h> | 78 | #include <sys/time.h> |
69 | //#include <kinstance.h> | 79 | #include <unistd.h> |
70 | 80 | #include <stdio.h> | |
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 | |||
79 | #include "katecmd.h" | ||
80 | 81 | ||
81 | KateAction::KateAction(Action a, PointStruc &cursor, int len, const QString &text) | 82 | KateAction::KateAction(Action a, PointStruc &cursor, int len, const QString &text) |
@@ -131,5 +132,5 @@ QStringList KateDocument::replaceWithList = QStringList(); | |||
131 | uint KateDocument::uniqueID = 0; | 132 | uint KateDocument::uniqueID = 0; |
132 | 133 | ||
133 | QPtrDict<KateDocument::KateDocPrivate>* KateDocument::d_ptr = 0; | 134 | QPtrDict<KateDocument::KateDocPrivate>* KateDocument::d_ptr = 0; |
134 | 135 | ||
135 | 136 | ||
@@ -142,6 +143,6 @@ KateDocument::KateDocument(bool bSingleViewMode, bool bBrowserView, | |||
142 | hlManager(HlManager::self ()) | 143 | hlManager(HlManager::self ()) |
143 | { | 144 | { |
144 | 145 | ||
145 | d(this)->hlSetByUser = false; | 146 | d(this)->hlSetByUser = false; |
146 | PreHighlightedTill=0; | 147 | PreHighlightedTill=0; |
147 | RequestPreHighlightTill=0; | 148 | RequestPreHighlightTill=0; |
@@ -153,5 +154,5 @@ KateDocument::KateDocument(bool bSingleViewMode, bool bBrowserView, | |||
153 | 154 | ||
154 | // NOTE: QFont::CharSet doesn't provide all the charsets KDE supports | 155 | // NOTE: QFont::CharSet doesn't provide all the charsets KDE supports |
155 | // (esp. it doesn't distinguish between UTF-8 and iso10646-1) | 156 | // (esp. it doesn't distinguish between UTF-8 and iso10646-1) |
156 | 157 | ||
157 | myEncoding = QString::fromLatin1(QTextCodec::codecForLocale()->name()); | 158 | myEncoding = QString::fromLatin1(QTextCodec::codecForLocale()->name()); |
@@ -293,5 +294,5 @@ void KateDocument::openURL(const QString &filename) | |||
293 | { | 294 | { |
294 | 295 | ||
295 | m_file=filename; | 296 | m_file=filename; |
296 | fileInfo->setFile (m_file); | 297 | fileInfo->setFile (m_file); |
297 | setMTime(); | 298 | setMTime(); |
@@ -299,5 +300,5 @@ void KateDocument::openURL(const QString &filename) | |||
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 | } |
@@ -306,5 +307,5 @@ void KateDocument::openURL(const QString &filename) | |||
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 | ||
@@ -322,5 +323,5 @@ void KateDocument::openURL(const QString &filename) | |||
322 | 323 | ||
323 | emit fileNameChanged(); | 324 | emit fileNameChanged(); |
324 | 325 | ||
325 | return ; | 326 | return ; |
326 | } | 327 | } |
@@ -328,5 +329,5 @@ void KateDocument::openURL(const QString &filename) | |||
328 | bool KateDocument::saveFile() | 329 | bool KateDocument::saveFile() |
329 | { | 330 | { |
330 | 331 | ||
331 | QFile f( m_file ); | 332 | QFile f( m_file ); |
332 | if ( !f.open( IO_WriteOnly ) ) | 333 | if ( !f.open( IO_WriteOnly ) ) |
@@ -612,5 +613,5 @@ void KateDocument::readConfig() | |||
612 | colors[0] = config->readColorEntry("Color Background", colors[0]); | 613 | colors[0] = config->readColorEntry("Color Background", colors[0]); |
613 | colors[1] = config->readColorEntry("Color Selected", colors[1]); | 614 | colors[1] = config->readColorEntry("Color Selected", colors[1]); |
614 | 615 | ||
615 | // config->sync(); | 616 | // config->sync(); |
616 | } | 617 | } |
@@ -684,5 +685,5 @@ void KateDocument::setHighlight(int n) { | |||
684 | 685 | ||
685 | void KateDocument::makeAttribs() { | 686 | void 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(); |
@@ -1924,6 +1925,6 @@ void KateDocument::updateLines(int startLine, int endLine, int flags, int cursor | |||
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); |