author | ar <ar> | 2004-05-03 21:35:18 (UTC) |
---|---|---|
committer | ar <ar> | 2004-05-03 21:35:18 (UTC) |
commit | 412619441fab46fc79c695a23ccf9e38135bdfad (patch) (side-by-side diff) | |
tree | 19d9b8af14cf6c345ef532bb32368b9c7b43c50f /noncore/apps/tinykate/libkate/document | |
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') (more/less context) (ignore whitespace changes)
4 files changed, 184 insertions, 173 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; } 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 @@ -8,3 +8,3 @@ jowenn@kde.org - + ***************************************************************************/ @@ -41,16 +41,27 @@ #include "katedocument.h" +#include "kmessagebox.h" +#include "kglobal.h" +//#include "kcharsets.h" +#include "kdebug.h" +//#include "kinstance.h" -#include <qfileinfo.h> -#include <qdatetime.h> +#include "kglobalsettings.h" +//#include "kaction.h" +//#include "kstdaction.h" -#include <kmessagebox.h> -#include <qpe/config.h> -#include <qstring.h> +#include "../view/kateview.h" +#include "katebuffer.h" +#include "katetextline.h" -#include <sys/time.h> -#include <unistd.h> +#include "katecmd.h" -#include <stdio.h> +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/config.h> +/* QT */ +#include <qfileinfo.h> +#include <qdatetime.h> +#include <qstring.h> #include <qtimer.h> @@ -64,17 +75,7 @@ #include <qtextcodec.h> -#include <kglobal.h> -//#include <kcharsets.h> -#include <kdebug.h> -//#include <kinstance.h> - -#include <kglobalsettings.h> -//#include <kaction.h> -//#include <kstdaction.h> - -#include "../view/kateview.h" -#include "katebuffer.h" -#include "katetextline.h" - -#include "katecmd.h" +/* STD */ +#include <sys/time.h> +#include <unistd.h> +#include <stdio.h> @@ -132,3 +133,3 @@ uint KateDocument::uniqueID = 0; -QPtrDict<KateDocument::KateDocPrivate>* KateDocument::d_ptr = 0; +QPtrDict<KateDocument::KateDocPrivate>* KateDocument::d_ptr = 0; @@ -143,4 +144,4 @@ KateDocument::KateDocument(bool bSingleViewMode, bool bBrowserView, { - - d(this)->hlSetByUser = false; + + d(this)->hlSetByUser = false; PreHighlightedTill=0; @@ -154,3 +155,3 @@ KateDocument::KateDocument(bool bSingleViewMode, bool bBrowserView, // NOTE: QFont::CharSet doesn't provide all the charsets KDE supports - // (esp. it doesn't distinguish between UTF-8 and iso10646-1) + // (esp. it doesn't distinguish between UTF-8 and iso10646-1) @@ -294,3 +295,3 @@ void KateDocument::openURL(const QString &filename) - m_file=filename; + m_file=filename; fileInfo->setFile (m_file); @@ -300,3 +301,3 @@ void KateDocument::openURL(const QString &filename) { - qDebug("File doesn't exit or couldn't be read"); + odebug << "File doesn't exit or couldn't be read" << oendl; return ; @@ -307,3 +308,3 @@ void KateDocument::openURL(const QString &filename) // buffer->insertFile(0, m_file, KGlobal::charsets()->codecForName(myEncoding)); - qDebug("Telling buffer to open file"); + odebug << "Telling buffer to open file" << oendl; buffer->insertFile(0, m_file, QTextCodec::codecForLocale()); @@ -323,3 +324,3 @@ void KateDocument::openURL(const QString &filename) emit fileNameChanged(); - + return ; @@ -329,3 +330,3 @@ bool KateDocument::saveFile() { - + QFile f( m_file ); @@ -613,3 +614,3 @@ void KateDocument::readConfig() colors[1] = config->readColorEntry("Color Selected", colors[1]); - + // config->sync(); @@ -685,3 +686,3 @@ void KateDocument::setHighlight(int n) { void KateDocument::makeAttribs() { - qDebug("KateDocument::makeAttribs()"); + odebug << "KateDocument::makeAttribs()" << oendl; m_numAttribs = hlManager->makeAttribs(m_highlight, m_attribs, maxAttribs); @@ -1925,4 +1926,4 @@ void KateDocument::updateLines(int startLine, int endLine, int flags, int cursor endCtx = textLine->getContext(); -// qDebug("DOHIGHLIGHT"); - +// odebug << "DOHIGHLIGHT" << oendl; + ctxNum = m_highlight->doHighlight(ctxNum,textLine); diff --git a/noncore/apps/tinykate/libkate/document/katehighlight.cpp b/noncore/apps/tinykate/libkate/document/katehighlight.cpp index 0d2c283..539d356 100644 --- a/noncore/apps/tinykate/libkate/document/katehighlight.cpp +++ b/noncore/apps/tinykate/libkate/document/katehighlight.cpp @@ -3,4 +3,4 @@ digisnap@cs.tu-berlin.de - (C) 2002, 2001 The Kate Team <kwrite-devel@kde.org> - (C) 2002 Joseph Wenninger <jowenn@kde.org> + (C) 2002, 2001 The Kate Team <kwrite-devel@kde.org> + (C) 2002 Joseph Wenninger <jowenn@kde.org> This library is free software; you can redistribute it and/or @@ -21,18 +21,3 @@ -#include <string.h> - -#include <qtextstream.h> -#include <qpe/config.h> -#include <kglobal.h> -//#include <kinstance.h> -//#include <kmimemagic.h> -#include <klocale.h> -//#include <kregexp.h> -#include <kglobalsettings.h> -#include <kdebug.h> -#include <kstddirs.h> - #include "katehighlight.h" - - #include "katetextline.h" @@ -41,2 +26,21 @@ +#include "kglobal.h" +//#include "kinstance.h" +//#include "kmimemagic.h" +#include "klocale.h" +//#include "kregexp.h" +#include "kglobalsettings.h" +#include "kdebug.h" +#include "kstddirs.h" + +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/config.h> + +/* QT */ +#include <qtextstream.h> + +/* STD */ +#include <string.h> + @@ -122,4 +126,4 @@ const QChar *HlStringDetect::checkHgl(const QChar *s, int len, bool) { { - QString tmp=QString(s,str.length()).upper(); - if (tmp==str) return s+str.length(); + QString tmp=QString(s,str.length()).upper(); + if (tmp==str) return s+str.length(); } @@ -215,6 +219,6 @@ const QChar *HlInt::checkHgl(const QChar *str, int len, bool) { { - for (HlItem *it=subItems->first();it;it=subItems->next()) + for (HlItem *it=subItems->first();it;it=subItems->next()) { s1=it->checkHgl(s, len, false); - if (s1) return s1; + if (s1) return s1; } @@ -250,10 +254,10 @@ const QChar *HlFloat::checkHgl(const QChar *s, int len, bool) { if (!p) return 0L; - else - { + else + { if (subItems) { - for (HlItem *it=subItems->first();it;it=subItems->next()) + for (HlItem *it=subItems->first();it;it=subItems->next()) { s1=it->checkHgl(s, len, false); - if (s1) return s1; + if (s1) return s1; } @@ -347,3 +351,3 @@ const QChar *HlCHex::checkHgl(const QChar *str, int len, bool) { else - return 0L; + return 0L; @@ -402,3 +406,3 @@ const QChar *HlRegExpr::checkHgl(const QChar *s, int len, bool lineStart) else - return (s+Expr->matchedLength()); + return (s+Expr->matchedLength()); }; @@ -413,5 +417,5 @@ const QChar *HlLineContinue::checkHgl(const QChar *s, int len, bool) { if ((s[0].latin1() == '\\') && (len == 1)) - { + { return s + 1; - } + } return 0L; @@ -623,3 +627,3 @@ int Highlight::doHighlight(int ctxNum, TextLine *textLine) { - qDebug("An item has been detected"); + odebug << "An item has been detected" << oendl; textLine->setAttribs(item->attr,s1 - str,s2 - str); @@ -855,3 +859,3 @@ void Highlight::createItemData(ItemDataList &list) { - qDebug("Highlight::createItemData"); + odebug << "Highlight::createItemData" << oendl; @@ -876,3 +880,3 @@ void Highlight::createItemData(ItemDataList &list) - qDebug("Trying to read itemData section"); + odebug << "Trying to read itemData section" << oendl; @@ -884,3 +888,3 @@ void Highlight::createItemData(ItemDataList &list) { - qDebug("Setting up one itemData element"); + odebug << "Setting up one itemData element" << oendl; // read all attributes @@ -935,8 +939,8 @@ int Highlight::lookupAttrName(const QString& name, ItemDataList &iDl) { - for (int i=0;i<iDl.count();i++) - { - if (iDl.at(i)->name==name) return i; - } - kdDebug(13010)<<"Couldn't resolve itemDataName"<<endl; - return 0; + for (int i=0;i<iDl.count();i++) + { + if (iDl.at(i)->name==name) return i; + } + kdDebug(13010)<<"Couldn't resolve itemDataName"<<endl; + return 0; } @@ -1079,7 +1083,7 @@ void Highlight::readCommentConfig() if (HlManager::self()->syntax->groupData(data,"name")=="singleLine") - cslStart=HlManager::self()->syntax->groupData(data,"start"); - if (HlManager::self()->syntax->groupData(data,"name")=="multiLine") + cslStart=HlManager::self()->syntax->groupData(data,"start"); + if (HlManager::self()->syntax->groupData(data,"name")=="multiLine") { - cmlStart=HlManager::self()->syntax->groupData(data,"start"); - cmlEnd=HlManager::self()->syntax->groupData(data,"end"); + cmlStart=HlManager::self()->syntax->groupData(data,"start"); + cmlEnd=HlManager::self()->syntax->groupData(data,"end"); } @@ -1114,6 +1118,6 @@ void Highlight::readGlobalKeywordConfig() { - kdDebug(13010)<<"Found global keyword config"<<endl; + kdDebug(13010)<<"Found global keyword config"<<endl; if (HlManager::self()->syntax->groupItemData(data,QString("casesensitive"))!="0") - casesensitive=true; else {casesensitive=false; kdDebug(13010)<<"Turning on case insensitiveness"<<endl;} + casesensitive=true; else {casesensitive=false; kdDebug(13010)<<"Turning on case insensitiveness"<<endl;} //get the weak deliminators @@ -1135,3 +1139,3 @@ void Highlight::readGlobalKeywordConfig() - HlManager::self()->syntax->freeGroupInfo(data); + HlManager::self()->syntax->freeGroupInfo(data); } @@ -1206,6 +1210,6 @@ void Highlight::makeContextList() { -// kdDebug(13010)<< "In make Contextlist: Item:"<<endl; - c=createHlItem(data,iDl); - if (c) - { +// kdDebug(13010)<< "In make Contextlist: Item:"<<endl; + c=createHlItem(data,iDl); + if (c) + { contextList[i]->items.append(c); @@ -1213,14 +1217,14 @@ void Highlight::makeContextList() // Not supported completely atm and only one level. Subitems.(all have to be matched to at once) - datasub=HlManager::self()->syntax->getSubItems(data); - bool tmpbool; - if (tmpbool=HlManager::self()->syntax->nextItem(datasub)) - { + datasub=HlManager::self()->syntax->getSubItems(data); + bool tmpbool; + if (tmpbool=HlManager::self()->syntax->nextItem(datasub)) + { c->subItems=new QList<HlItem>; - for (;tmpbool;tmpbool=HlManager::self()->syntax->nextItem(datasub)) + for (;tmpbool;tmpbool=HlManager::self()->syntax->nextItem(datasub)) c->subItems->append(createHlItem(datasub,iDl)); } - HlManager::self()->syntax->freeGroupInfo(datasub); + HlManager::self()->syntax->freeGroupInfo(datasub); // end of sublevel - } -// kdDebug(13010)<<"Last line in loop"<<endl; + } +// kdDebug(13010)<<"Last line in loop"<<endl; } @@ -1314,3 +1318,3 @@ int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) { - qDebug("HlManager::makeAttribs"); + odebug << "HlManager::makeAttribs" << oendl; @@ -1323,3 +1327,3 @@ int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) { for (z = 0; z < nAttribs; z++) { - qDebug("HlManager::makeAttribs: createing one attribute definition"); + odebug << "HlManager::makeAttribs: createing one attribute definition" << oendl; itemData = itemDataList.at(z); @@ -1417,3 +1421,3 @@ void HlManager::setDefaults(ItemStyleList &list) { #warning fixme -/* +/* config = KateFactory::instance()->config(); diff --git a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp index 6059e9b..9fa4452 100644 --- a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp +++ b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp @@ -18,11 +18,16 @@ #include "katesyntaxdocument.h" -#include <kateconfig.h> +#include "kateconfig.h" +#include "kdebug.h" +#include "kstddirs.h" +#include "klocale.h" +#include "kmessagebox.h" +#include "kglobal.h" + +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/qpeapplication.h> + +/* QT */ #include <qfile.h> -#include <kdebug.h> -#include <kstddirs.h> -#include <klocale.h> -#include <kmessagebox.h> #include <qstringlist.h> -#include <kglobal.h> -#include <qpe/qpeapplication.h> #include <qdir.h> @@ -41,3 +46,3 @@ void SyntaxDocument::setIdentifier(const QString& identifier) if (!m_root) KMessageBox::error( 0L, i18n("Can't open %1").arg(identifier) ); - + } @@ -78,3 +83,3 @@ void SyntaxDocument::setupModeList(bool force) { - qDebug("Found a description file:"+path+(*it)); + odebug << "Found a description file:"+path+(*it) << oendl; setIdentifier(path+(*it)); @@ -83,4 +88,4 @@ void SyntaxDocument::setupModeList(bool force) { - e=e->firstChild(); - qDebug(e->tagName()); + e=e->firstChild(); + odebug << e->tagName() << oendl; if (e->tagName()=="language") @@ -92,3 +97,3 @@ void SyntaxDocument::setupModeList(bool force) mli->extension = e->attribute("extensions"); - qDebug(QString("valid description for: %1/%2").arg(mli->section).arg(mli->name)); + odebug << QString("valid description for: %1/%2").arg(mli->section).arg(mli->name) << oendl; if (mli->section.isEmpty()) @@ -182,5 +187,5 @@ syntaxContextData* SyntaxDocument::getSubItems(syntaxContextData* data) syntaxContextData *retval=new syntaxContextData; - retval->parent=0; - retval->currentGroup=0; - retval->item=0; + retval->parent=0; + retval->currentGroup=0; + retval->item=0; if (data != 0) @@ -214,4 +219,4 @@ syntaxContextData* SyntaxDocument::getConfig(const QString& mainGroupName, const syntaxContextData *data=new ( syntaxContextData); - data->currentGroup=0; - data->parent=0; + data->currentGroup=0; + data->parent=0; data->item=e1; @@ -256,4 +261,4 @@ syntaxContextData* SyntaxDocument::getGroupInfo(const QString& mainGroupName, co data->parent=e1; - data->currentGroup=0; - data->item=0; + data->currentGroup=0; + data->item=0; return data; @@ -286,15 +291,15 @@ QStringList& SyntaxDocument::finddata(const QString& mainGroup,const QString& ty { - for (Opie::Core::XMLElement *e1=e->firstChild();e1;e1=e1->nextChild()) - { - if (e1->tagName()!="list") continue; - - if (e1->attribute("name")==type) - { - for (Opie::Core::XMLElement *e2=e1->firstChild();e2;e2=e2->nextChild()) - { - qDebug("FOUND A LIST ENTRY("+e2->tagName()+"):"+e2->firstChild()->value()); - m_data+=e2->firstChild()->value().stripWhiteSpace(); - } - break; - } + for (Opie::Core::XMLElement *e1=e->firstChild();e1;e1=e1->nextChild()) + { + if (e1->tagName()!="list") continue; + + if (e1->attribute("name")==type) + { + for (Opie::Core::XMLElement *e2=e1->firstChild();e2;e2=e2->nextChild()) + { + odebug << "FOUND A LIST ENTRY("+e2->tagName()+"):"+e2->firstChild()->value() << oendl; + m_data+=e2->firstChild()->value().stripWhiteSpace(); + } + break; + } } |