summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate
Side-by-side diff
Diffstat (limited to 'noncore/apps/tinykate/libkate') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katebuffer.cpp25
-rw-r--r--noncore/apps/tinykate/libkate/document/katedocument.cpp53
-rw-r--r--noncore/apps/tinykate/libkate/document/katehighlight.cpp46
-rw-r--r--noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp27
-rw-r--r--noncore/apps/tinykate/libkate/kateconfig.cpp29
5 files changed, 98 insertions, 82 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 @@
#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>
#include <qtextcodec.h>
-//
-
+/* 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>
/**
* Create an empty buffer.
@@ -66,7 +67,7 @@ void
KWBuffer::insertFile(int line, const QString &file, QTextCodec *codec)
{
if (line) {
- qDebug("insert File only supports insertion at line 0 == file opening");
+ odebug << "insert File only supports insertion at line 0 == file opening" << oendl;
return;
}
clear();
@@ -121,7 +122,7 @@ KWBuffer::slotLoadFile()
int
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_totalLines;
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
@@ -39,20 +39,31 @@
*/
#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>
#include <qobject.h>
#include <qapplication.h>
@@ -62,21 +73,11 @@
#include <qfile.h>
#include <qtextstream.h>
#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>
KateAction::KateAction(Action a, PointStruc &cursor, int len, const QString &text)
: action(a), cursor(cursor), len(len), text(text) {
@@ -298,14 +299,14 @@ void KateDocument::openURL(const QString &filename)
if (!fileInfo->exists() || !fileInfo->isReadable())
{
- qDebug("File doesn't exit or couldn't be read");
+ odebug << "File doesn't exit or couldn't be read" << oendl;
return ;
}
buffer->clear();
#warning fixme
// 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());
setMTime();
@@ -683,7 +684,7 @@ void KateDocument::setHighlight(int n) {
}
void KateDocument::makeAttribs() {
- qDebug("KateDocument::makeAttribs()");
+ odebug << "KateDocument::makeAttribs()" << oendl;
m_numAttribs = hlManager->makeAttribs(m_highlight, m_attribs, maxAttribs);
updateFontData();
updateLines();
@@ -1923,7 +1924,7 @@ void KateDocument::updateLines(int startLine, int endLine, int flags, int cursor
updateMaxLength(textLine);
}
endCtx = textLine->getContext();
-// qDebug("DOHIGHLIGHT");
+// odebug << "DOHIGHLIGHT" << oendl;
ctxNum = m_highlight->doHighlight(ctxNum,textLine);
textLine->setContext(ctxNum);
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
@@ -19,26 +19,30 @@
Boston, MA 02111-1307, USA.
*/
-#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"
#include "katedocument.h"
#include "katesyntaxdocument.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"
+
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/config.h>
+
+/* QT */
+#include <qtextstream.h>
+
+/* STD */
+#include <string.h>
+
HlManager *HlManager::s_pSelf = 0;
@@ -621,7 +625,7 @@ int Highlight::doHighlight(int ctxNum, TextLine *textLine)
s2 = item->checkHgl(s1, len-z, z==0);
if (s2 > s1)
{
- qDebug("An item has been detected");
+ odebug << "An item has been detected" << oendl;
textLine->setAttribs(item->attr,s1 - str,s2 - str);
ctxNum = item->ctx;
context = contextList[ctxNum];
@@ -853,7 +857,7 @@ void Highlight::done()
void Highlight::createItemData(ItemDataList &list)
{
- qDebug("Highlight::createItemData");
+ odebug << "Highlight::createItemData" << oendl;
// If no highlighting is selected we need only one default.
if (noHl)
@@ -874,7 +878,7 @@ void Highlight::createItemData(ItemDataList &list)
internalIDList.setAutoDelete(true);
syntaxContextData *data;
- qDebug("Trying to read itemData section");
+ odebug << "Trying to read itemData section" << oendl;
//Tell the syntax document class which file we want to parse and which data group
HlManager::self()->syntax->setIdentifier(identifier);
@@ -882,7 +886,7 @@ void Highlight::createItemData(ItemDataList &list)
//begin with the real parsing
while (HlManager::self()->syntax->nextGroup(data))
{
- qDebug("Setting up one itemData element");
+ odebug << "Setting up one itemData element" << oendl;
// read all attributes
color=HlManager::self()->syntax->groupData(data,QString("color"));
selColor=HlManager::self()->syntax->groupData(data,QString("selColor"));
@@ -1312,7 +1316,7 @@ int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) {
ItemData *itemData;
int nAttribs, z;
- qDebug("HlManager::makeAttribs");
+ odebug << "HlManager::makeAttribs" << oendl;
defaultStyleList.setAutoDelete(true);
getDefaults(defaultStyleList);
@@ -1321,7 +1325,7 @@ int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) {
highlight->getItemDataList(itemDataList);
nAttribs = itemDataList.count();
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);
if (itemData->defStyle) {
// default style
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
@@ -16,15 +16,20 @@
***************************************************************************/
#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>
SyntaxDocument::SyntaxDocument()
@@ -76,13 +81,13 @@ void SyntaxDocument::setupModeList(bool force)
}
else
{
- qDebug("Found a description file:"+path+(*it));
+ odebug << "Found a description file:"+path+(*it) << oendl;
setIdentifier(path+(*it));
Opie::Core::XMLElement *e=m_root;
if (e)
{
e=e->firstChild();
- qDebug(e->tagName());
+ odebug << e->tagName() << oendl;
if (e->tagName()=="language")
{
syntaxModeListItem *mli=new syntaxModeListItem;
@@ -90,7 +95,7 @@ void SyntaxDocument::setupModeList(bool force)
mli->section = e->attribute("section");
mli->mimetype = e->attribute("mimetype");
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())
mli->section=i18n("Other");
@@ -292,7 +297,7 @@ QStringList& SyntaxDocument::finddata(const QString& mainGroup,const QString& ty
{
for (Opie::Core::XMLElement *e2=e1->firstChild();e2;e2=e2->nextChild())
{
- qDebug("FOUND A LIST ENTRY("+e2->tagName()+"):"+e2->firstChild()->value());
+ odebug << "FOUND A LIST ENTRY("+e2->tagName()+"):"+e2->firstChild()->value() << oendl;
m_data+=e2->firstChild()->value().stripWhiteSpace();
}
break;
diff --git a/noncore/apps/tinykate/libkate/kateconfig.cpp b/noncore/apps/tinykate/libkate/kateconfig.cpp
index 96f91fb..782b629 100644
--- a/noncore/apps/tinykate/libkate/kateconfig.cpp
+++ b/noncore/apps/tinykate/libkate/kateconfig.cpp
@@ -18,6 +18,14 @@
**
**********************************************************************/
+#define QTOPIA_INTERNAL_LANGLIST
+#include "kateconfig.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/global.h>
+
+/* QT */
#include <qdir.h>
#include <qmessagebox.h>
#if QT_VERSION <= 230 && defined(QT_NO_CODECS)
@@ -25,16 +33,13 @@
#endif
#include <qtextstream.h>
+/* STD */
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
-#define QTOPIA_INTERNAL_LANGLIST
-#include "kateconfig.h"
-#include <qpe/global.h>
-
/*!
\internal
@@ -93,7 +98,7 @@ QString KateConfig::configFilename(const QString& name, Domain d)
KateConfig::KateConfig( const QString &name, Domain domain )
: filename( configFilename(name,domain) )
{
- qWarning("KateConfig constructor\n");
+ owarn << "KateConfig constructor\n" << oendl;
git = groups.end();
read();
QStringList l = Global::languageList();
@@ -118,7 +123,7 @@ KateConfig::KateConfig ( const QString &name, bool what )
*/
KateConfig::~KateConfig()
{
- qWarning("KateConfig destructor\n");
+ owarn << "KateConfig destructor\n" << oendl;
if ( changed )
write();
}
@@ -172,7 +177,7 @@ void KateConfig::writeEntry( const QString &key, const char* value )
void KateConfig::writeEntry( const QString &key, const QString &value )
{
if ( git == groups.end() ) {
- qWarning( "no group set" );
+ owarn << "no group set" << oendl;
return;
}
if ( (*git)[key] != value ) {
@@ -232,7 +237,7 @@ static QString decipher(const QString& cipher)
void KateConfig::writeEntryCrypt( const QString &key, const QString &value )
{
if ( git == groups.end() ) {
- qWarning( "no group set" );
+ owarn << "no group set" << oendl;
return;
}
QString evalue = encipher(value);
@@ -321,7 +326,7 @@ void KateConfig::writeEntry( const QString &key, const QFont &val )
void KateConfig::removeEntry( const QString &key )
{
if ( git == groups.end() ) {
- qWarning( "no group set" );
+ owarn << "no group set" << oendl;
return;
}
( *git ).remove( key );
@@ -397,7 +402,7 @@ QString KateConfig::readEntryCrypt( const QString &key, const QString &deflt )
QString KateConfig::readEntryDirect( const QString &key, const QString &deflt )
{
if ( git == groups.end() ) {
- //qWarning( "no group set" );
+ //owarn << "no group set" << oendl;
return deflt;
}
KateConfigGroup::ConstIterator it = ( *git ).find( key );
@@ -500,7 +505,7 @@ QValueList<int> KateConfig::readIntListEntry( const QString &key ) const
void KateConfig::clearGroup()
{
if ( git == groups.end() ) {
- qWarning( "no group set" );
+ owarn << "no group set" << oendl;
return;
}
if ( !(*git).isEmpty() ) {
@@ -521,7 +526,7 @@ void KateConfig::write( const QString &fn )
QFile f( strNewFile );
if ( !f.open( IO_WriteOnly|IO_Raw ) ) {
- qWarning( "could not open for writing `%s'", strNewFile.latin1() );
+ owarn << "could not open for writing `" << strNewFile << "'" << oendl;
git = groups.end();
return;
}