summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp
Unidiff
Diffstat (limited to 'noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp
index e45daa4..844f27d 100644
--- a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp
+++ b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp
@@ -13,19 +13,19 @@
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18#include "katesyntaxdocument.h" 18#include "katesyntaxdocument.h"
19#include <kateconfig.h>
19#include <qfile.h> 20#include <qfile.h>
20#include <kdebug.h> 21#include <kdebug.h>
21#include <kstddirs.h> 22#include <kstddirs.h>
22#include <klocale.h> 23#include <klocale.h>
23#include <kmessagebox.h> 24#include <kmessagebox.h>
24#include <qstringlist.h> 25#include <qstringlist.h>
25#include <kconfig.h>
26#include <kglobal.h> 26#include <kglobal.h>
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28#include <qdir.h> 28#include <qdir.h>
29 29
30SyntaxDocument::SyntaxDocument() 30SyntaxDocument::SyntaxDocument()
31{ 31{
@@ -48,25 +48,24 @@ SyntaxDocument::~SyntaxDocument()
48 48
49void SyntaxDocument::setupModeList(bool force) 49void SyntaxDocument::setupModeList(bool force)
50{ 50{
51 51
52 if (myModeList.count() > 0) return; 52 if (myModeList.count() > 0) return;
53 53
54 KConfig *config=KGlobal::config(); 54 KateConfig *config=KGlobal::config();
55 KStandardDirs *dirs = KGlobal::dirs(); 55 KStandardDirs *dirs = KGlobal::dirs();
56 56
57// QStringList list=dirs->findAllResources("data","kate/syntax/*.xml",false,true); 57// QStringList list=dirs->findAllResources("data","kate/syntax/*.xml",false,true);
58 QString path=QPEApplication::qpeDir() +"share/tinykate/syntax/"; 58 QString path=QPEApplication::qpeDir() +"share/tinykate/syntax/";
59 59
60 QDir dir(path); 60 QDir dir(path);
61 QStringList list=dir.entryList("*.xml"); 61 QStringList list=dir.entryList("*.xml");
62 62
63 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) 63 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
64 { 64 {
65 QString Group="Highlighting_Cache"+path+*it; 65 QString Group="Highlighting_Cache"+path+*it;
66
67 if ((config->hasGroup(Group)) && (!force)) 66 if ((config->hasGroup(Group)) && (!force))
68 { 67 {
69 config->setGroup(Group); 68 config->setGroup(Group);
70 syntaxModeListItem *mli=new syntaxModeListItem; 69 syntaxModeListItem *mli=new syntaxModeListItem;
71 mli->name = config->readEntry("name",""); 70 mli->name = config->readEntry("name","");
72 mli->section = config->readEntry("section",""); 71 mli->section = config->readEntry("section","");
@@ -93,27 +92,22 @@ void SyntaxDocument::setupModeList(bool force)
93 mli->extension = e->attribute("extensions"); 92 mli->extension = e->attribute("extensions");
94 qDebug(QString("valid description for: %1/%2").arg(mli->section).arg(mli->name)); 93 qDebug(QString("valid description for: %1/%2").arg(mli->section).arg(mli->name));
95 if (mli->section.isEmpty()) 94 if (mli->section.isEmpty())
96 mli->section=i18n("Other"); 95 mli->section=i18n("Other");
97 96
98 mli->identifier = path+(*it); 97 mli->identifier = path+(*it);
99#warning fixme
100/*
101 config->setGroup(Group); 98 config->setGroup(Group);
102 config->writeEntry("name",mli->name); 99 config->writeEntry("name",mli->name);
103 config->writeEntry("section",mli->section); 100 config->writeEntry("section",mli->section);
104 config->writeEntry("mimetype",mli->mimetype); 101 config->writeEntry("mimetype",mli->mimetype);
105 config->writeEntry("extension",mli->extension); 102 config->writeEntry("extension",mli->extension);
106*/
107 myModeList.append(mli); 103 myModeList.append(mli);
108 } 104 }
109 } 105 }
110 } 106 }
111 } 107 }
112// }
113
114// config->sync(); 108// config->sync();
115} 109}
116 110
117SyntaxModeList SyntaxDocument::modeList() 111SyntaxModeList SyntaxDocument::modeList()
118{ 112{
119 return myModeList; 113 return myModeList;