[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdevelop] formatters: Merge branch '5.1'
From: Friedrich W. H. Kossebau <null () kde ! org>
Date: 2017-08-01 3:42:36
Message-ID: E1dcO4q-0004fI-CJ () code ! kde ! org
[Download RAW message or body]
Git commit 255b49547e3f1a09cff59caee58a1aedc03b6ad8 by Friedrich W. H. Kossebau.
Committed on 01/08/2017 at 03:39.
Pushed by kossebau into branch 'master'.
Merge branch '5.1'
# Conflicts:
# formatters/customscript/customscript_plugin.cpp
M +1 -0 formatters/astyle/astyle_plugin.cpp
M +3 -0 formatters/customscript/customscript_plugin.cpp
https://commits.kde.org/kdevelop/255b49547e3f1a09cff59caee58a1aedc03b6ad8
diff --cc formatters/customscript/customscript_plugin.cpp
index b236e42cf0,168581d082..926ca9577b
--- a/formatters/customscript/customscript_plugin.cpp
+++ b/formatters/customscript/customscript_plugin.cpp
@@@ -223,50 -233,53 +223,53 @@@ static QList<SourceFormatterStyle> styl
KDevelop::SourceFormatterStyle CustomScriptPlugin::predefinedStyle(const QString& \
name) {
- for ( auto langStyle: stylesFromLanguagePlugins() ) {
- qCDebug(CUSTOMSCRIPT) << "looking at style from language with custom sample" << \
langStyle.description() << langStyle.overrideSample();
- if ( langStyle.name() == name ) {
- return langStyle;
- }
- }
- SourceFormatterStyle result(name);
- if (name == "GNU_indent_GNU")
- {
- result.setCaption(i18n("Gnu Indent: GNU"));
- result.setContent("indent");
- result.setUsePreview(true);
- } else if (name == "GNU_indent_KR") {
- result.setCaption(i18n("Gnu Indent: Kernighan & Ritchie"));
- result.setContent("indent -kr");
- result.setUsePreview(true);
- } else if (name == "GNU_indent_orig") {
- result.setCaption(i18n("Gnu Indent: Original Berkeley indent style"));
- result.setContent("indent -orig");
- result.setUsePreview(true);
- } else if(name == "kdev_format_source") {
- result.setCaption("KDevelop: kdev_format_source");
- result.setContent("kdev_format_source $FILE $TMPFILE");
- result.setUsePreview(false);
- result.setDescription(i18n( "Description:<br />"
- "<b>kdev_format_source</b> is a script bundled with KDevelop "
- "which allows using fine-grained formatting rules by \
placing "
- "meta-files called <b>format_sources</b> into the file-system.<br /><br \
/>"
- "Each line of the <b>format_sources</b> files defines a list of wildcards \
"
- "followed by a colon and the used formatting-command.<br /><br />"
- "The formatting-command should use <b>$TMPFILE</b> to reference the "
- "temporary file to reformat.<br /><br />"
- "Example:<br />"
- "<b>*.cpp *.h : myformatter $TMPFILE</b><br />"
- "This will reformat all files ending with <b>.cpp</b> or <b>.h</b> using "
- "the custom formatting script <b>myformatter</b>.<br /><br />"
- "Example: <br />"
- "<b>subdir/* : uncrustify -l CPP -f $TMPFILE -c uncrustify.config -o \
$TMPFILE</b> <br />"
- "This will reformat all files in subdirectory <b>subdir</b> using the \
<b>uncrustify</b> "
- "tool with the config-file <b>uncrustify.config</b>." ));
- }
- result.setMimeTypes({
- {"text/x-c++src", "C++"}, {"text/x-chdr", "C"},
- {"text/x-c++hdr", "C++"}, {"text/x-csrc", "C"},
- {"text/x-java", "Java"}, {"text/x-csharp", "C#"}
- });
- return result;
+ for (auto langStyle: stylesFromLanguagePlugins()) {
+ qCDebug(CUSTOMSCRIPT) << "looking at style from language with custom \
sample" << langStyle.description() << langStyle.overrideSample(); + if \
(langStyle.name() == name) { + return langStyle;
+ }
+ }
+
+ SourceFormatterStyle result(name);
+ if (name == QLatin1String("GNU_indent_GNU")) {
+ result.setCaption(i18n("Gnu Indent: GNU"));
+ result.setContent(QStringLiteral("indent"));
++ result.setUsePreview(true);
+ } else if (name == QLatin1String("GNU_indent_KR")) {
+ result.setCaption(i18n("Gnu Indent: Kernighan & Ritchie"));
+ result.setContent(QStringLiteral("indent -kr"));
++ result.setUsePreview(true);
+ } else if (name == QLatin1String("GNU_indent_orig")) {
+ result.setCaption(i18n("Gnu Indent: Original Berkeley indent style"));
+ result.setContent(QStringLiteral("indent -orig"));
++ result.setUsePreview(true);
+ } else if (name == QLatin1String("kdev_format_source")) {
+ result.setCaption(QStringLiteral("KDevelop: kdev_format_source"));
+ result.setContent(QStringLiteral("kdev_format_source $FILE $TMPFILE"));
+ result.setUsePreview(false);
+ result.setDescription(i18n("Description:<br />"
+ "<b>kdev_format_source</b> is a script bundled \
with KDevelop " + "which allows using fine-grained \
formatting rules by placing " + "meta-files called \
<b>format_sources</b> into the file-system.<br /><br />" + \
"Each line of the <b>format_sources</b> files defines a list of wildcards " + \
"followed by a colon and the used formatting-command.<br /><br />" + \
"The formatting-command should use <b>$TMPFILE</b> to reference the " + \
"temporary file to reformat.<br /><br />" + \
"Example:<br />" + "<b>*.cpp *.h : myformatter \
$TMPFILE</b><br />" + "This will reformat all \
files ending with <b>.cpp</b> or <b>.h</b> using " + \
"the custom formatting script <b>myformatter</b>.<br /><br />" + \
"Example: <br />" + "<b>subdir/* : uncrustify -l \
CPP -f $TMPFILE -c uncrustify.config -o $TMPFILE</b> <br />" + \
"This will reformat all files in subdirectory <b>subdir</b> using the \
<b>uncrustify</b> " + "tool with the config-file \
<b>uncrustify.config</b>.")); + }
+ result.setMimeTypes({
+ {"text/x-c++src", "C++"}, {"text/x-chdr", "C"},
+ {"text/x-c++hdr", "C++"}, {"text/x-csrc", "C"},
+ {"text/x-java", "Java"}, {"text/x-csharp", "C#"}
+ });
+ return result;
}
QList<KDevelop::SourceFormatterStyle> CustomScriptPlugin::predefinedStyles()
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic