summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate/document
Unidiff
Diffstat (limited to 'noncore/apps/tinykate/libkate/document') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp
index 9fa4452..d8f5aa7 100644
--- a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp
+++ b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp
@@ -36,51 +36,49 @@ SyntaxDocument::SyntaxDocument()
36{ 36{
37 m_root=0; 37 m_root=0;
38 currentFile=""; 38 currentFile="";
39 setupModeList(); 39 setupModeList();
40} 40}
41 41
42void SyntaxDocument::setIdentifier(const QString& identifier) 42void SyntaxDocument::setIdentifier(const QString& identifier)
43{ 43{
44#warning FIXME delete m_root; 44#warning FIXME delete m_root;
45 m_root=Opie::Core::XMLElement::load(identifier); 45 m_root=Opie::Core::XMLElement::load(identifier);
46 if (!m_root) KMessageBox::error( 0L, i18n("Can't open %1").arg(identifier) ); 46 if (!m_root) KMessageBox::error( 0L, i18n("Can't open %1").arg(identifier) );
47 47
48} 48}
49 49
50SyntaxDocument::~SyntaxDocument() 50SyntaxDocument::~SyntaxDocument()
51{ 51{
52} 52}
53 53
54void SyntaxDocument::setupModeList(bool force) 54void SyntaxDocument::setupModeList(bool force)
55{ 55{
56 56
57 if (myModeList.count() > 0) return; 57 if (myModeList.count() > 0) return;
58 58
59 KateConfig *config=KGlobal::config(); 59 KateConfig *config=KGlobal::config();
60 KStandardDirs *dirs = KGlobal::dirs();
61 60
62// QStringList list=dirs->findAllResources("data","kate/syntax/*.xml",false,true);
63 QString path=QPEApplication::qpeDir() +"share/tinykate/syntax/"; 61 QString path=QPEApplication::qpeDir() +"share/tinykate/syntax/";
64 62
65 QDir dir(path); 63 QDir dir(path);
66 QStringList list=dir.entryList("*.xml"); 64 QStringList list=dir.entryList("*.xml");
67 65
68 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) 66 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
69 { 67 {
70 QString Group="Highlighting_Cache"+path+*it; 68 QString Group="Highlighting_Cache"+path+*it;
71 if ((config->hasGroup(Group)) && (!force)) 69 if ((config->hasGroup(Group)) && (!force))
72 { 70 {
73 config->setGroup(Group); 71 config->setGroup(Group);
74 syntaxModeListItem *mli=new syntaxModeListItem; 72 syntaxModeListItem *mli=new syntaxModeListItem;
75 mli->name = config->readEntry("name",""); 73 mli->name = config->readEntry("name","");
76 mli->section = config->readEntry("section",""); 74 mli->section = config->readEntry("section","");
77 mli->mimetype = config->readEntry("mimetype",""); 75 mli->mimetype = config->readEntry("mimetype","");
78 mli->extension = config->readEntry("extension",""); 76 mli->extension = config->readEntry("extension","");
79 mli->identifier = path+*it; 77 mli->identifier = path+*it;
80 myModeList.append(mli); 78 myModeList.append(mli);
81 } 79 }
82 else 80 else
83 { 81 {
84 odebug << "Found a description file:"+path+(*it) << oendl; 82 odebug << "Found a description file:"+path+(*it) << oendl;
85 setIdentifier(path+(*it)); 83 setIdentifier(path+(*it));
86 Opie::Core::XMLElement *e=m_root; 84 Opie::Core::XMLElement *e=m_root;