~ubuntu-branches/ubuntu/karmic/qscintilla2/karmic

« back to all changes in this revision

Viewing changes to Qt4/qscilexerxml.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Marek
  • Date: 2009-06-20 12:11:11 UTC
  • mfrom: (1.1.3 upstream) (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090620121111-6xsr2u1usw62eprl
Tags: 2.4-3
* Upload rebuilt packages
* Fixes segfault on import

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
#include <qcolor.h>
39
39
#include <qfont.h>
 
40
#include <qsettings.h>
40
41
 
41
42
 
42
43
// The ctor.
43
44
QsciLexerXML::QsciLexerXML(QObject *parent)
44
 
    : QsciLexerHTML(parent)
 
45
    : QsciLexerHTML(parent),
 
46
      scripts(true)
45
47
{
46
48
}
47
49
 
210
212
 
211
213
    return QsciLexerHTML::defaultPaper(style);
212
214
}
 
215
 
 
216
 
 
217
// Refresh all properties.
 
218
void QsciLexerXML::refreshProperties()
 
219
{
 
220
    setScriptsProp();
 
221
}
 
222
 
 
223
 
 
224
// Read properties from the settings.
 
225
bool QsciLexerXML::readProperties(QSettings &qs, const QString &prefix)
 
226
{
 
227
    int rc = QsciLexerHTML::readProperties(qs, prefix), num;
 
228
 
 
229
    scripts = qs.value(prefix + "scriptsstyled", true).toBool();
 
230
 
 
231
    return rc;
 
232
}
 
233
 
 
234
 
 
235
// Write properties to the settings.
 
236
bool QsciLexerXML::writeProperties(QSettings &qs, const QString &prefix) const
 
237
{
 
238
    int rc = QsciLexerHTML::writeProperties(qs, prefix);
 
239
 
 
240
    qs.setValue(prefix + "scriptsstyled", scripts);
 
241
 
 
242
    return rc;
 
243
}
 
244
 
 
245
 
 
246
// Return true if scripts are styled.
 
247
bool QsciLexerXML::scriptsStyled() const
 
248
{
 
249
    return scripts;
 
250
}
 
251
 
 
252
 
 
253
// Set if scripts are styled.
 
254
void QsciLexerXML::setScriptsStyled(bool styled)
 
255
{
 
256
    scripts = styled;
 
257
 
 
258
    setScriptsProp();
 
259
}
 
260
 
 
261
 
 
262
// Set the "lexer.xml.allow.scripts" property.
 
263
void QsciLexerXML::setScriptsProp()
 
264
{
 
265
    emit propertyChanged("lexer.xml.allow.scripts",(scripts ? "1" : "0"));
 
266
}