Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
81d40def
Commit
81d40def
authored
Sep 29, 2010
by
Leandro Melo
Browse files
Generic highlighter: Create default dir for definitions on user's area (at runtime).
parent
acbb8cd5
Changes
4
Hide whitespace changes
Inline
Side-by-side
share/qtcreator/generic-highlighter/README
deleted
100644 → 0
View file @
acbb8cd5
This is Creator's default directory for syntax highlight definitions.
You can download them through the Generic Highlighter options dialog.
share/qtcreator/static.pro
View file @
81d40def
...
...
@@ -35,7 +35,7 @@ DATA_DIRS = \
qmlicons
\
qml
\
qml
-
type
-
descriptions
\
generic
-
highlight
er
qmljsdebugg
er
!
isEmpty
(
copydata
)
{
...
...
src/plugins/texteditor/generichighlighter/highlightersettings.cpp
View file @
81d40def
...
...
@@ -34,9 +34,9 @@
#include
<QtCore/QSettings>
#include
<QtCore/QLatin1String>
#include
<QtCore/QLatin1Char>
#include
<QtCore/QDebug>
#ifdef Q_OS_UNIX
#include
<QtCore/QDir>
#include
<QtCore/QFile>
#ifdef Q_OS_UNIX
#include
<QtCore/QProcess>
#endif
...
...
@@ -135,8 +135,7 @@ void HighlighterSettings::fromSettings(const QString &category, QSettings *s)
s
->
beginGroup
(
group
);
m_definitionFilesPath
=
s
->
value
(
kDefinitionFilesPath
,
QString
()).
toString
();
if
(
!
s
->
contains
(
kDefinitionFilesPath
))
m_definitionFilesPath
=
Core
::
ICore
::
instance
()
->
resourcePath
()
+
QLatin1String
(
"/generic-highlighter"
);
assignDefaultDefinitionsPath
();
else
m_definitionFilesPath
=
s
->
value
(
kDefinitionFilesPath
).
toString
();
if
(
!
s
->
contains
(
kFallbackDefinitionFilesPath
))
{
...
...
@@ -151,7 +150,7 @@ void HighlighterSettings::fromSettings(const QString &category, QSettings *s)
}
m_alertWhenNoDefinition
=
s
->
value
(
kAlertWhenDefinitionIsNotFound
,
true
).
toBool
();
if
(
!
s
->
contains
(
kIgnoredFilesPatterns
))
assign
Initial
IgnoredPatterns
();
assign
Default
IgnoredPatterns
();
else
setIgnoredFilesPatterns
(
s
->
value
(
kIgnoredFilesPatterns
,
QString
()).
toString
());
s
->
endGroup
();
...
...
@@ -167,7 +166,7 @@ QString HighlighterSettings::ignoredFilesPatterns() const
return
listFromExpressions
().
join
(
QLatin1String
(
","
));
}
void
HighlighterSettings
::
assign
Initial
IgnoredPatterns
()
void
HighlighterSettings
::
assign
Default
IgnoredPatterns
()
{
QStringList
patterns
;
patterns
<<
QLatin1String
(
"*.txt"
)
...
...
@@ -180,6 +179,14 @@ void HighlighterSettings::assignInitialIgnoredPatterns()
setExpressionsFromList
(
patterns
);
}
void
HighlighterSettings
::
assignDefaultDefinitionsPath
()
{
const
QString
&
path
=
Core
::
ICore
::
instance
()
->
userResourcePath
()
+
QLatin1String
(
"/generic-highlighter"
);
if
(
QFile
::
exists
(
path
)
||
QDir
().
mkpath
(
path
))
m_definitionFilesPath
=
path
;
}
bool
HighlighterSettings
::
isIgnoredFilePattern
(
const
QString
&
fileName
)
const
{
foreach
(
const
QRegExp
&
regExp
,
m_ignoredFiles
)
...
...
src/plugins/texteditor/generichighlighter/highlightersettings.h
View file @
81d40def
...
...
@@ -68,7 +68,8 @@ public:
bool
equals
(
const
HighlighterSettings
&
highlighterSettings
)
const
;
private:
void
assignInitialIgnoredPatterns
();
void
assignDefaultIgnoredPatterns
();
void
assignDefaultDefinitionsPath
();
void
setExpressionsFromList
(
const
QStringList
&
patterns
);
QStringList
listFromExpressions
()
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment