author | jowenn <jowenn> | 2002-11-11 20:37:06 (UTC) |
---|---|---|
committer | jowenn <jowenn> | 2002-11-11 20:37:06 (UTC) |
commit | da541da2e5cec28acb36cbd6e9c04a76375b4ac7 (patch) (side-by-side diff) | |
tree | f016ecc7faaeb45f03674e7239982645da42e8cc | |
parent | 6a0fc9de7e89357095b9efc3dace5c92042291ac (diff) | |
download | opie-da541da2e5cec28acb36cbd6e9c04a76375b4ac7.zip opie-da541da2e5cec28acb36cbd6e9c04a76375b4ac7.tar.gz opie-da541da2e5cec28acb36cbd6e9c04a76375b4ac7.tar.bz2 |
Read keyword lists again
-rw-r--r-- | noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp index 3390bdb..e45daa4 100644 --- a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp +++ b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp @@ -107,204 +107,205 @@ void SyntaxDocument::setupModeList(bool force) myModeList.append(mli); } } } } // } // config->sync(); } SyntaxModeList SyntaxDocument::modeList() { return myModeList; } bool SyntaxDocument::nextGroup( syntaxContextData* data) { if(!data) return false; if (!data->currentGroup) data->currentGroup=data->parent->firstChild(); else data->currentGroup=data->currentGroup->nextChild(); data->item=0; if (!data->currentGroup) return false; else return true; } bool SyntaxDocument::nextItem( syntaxContextData* data) { if(!data) return false; if (!data->item) data->item=data->currentGroup->firstChild(); else data->item=data->item->nextChild(); if (!data->item) return false; else return true; } QString SyntaxDocument::groupItemData( syntaxContextData* data,QString name) { if(!data) return QString::null; if ( (data->item) && (name.isEmpty())) return data->item->tagName(); if (data->item) return data->item->attribute(name); else return QString(); } QString SyntaxDocument::groupData( syntaxContextData* data,QString name) { if(!data) return QString::null; if (data->currentGroup) return data->currentGroup->attribute(name); else return QString(); } void SyntaxDocument::freeGroupInfo( syntaxContextData* data) { if (data) delete data; } syntaxContextData* SyntaxDocument::getSubItems(syntaxContextData* data) { syntaxContextData *retval=new syntaxContextData; retval->parent=0; retval->currentGroup=0; retval->item=0; if (data != 0) { retval->parent=data->currentGroup; retval->currentGroup=data->item; retval->item=0; } return retval; } syntaxContextData* SyntaxDocument::getConfig(const QString& mainGroupName, const QString &Config) { Opie::XMLElement *e = m_root->firstChild()->firstChild(); while (e) { kdDebug(13010)<<"in SyntaxDocument::getGroupInfo (outer loop) " <<endl; if (e->tagName().compare(mainGroupName)==0 ) { Opie::XMLElement *e1=e->firstChild(); while (e1) { kdDebug(13010)<<"in SyntaxDocument::getGroupInfo (inner loop) " <<endl; if (e1->tagName()==Config) { syntaxContextData *data=new ( syntaxContextData); data->currentGroup=0; data->parent=0; data->item=e1; return data; } e1=e1->nextChild(); } kdDebug(13010) << "WARNING :returning null 3"<< endl; return 0; } e=e->nextChild(); } kdDebug(13010) << "WARNING :returning null 4" << endl; return 0; } syntaxContextData* SyntaxDocument::getGroupInfo(const QString& mainGroupName, const QString &group) { Opie::XMLElement *e=m_root->firstChild()->firstChild(); while (e) { kdDebug(13010)<<"in SyntaxDocument::getGroupInfo (outer loop) " <<endl; if (e->tagName().compare(mainGroupName)==0 ) { Opie::XMLElement *e1=e->firstChild(); while (e1) { kdDebug(13010)<<"in SyntaxDocument::getGroupInfo (inner loop) " <<endl; if (e1->tagName()==group+"s") { syntaxContextData *data=new ( syntaxContextData); data->parent=e1; data->currentGroup=0; data->item=0; return data; } e1=e1->nextChild(); } kdDebug(13010) << "WARNING : getGroupInfo returning null :1 " << endl; return 0; } e=e->nextChild(); } kdDebug(13010) << "WARNING : getGroupInfo returning null :2" << endl; return 0; } QStringList& SyntaxDocument::finddata(const QString& mainGroup,const QString& type,bool clearList) { Opie::XMLElement *e = m_root->firstChild(); if (clearList) m_data.clear(); for(e=e->firstChild(); e; e=e->nextChild()) { if (e->tagName()==mainGroup) { for (Opie::XMLElement *e1=e->firstChild();e1;e1=e1->nextChild()) { if (e1->tagName()!="list") continue; if (e1->attribute("name")==type) { for (Opie::XMLElement *e2=e1->firstChild();e2;e2=e2->nextChild()) - qDebug("FOUND A LIST ENTRY("+e2->tagName()+"):"+e2->value()); - m_data+="TEST";//e2->value().stripWhiteSpace(); - + { + qDebug("FOUND A LIST ENTRY("+e2->tagName()+"):"+e2->firstChild()->value()); + m_data+=e2->firstChild()->value().stripWhiteSpace(); + } break; } } break; } } return m_data; } |