File 4_1_BRANCH.diff of Package kdelibs4
package: kdelibs-4.1.3.tar.bz2
kdemod: kdelibs
--- BRANCH_STATUS
+++ BRANCH_STATUS
@@ -0,0 +1,2 @@
+current HEAD: 886844
+svn di between //tags/KDE/4.1.3/kdelibs and //branches/KDE/4.1/kdelibs
--- khtml/khtmlimage_init.cpp
+++ khtml/khtmlimage_init.cpp
@@ -19,3 +19,11 @@
#include <khtml_export.h>
+// Defined in libkhtml
+extern "C" KDE_EXPORT void* init_khtmlimagefactory();
+
+// The real entry point for khtmlimagepart
+extern "C" KDE_EXPORT void* init_khtmlimagepart() {
+ return init_khtmlimagefactory();
+}
+
--- khtml/khtmlimage.cpp
+++ khtml/khtmlimage.cpp
@@ -39,7 +39,7 @@
// Export init_khtmlimagefactory. This way we don't have to export the whole class
// just for khtmlimagepart. See khtmlimage_init.cpp
-K_EXPORT_COMPONENT_FACTORY(khtmlimagepart, KHTMLImageFactory)
+K_EXPORT_COMPONENT_FACTORY( khtmlimagefactory, KHTMLImageFactory )
KComponentData *KHTMLImageFactory::s_componentData = 0;
--- khtml/html/html_formimpl.cpp
+++ khtml/html/html_formimpl.cpp
@@ -1232,7 +1232,8 @@
RenderStyle* const _style = document()->styleSelector()->styleForElement(this);
_style->ref();
- if (parentNode()->renderer() && _style->display() != NONE) {
+ if (parentNode()->renderer() && parentNode()->renderer()->childAllowed() &&
+ _style->display() != NONE) {
m_render = new (document()->renderArena()) RenderFieldset(this);
m_render->setStyle(_style);
}
@@ -1384,6 +1385,7 @@
setChanged();
break;
case HIDDEN:
+ case PASSWORD:
// Don't mess with those...
break;
default:
@@ -2328,7 +2330,8 @@
RenderStyle* const _style = document()->styleSelector()->styleForElement(this);
_style->ref();
- if (parentNode()->renderer() && _style->display() != NONE) {
+ if (parentNode()->renderer() && parentNode()->renderer()->childAllowed() &&
+ _style->display() != NONE) {
m_render = new (document()->renderArena()) RenderSelect(this);
m_render->setStyle(_style);
}
--- khtml/html/html_canvasimpl.cpp
+++ khtml/html/html_canvasimpl.cpp
@@ -1584,4 +1584,20 @@
p.drawImage(x, y, id->data);
}
+CanvasImageDataImpl* CanvasContext2DImpl::createImageData(float sw, float sh, int& exceptionCode)
+{
+ int w = qRound(qAbs(sw));
+ int h = qRound(qAbs(sh));
+
+ if (w == 0 || h == 0) {
+ exceptionCode = DOMException::INDEX_SIZE_ERR;
+ return 0;
+ }
+
+ CanvasImageDataImpl* id = new CanvasImageDataImpl(w, h);
+ id->data.fill(Qt::transparent);
+
+ return id;
+}
+
// kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;
--- khtml/html/html_inlineimpl.cpp
+++ khtml/html/html_inlineimpl.cpp
@@ -224,7 +224,7 @@
assert(!m_render);
assert(parentNode());
- if (parentNode()->renderer()) {
+ if (parentNode()->renderer() && parentNode()->renderer()->childAllowed()) {
RenderStyle* style = document()->styleSelector()->styleForElement( this );
style->ref();
if( style->display() != NONE ) {
@@ -250,7 +250,7 @@
assert(!m_render);
assert(parentNode());
- if (parentNode()->renderer()) {
+ if (parentNode()->renderer() && parentNode()->renderer()->childAllowed()) {
RenderStyle* style = document()->styleSelector()->styleForElement( this );
style->ref();
if( style->display() != NONE ) {
--- khtml/html/html_canvasimpl.h
+++ khtml/html/html_canvasimpl.h
@@ -282,6 +282,7 @@
// Pixel ops
CanvasImageDataImpl* getImageData(float sx, float sy, float sw, float sh, int& exceptionCode);
void putImageData(CanvasImageDataImpl* data, float dx, float dy, int& exceptionCode);
+ CanvasImageDataImpl* createImageData(float sw, float sh, int& exceptionCode);
private:
friend class HTMLCanvasElementImpl;
--- khtml/ecma/kjs_context2d.h
+++ khtml/ecma/kjs_context2d.h
@@ -105,7 +105,7 @@
BeginPath, ClosePath, MoveTo, LineTo, QuadraticCurveTo, BezierCurveTo, ArcTo, Rect, Arc,
Fill, Stroke, Clip, IsPointInPath, // paths
DrawImage, // do we want backwards compat for drawImageFromRect?
- GetImageData, PutImageData // pixel ops. ewww.
+ GetImageData, PutImageData, CreateImageData // pixel ops. ewww.
};
};
--- khtml/ecma/kjs_context2d.cpp
+++ khtml/ecma/kjs_context2d.cpp
@@ -121,6 +121,7 @@
# pixel ops.
getImageData Context2D::GetImageData DontDelete|Function 4
putImageData Context2D::PutImageData DontDelete|Function 3
+ createImageData Context2D::CreateImageData DontDelete|Function 2
@end
*/
@@ -473,6 +474,14 @@
ctx->putImageData(id.get(), args[1]->toFloat(exec), args[2]->toFloat(exec), exception);
break;
}
+ case Context2D::CreateImageData: {
+ KJS_REQUIRE_ARGS(2);
+ KJS_CHECK_FLOAT_ARGS(0, 1);
+ CanvasImageDataImpl* id = ctx->createImageData(args[0]->toFloat(exec),
+ args[1]->toFloat(exec),
+ exception);
+ return getWrapper<CanvasImageData>(exec, id);
+ }
}
--- khtml/rendering/render_inline.cpp
+++ khtml/rendering/render_inline.cpp
@@ -397,7 +397,7 @@
* Appends the given point to the point-array, doing necessary reductions to
* produce a path without spikes and segment separators.
*/
-static void appendPoint(QVector<QPoint> &pointArray, QPoint &pnt)
+static void appendPoint(QVector<QPoint> &pointArray, const QPoint &pnt)
{
if (!appendIfNew(pointArray, pnt)) return;
// kDebug(6040) << "appendPoint: appended " << pnt;
@@ -536,6 +536,21 @@
* the point-array (by changing the array's starting iterator), and
* proper ones appended to the point-array's back.
*
+ * X---------------+ X------------------+
+ * ^ | ^ |
+ * | | ==> | |
+ * +..... ...+ +..... ...+
+ *
+ * +----->X--------+ +----------------->X
+ * | | ==> | |
+ * +..... ...+ +..... ...+
+ *
+ * ^X
+ * ||
+ * +-----++--------+ +----------------->X
+ * | | ==> | |
+ * +..... ...+ +..... ...+
+ *
* @param pointArray point-array
* @return actual begin of point array
*/
@@ -564,13 +579,32 @@
|| plast.y() == pfirst.y() && pfirst.y() == pnext.y()) {
++index;
- appendPoint(pointArray, pfirst);
+ appendPoint(pointArray, pfirst); // ### do we really need this point?
appendPoint(pointArray, pnext);
+ // ended up at a segment separator? move one point forward
+ if (plast == pnext) {
+ ++index;
+ appendPoint(pointArray, *++it);
+ }
} else if (linkup)
pointArray.push_back(linkupPnt);
return pointArray.begin() + index;
}
+// assumes clock-wise orientation
+static RenderObject::BorderSide borderSide( const QPoint &first,
+ const QPoint &second )
+{
+ if (second.x() > first.x())
+ return RenderObject::BSTop;
+ else if (second.x() < first.x())
+ return RenderObject::BSBottom;
+ else if (second.y() > first.y())
+ return RenderObject::BSRight;
+ else // second.y() < first.y()
+ return RenderObject::BSLeft;
+}
+
void RenderInline::paintOutlines(QPainter *p, int _tx, int _ty)
{
if (style()->outlineWidth() == 0 || style()->outlineStyle() <= BHIDDEN)
@@ -595,8 +629,17 @@
const QPoint *begin = linkEndToBegin(path);
+ // initial borderside and direction values
+ QPoint pstart = *begin;
+ QPoint pprev = *(path.end() - 2);
+ RenderObject::BorderSide bs = borderSide(pprev, pstart);
+ QPoint diff = pstart - pprev;
+ int direction = diff.x() + diff.y();
+ RenderObject::BorderSide endingBS = borderSide(*begin, *(begin + 1));
+
// paint the outline
- paintOutlinePath(p, _tx, _ty, begin, path.end(), BSLeft, -1, BSTop);
+ paintOutlinePath(p, _tx, _ty, begin, path.end(),
+ bs, direction, endingBS);
}
}
@@ -630,7 +673,8 @@
* by the given coordinates, the old border side, and the relative direction.
*
* The relative direction specifies whether the old border side meets with the
- * straight given by the coordinates from below (negative), or above (positive).
+ * straight given by the coordinates from below/right (negative), or
+ * above/left (positive).
*/
inline RenderObject::BorderSide newBorderSide(RenderObject::BorderSide oldBS, int direction, const QPoint &last, const QPoint &cur)
{
--- khtml/rendering/render_replaced.h
+++ khtml/rendering/render_replaced.h
@@ -174,7 +174,7 @@
RenderWidget* renderWidget() const { return m_rw; }
void setRenderWidget(RenderWidget* rw) { m_rw = rw; }
bool isRedirected() const { return m_redirected; }
- void setIsRedirected( bool b ) { m_redirected = b; }
+ void setIsRedirected( bool b );
void setPos( const QPoint& p ) { m_pos = p; }
private:
QPoint m_pos;
--- khtml/rendering/render_form.cpp
+++ khtml/rendering/render_form.cpp
@@ -1074,6 +1074,13 @@
void RenderFileButton::slotReturnPressed()
{
+ // don't submit the form when return was pressed in a completion-popup
+ KCompletionBox* box = widget()->lineEdit()->completionBox(false);
+ if (box && box->isVisible() && box->currentRow() != -1) {
+ box->hide();
+ return;
+ }
+
handleFocusOut();
if (element()->form())
--- khtml/rendering/render_object.cpp
+++ khtml/rendering/render_object.cpp
@@ -784,7 +784,7 @@
p->printTree();
#endif
}
- return 0L;
+ return canvas(); // likely wrong, but better than a crash
}
return static_cast<RenderBlock*>( o );
--- khtml/rendering/render_replaced.cpp
+++ khtml/rendering/render_replaced.cpp
@@ -228,6 +228,8 @@
KHTMLAssert( refCount() <= 0 );
if(m_widget) {
+ if (m_widget->hasFocus ())
+ m_widget->clearFocus ();
m_widget->hide();
if (m_ownsWidget)
m_widget->deleteLater();
@@ -1223,6 +1225,16 @@
return last;
}
+void KHTMLWidgetPrivate::setIsRedirected( bool b )
+{
+ m_redirected = b;
+ if (!b && m_rw && m_rw->widget()) {
+ setInPaintEventFlag( m_rw->widget(), false );
+ m_rw->widget()->setAttribute(Qt::WA_OpaquePaintEvent, false);
+ m_rw->widget()->removeEventFilter(m_rw->view());
+ }
+}
+
// -----------------------------------------------------------------------------
KHTMLWidget::KHTMLWidget()
--- cmake/modules/FindMusicBrainz.cmake
+++ cmake/modules/FindMusicBrainz.cmake
@@ -10,16 +10,18 @@
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-
if(MUSICBRAINZ_INCLUDE_DIR AND MUSICBRAINZ_LIBRARIES)
set(MUSICBRAINZ_FIND_QUIETLY TRUE)
endif(MUSICBRAINZ_INCLUDE_DIR AND MUSICBRAINZ_LIBRARIES)
FIND_PATH(MUSICBRAINZ_INCLUDE_DIR musicbrainz/musicbrainz.h)
-
FIND_LIBRARY( MUSICBRAINZ_LIBRARIES NAMES musicbrainz)
+# We need version 2, version 3 is source-incompatible
+FIND_PATH(MUSICBRAINZ3_INCLUDE_DIR musicbrainz3/musicbrainz.h)
+if(MUSICBRAINZ3_INCLUDE_DIR AND NOT MUSICBRAINZ_INCLUDE_DIR)
+ message(STATUS "\nIncompatible version 3.x of the musicbrainz includes detected. Version 2.x is needed.\n")
+endif(MUSICBRAINZ3_INCLUDE_DIR AND NOT MUSICBRAINZ_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args( MusicBrainz DEFAULT_MSG
--- kate/syntax/data/lilypond.xml
+++ kate/syntax/data/lilypond.xml
@@ -8,14 +8,14 @@
<!ENTITY scripts "\d+|accent|marcato|staccat(issim)?o|espressivo|tenuto|portato|(up|down)(bow|mordent|prall)|flageolet|thumb|[lr](heel|toe)|open|stopped|turn|reverseturn|trill|mordent|prall(prall|mordent|down|up)?|lineprall|signumcongruentiae|(short|long|verylong)?fermata|segno|(var)?coda">
<!ENTITY keywords "accepts|alias|consists|defaultchild|denies|description|grobdescriptions|include|invalid|name|objectid|once|remove|sequential|simultaneous|type|version|score|book">
<!ENTITY deprecatedkeywords "consistsend">
- <!ENTITY commands "acciaccatura|addQuote|afterGrace|aikenHeads|allowPageTurn|alternative|apply(Context|Music|Output)|appoggiatura|arpeggio(Bracket|Down|Neutral|Up)?|(a|de)scendens|auctum|augmentum|autoBeamO(ff|n)|autochange|balloon(Grob)?Text|bar|barNumberCheck|bendAfter|breathe|break|cadenzaO(ff|n)|caesura|cavum|clef(\s+(treble|violin|G|alto|C|(sub)?bass|F|french|(mezzo)?soprano|(var)?baritone|percussion|tab))?|compressMusic|(end)?(de)?cr|(cue|transposedCue)During|default|deminutum|display(Lily)?Music|divisio(Maior|Maxima|Minima)|(dynamic|dots|phrasingSlur|slur|stem|tie|tuplet)(Down|Neutral|Up)|textLengthO(ff|n)|featherDurations|figure(mode|s)|finalis|flexa|(french|german|italian|semiGerman)Chords|glissando|grace|harmonic|(unH|h)ideNotes|(hide|show)StaffSwitch|inclinatum|(keep|remove)WithTag|key(\s+&pitch;)?|killCues|label|laissezVibrer|linea|mark|maxima|melisma(End)?|newSpacingSection|no(Beam|Break|PageBreak|PageTurn)|normalsize|octave|oneVoice|oriscus|page(-ref|Break|Turn)|parallelMusic|parenthesize|partcombine|partial(\s*&duration;)?|pes|pitchedTrill|quilisma|quoteDuring|relative(\s+&pitch;)?|RemoveEmptyStaffContext|repeat(\s+(unfold|volta|tremolo|percent)(\s+\d+)?)?|repeatTie|resetRelativeOctave|rest|sacredHarpHeads|scoreTweak|easyHeadsO(ff|n)|set(Hairpin|Text)(Cresc|Decresc|Dim)|setTextDecr|shift(Durations|Off|On{1,3})|(slur|tie)(Both|Dashed|Dotted|Solid)|small|spacingTweaks|(start|stop)(Group|(Text|Trill)Span|Staff)|stemBoth|stropha|super|(sustain|sostenuto)(Down|Up)|table-of-contents|tag|tempo(\s*\d+\.*\s*=\s*\d+)?|times?(\s*\d+/\d+)?|tiny|tocItem|transpose(\s+&pitch;\s*&pitch;)?|transposition(\s+&pitch;)|tweak|unfoldRepeats|virg(ul)?a|voice(One|Two|Three|Four)|withMusicProperty|cm|mm|in|pt|major|minor|ionian|locrian|aeolian|mixolydian|lydian|phrygian|dorian">
- <!ENTITY deprecatedcommands "newpage|script(Up|Down|Both)|(empty|fat)Text|setEasyHeads|(default|voice|modernVoice|piano|forget)Accidentals|(modern(Voice)?|piano)Cautionaries|noResetKey">
- <!ENTITY markupnotextargs "arrow-head|beam|char|double(flat|sharp)|draw-(circle|line)|epsfile|filled-box|flat|fret-diagram(-terse|-verbose)?|fromproperty|justify-(field|string)|lookup|markalphabet|markletter|musicglyph|natural|note-by-number|note|null|semi(flat|sharp)|sesqui(flat|sharp)|sharp|simple|slashed-digit|stencil|strut|tied-lyric|triangle|verbatim-file|wordwrap-field">
- <!ENTITY markupwithtextargs "markup|bigger|bold|box|bracket|caps|(center|general|left|right)-align|circle|column|combine|concat|dir-column|dynamic|fill-line|finger|fontCaps|fontsize|fraction|halign|hbracket|hcenter-in|hcenter|hspace|huge|italic|justify|larger?|line|lower|magnify|medium|normal-size-(sub|super)|normal-text|normalsize|number|on-the-fly|override|pad-(around|markup|to-box|x)|page-ref|postscript|put-adjacent|raise|roman|rotate|sans|small(er)?|smallCaps|sub|super|teeny|text|tiny|translate(-scaled)?|transparent|typewriter|underline|upright|vcenter|whiteout|with-(color|dimensions|url)|wordwrap(-string)?|(markup|column-|justified-|override-|wordwrap-)lines">
- <!ENTITY deprecatedmarkup "center">
- <!ENTITY headervars "dedication|(sub){,2}title|poet|composer|meter|opus|arranger|instrument|piece|breakbefore|copyright|tagline|mutopia(title|composer|poet|opus|instrument)|date|enteredby|source|style|maintainer(Email|Web)?|moreInfo|lastupdated|texidoc">
- <!ENTITY papervars "annotate-spacing|(print-)?first-page-number|print-page-number|paper-(width|height)|(top|bottom|left|right)-margin|line-width|(head|foot)-separation|page-top-space|ragged-(bottom|last-bottom|right)|page-count|between-system-(space|padding)|page-breaking-between-system-padding|horizontal-shift|(before|after|between)-title-space|printallheaders|indent|force-assignment|input-encoding|output-scale|blank(-after-score|-last)?-page-force|page-limit-inter-system-space(-factor)?|(systemSeparator|(even|odd)(Footer|Header)|(book|score|toc)Title|tocItem)Markup">
- <!ENTITY layoutvars "system-count|indent">
+ <!ENTITY commands "acciaccatura|addQuote|afterGrace|aikenHeads|allowPageTurn|alternative|apply(Context|Music|Output)|appoggiatura|arpeggio(Arrow(Down|Up)|Bracket|Normal|Parenthesis)?|(a|de)scendens|auctum|augmentum|autoBeamO(ff|n)|autochange|balloon(Grob)?Text|bar|barNumberCheck|bendAfter|breathe|break|cadenzaO(ff|n)|cavum|clef(\s+(treble|violin|G|alto|C|(sub)?bass|F|french|(mezzo)?soprano|(var)?baritone|percussion|tab))?|(end)?(de)?cr|cresc(TextCresc|Hairpin)|(cue|transposedCue)During|default|deminutum|dim(Text(Decresc|Decr|Dim)|Hairpin)|display(Lily)?Music|divisio(Maior|Maxima|Minima)|(dynamic|dots|phrasingSlur|slur|stem|tie|tuplet)(Down|Neutral|Up)|(balloon|text)LengthO(ff|n)|featherDurations|figure(mode|s)|finalis|flexa|(french|german|italian|semiGerman)Chords|glissando|grace|harmonic|(unH|h)ideNotes|(hide|show)StaffSwitch|inclinatum|(keep|remove)WithTag|key(\s+&pitch;)?|killCues|label|laissezVibrer|linea|mark|maxima|melisma(End)?|newSpacingSection|no(Beam|Break|PageBreak|PageTurn)|normalsize|octaveCheck|oneVoice|oriscus|ottava|page(-ref|Break|Turn)|parallelMusic|parenthesize|partcombine|partial(\s*&duration;)?|pes|pitchedTrill|pointAndClickO(ff|n)|quilisma|quoteDuring|relative(\s+&pitch;)?|RemoveEmptyStaffContext|repeat(\s+(unfold|volta|tremolo|percent)(\s+\d+)?)?|repeatTie|resetRelativeOctave|rest|sacredHarpHeads|scaleDurations|scoreTweak|easyHeadsO(ff|n)|shift(Durations|Off|On{1,3})|(slur|tie)(Both|Dashed|Dotted|Solid)|small|spacingTweaks|(start|stop)(Group|(Text|Trill)Span|Staff)|stemBoth|stropha|super|(sustain|sostenuto)O(ff|n)|table-of-contents|tag|times?(\s*\d+/\d+)?|tiny|tocItem|transpose(\s+&pitch;\s*&pitch;)?|transposition(\s+&pitch;)|tweak|unfoldRepeats|virg(ul)?a|voice(One|Two|Three|Four)|withMusicProperty|cm|mm|in|pt|major|minor|ionian|locrian|aeolian|mixolydian|lydian|phrygian|dorian">
+ <!ENTITY deprecatedcommands "arpeggio(Up|Down|Neutral)|newpage|script(Up|Down|Both)|(empty|fat)Text|setEasyHeads|(default|voice|modernVoice|piano|forget)Accidentals|(modern(Voice)?|piano)Cautionaries|noResetKey|compressMusic|octave|(sustain|sostenuto)(Down|Up)|set(Hairpin|Text)(Cresc|Decresc|Dim)|setTextDecr">
+ <!ENTITY markupnotextargs "arrow-head|beam|char|(semi|sesqui|double)?(flat|sharp)|draw-(circle|line)|epsfile|filled-box|fret-diagram(-terse|-verbose)?|fromproperty|harp-pedal|(justify|wordwrap)-(field|string)|lookup|markalphabet|markletter|musicglyph|natural|note-by-number|note|null|simple|(back)?slashed-digit|stencil|strut|tied-lyric|triangle|verbatim-file">
+ <!ENTITY markupwithtextargs "markup|bold|(rounded-)?box|bracket|caps|(center|general|left|right)-align|circle|((center|dir|left|right)-)?column|combine|concat|dynamic|fill-line|finger|fontCaps|(abs-)?fontsize|fraction|halign|hbracket|hcenter-in|hcenter|hspace|huge|italic|justify|larger?|line|lower|magnify|medium|normal-size-(sub|super)|normal-text|normalsize|number|on-the-fly|override|pad-(around|markup|to-box|x)|page-ref|postscript|put-adjacent|raise|roman|rotate|sans|small(er)?|smallCaps|sub|super|teeny|text|tiny|translate(-scaled)?|transparent|typewriter|underline|upright|vcenter|whiteout|with-(color|dimensions|url)|wordwrap|(markup|column-|justified-|override-|wordwrap-)lines|wordwrap-(string-)?internal">
+ <!ENTITY deprecatedmarkup "bigger|h?center">
+ <!ENTITY headervars "dedication|(sub){,2}title|poet|composer|meter|opus|arranger|instrument|piece|breakbefore|copyright|tagline|mutopia(title|composer|poet|opus|instrument)|date|enteredby|source|style|maintainer(Email|Web)?|moreInfo|lastupdated|texidoc|footer">
+ <!ENTITY papervars "annotate-spacing|(print-)?first-page-number|print-page-number|paper-(width|height)|(top|bottom|left|right)-margin|line-width|(head|foot)-separation|page-top-space|ragged-(bottom|last(-bottom)?|right)|page-count|between-system-(space|padding)|page-breaking-between-system-padding|horizontal-shift|(before|after|between)-title-space|print-all-headers|indent|force-assignment|input-encoding|output-scale|blank(-after-score|-last)?-page-force|page-limit-inter-system-space(-factor)?|(systemSeparator|(even|odd)(Footer|Header)|(book|score|toc)Title|tocItem)Markup">
+ <!ENTITY layoutvars "system-count|(short-)?indent">
<!ENTITY toplevelvars "dash(Hat|Plus|Dash|Bar|Larger|Dot|Underscore)|fermataMarkup|pipeSymbol|slashSeparator">
<!ENTITY performer "Beam|Control_track|Drum_note|Dynamic|Key|Lyric|Note|Piano_pedal|Slur|Staff|Swallow|Tempo|Tie|Time_signature">
<!ENTITY translator "Note_swallow|Rest_swallow|Skip_event_swallow|Timing">
@@ -24,15 +24,24 @@
<!ENTITY schemename "[a-zA-Z#][^\s(){}[\];$"]*">
<!ENTITY schemefunc "\b(define|defined\?|define\*(-public)?|define-(\*|builtin-markup-(list-)?command|class|(extra-)?display-method|fonts?|grob-property|ly-syntax(-loc|-simple)?|macro(-public)?|markup-(list-)command|method|module|music-function|post-event-display-method|public(-macro|-toplevel)?|safe-public|span-event-display-method)|defmacro(\*(-public)?)?|lambda\*?|and|or|if|cond|case|let\*?|letrec|begin|do|delay|set!|else|(quasi)?quote|unquote(-splicing)?|(define|let|letrec)-syntax|syntax-rules|not|boolean\?|eq\?|eqv\?|equal\?|pair\?|cons|set-c[ad]r!|c[ad]{1,4}r|null\?|list\?|list|length|append|reverse|list-ref|mem[qv]|member|ass[qv]|assoc|symbol\?|symbol->string|string->symbol|number\?|complex\?|real\?|rational\?|integer\?|exact\?|inexact\?|zero\?|positive\?|negative\?|odd\?|even\?|max|min|abs|quotient|remainder|modulo|gcd|lcm|numerator|denominator|floor|ceiling|truncate|round|rationalize|exp|log|sin|cos|tan|asin|acos|atan|sqrt|expt|make-rectangular|make-polar|real-part|imag-part|magnitude|angle|exact->inexact|inexact->exact|number->string|string->number|char((-ci)?(=\?|<\?|>\?|<=\?|>=\?)|-alphabetic\?|\?|-numeric\?|-whitespace\?|-upper-case\?|-lower-case\?|->integer|-upcase|-downcase|-ready\?)|integer->char|make-string|string(\?|-copy|-fill!|-length|-ref|-set!|(-ci)?(=\?|<\?|>\?|<=\?|>=\?)|-append)|substring|make-vector|vector(\?|-length|-ref|-set!|-fill!)?|procedure\?|apply|map|for-each|force|call-with-(current-continuation|(in|out)put-file)|(in|out)put-port\?|current-(in|out)put-port|open-(in|out)put-file|close-(in|out)put-port|eof-object\?|read|(read|peek)-char|write(-char)?|display|newline|call/cc|list-tail|string->list|list->string|vector->list|list->vector|with-input-from-file|with-output-to-file|load|transcript-(on|off)|eval|dynamic-wind|port\?|values|call-with-values|(scheme-report-|null-|interaction-)environment)(?=($|\s|\)))">
]>
-<language name="LilyPond" section="Other" version="2.20" kateversion="2.4" extensions="*.ly;*.LY;*.ily;*.ILY;*.lyi;*.LYI" mimetype="text/x-lilypond" author="Wilbert Berendsen (info@wilbertberendsen.nl)" license="LGPL">
+<language name="LilyPond" section="Other" style="lilypond" version="3.00" kateversion="3.0" extensions="*.ly;*.LY;*.ily;*.ILY;*.lyi;*.LYI" mimetype="text/x-lilypond" author="Wilbert Berendsen (info@wilbertberendsen.nl)" license="LGPL">
<!--
+ October, 2008
+ Minor updates by Wilbert Berendsen
+
+ Changes:
+
+ - More new LilyPond commands (2.12) and some more deprecated words
+ - Match deprecated properties after header vars
+ - Special case \tempo command
+
January, 2008
Fully rewritten by Wilbert Berendsen (info@wilbertberendsen.nl)
-
+
Changes:
-
+
- correctly parse pitches, chords, durations, etc. marking often made mistakes as invalid
- speed up by shortening contexts, e.g. branch out on a \, instead of RegExpr'ing all \commands
- recognize some contexts like \layout, \with, \header to colorcode variables, engravers, etc. only there
@@ -41,12 +50,12 @@
- add \figuremode recognition
- all Scheme stuff has a nice, very light background, to show where Lilypond is in Scheme mode.
- mark some deprecated (pre 2.12) LilyPond commands and properties
-
+
October, 2007
New version by Wilbert Berendsen (info@wilbertberendsen.nl)
-
+
Changes:
-
+
- better recognition of being inside lyrics, drums, notes, chords and markup sections
- detect block comments %{ %}
- links to ##Alerts in comments (e.g. TODO, FIXME)
@@ -56,171 +65,171 @@
- more scheme improvements: strings, numbers, $substitutions, lilypond objects
- highlights many variables, commands, lilypond objects, properties, engravers, etc.
- by using entities for many regexps the main syntax checking parts remain legible, and the file more maintainable.
-
+
I borrowed some colors and the drum names from Andrea Primiani's first version (August, 2004).
-
+
-->
<highlighting>
<list name="contexts">
- <item> ChoirStaff </item>
- <item> ChordNames </item>
- <item> CueVoice </item>
- <item> Devnull </item>
- <item> DrumStaff </item>
- <item> DrumVoice </item>
- <item> FiguredBass </item>
- <item> FretBoards </item>
- <item> Global </item>
- <item> GrandStaff </item>
- <item> GregorianTranscriptionStaff </item>
- <item> GregorianTranscriptionVoice </item>
- <item> InnerChoirStaff </item>
- <item> InnerStaffGroup </item>
- <item> Lyrics </item>
- <item> MensuralStaff </item>
- <item> MensuralVoice </item>
- <item> NoteNames </item>
- <item> PianoStaff </item>
- <item> RhythmicStaff </item>
- <item> Score </item>
- <item> Staff </item>
- <item> StaffGroup </item>
- <item> TabStaff </item>
- <item> TabVoice </item>
- <item> VaticanaStaff </item>
- <item> VaticanaVoice </item>
+ <item> ChoirStaff </item>
+ <item> ChordNames </item>
+ <item> CueVoice </item>
+ <item> Devnull </item>
+ <item> DrumStaff </item>
+ <item> DrumVoice </item>
+ <item> FiguredBass </item>
+ <item> FretBoards </item>
+ <item> Global </item>
+ <item> GrandStaff </item>
+ <item> GregorianTranscriptionStaff </item>
+ <item> GregorianTranscriptionVoice </item>
+ <item> InnerChoirStaff </item>
+ <item> InnerStaffGroup </item>
+ <item> Lyrics </item>
+ <item> MensuralStaff </item>
+ <item> MensuralVoice </item>
+ <item> NoteNames </item>
+ <item> PianoStaff </item>
+ <item> RhythmicStaff </item>
+ <item> Score </item>
+ <item> Staff </item>
+ <item> StaffGroup </item>
+ <item> TabStaff </item>
+ <item> TabVoice </item>
+ <item> VaticanaStaff </item>
+ <item> VaticanaVoice </item>
<item> Voice </item>
</list>
<list name="layoutobjects">
- <item> Accidental </item>
- <item> AccidentalCautionary </item>
- <item> AccidentalPlacement </item>
- <item> AccidentalSuggestion </item>
- <item> Ambitus </item>
- <item> AmbitusAccidental </item>
- <item> AmbitusLine </item>
- <item> AmbitusNoteHead </item>
- <item> Arpeggio </item>
- <item> BalloonTextItem </item>
- <item> BarLine </item>
- <item> BarNumber </item>
- <item> BassFigure </item>
- <item> BassFigureAlignment </item>
- <item> BassFigureAlignmentPositioning </item>
- <item> BassFigureBracket </item>
- <item> BassFigureContinuation </item>
- <item> BassFigureLine </item>
- <item> Beam </item>
- <item> BendAfter </item>
- <item> BreakAlignGroup </item>
- <item> BreakAlignment </item>
- <item> BreathingSign </item>
- <item> ChordName </item>
- <item> Clef </item>
- <item> ClusterSpanner </item>
- <item> ClusterSpannerBeacon </item>
- <item> CombineTextScript </item>
- <item> Custos </item>
- <item> DotColumn </item>
- <item> Dots </item>
- <item> DoublePercentRepeat </item>
- <item> DoublePercentRepeatCounter </item>
- <item> DynamicLineSpanner </item>
- <item> DynamicText </item>
- <item> DynamicTextSpanner </item>
- <item> Fingering </item>
- <item> FretBoard </item>
- <item> Glissando </item>
- <item> GraceSpacing </item>
- <item> GridLine </item>
- <item> GridPoint </item>
- <item> Hairpin </item>
- <item> HarmonicParenthesesItem </item>
- <item> HorizontalBracket </item>
- <item> InstrumentName </item>
- <item> InstrumentSwitch </item>
- <item> KeyCancellation </item>
- <item> KeySignature </item>
- <item> LaissezVibrerTie </item>
- <item> LaissezVibrerTieColumn </item>
- <item> LedgerLineSpanner </item>
- <item> LeftEdge </item>
- <item> LigatureBracket </item>
- <item> LyricExtender </item>
- <item> LyricHyphen </item>
- <item> LyricSpace </item>
- <item> LyricText </item>
- <item> MeasureGrouping </item>
- <item> MelodyItem </item>
- <item> MensuralLigature </item>
- <item> MetronomeMark </item>
- <item> MultiMeasureRest </item>
- <item> MultiMeasureRestNumber </item>
- <item> MultiMeasureRestText </item>
- <item> NonMusicalPaperColumn </item>
- <item> NoteCollision </item>
- <item> NoteColumn </item>
- <item> NoteHead </item>
- <item> NoteName </item>
- <item> NoteSpacing </item>
- <item> OctavateEight </item>
- <item> OttavaBracket </item>
- <item> PaperColumn </item>
- <item> ParenthesesItem </item>
- <item> PercentRepeat </item>
- <item> PercentRepeatCounter </item>
- <item> PhrasingSlur </item>
- <item> PianoPedalBracket </item>
- <item> RehearsalMark </item>
- <item> RepeatSlash </item>
- <item> RepeatTie </item>
- <item> RepeatTieColumn </item>
- <item> Rest </item>
- <item> RestCollision </item>
- <item> Script </item>
- <item> ScriptColumn </item>
- <item> ScriptRow </item>
- <item> SeparationItem </item>
- <item> Slur </item>
- <item> SostenutoPedal </item>
- <item> SostenutoPedalLineSpanner </item>
- <item> SpacingSpanner </item>
- <item> SpanBar </item>
- <item> StaffSpacing </item>
- <item> StaffSymbol </item>
- <item> StanzaNumber </item>
- <item> Stem </item>
- <item> StemTremolo </item>
- <item> StringNumber </item>
- <item> StrokeFinger </item>
- <item> SustainPedal </item>
- <item> SustainPedalLineSpanner </item>
- <item> System </item>
- <item> SystemStartBar </item>
- <item> SystemStartBrace </item>
- <item> SystemStartBracket </item>
- <item> SystemStartSquare </item>
- <item> TabNoteHead </item>
- <item> TextScript </item>
- <item> TextSpanner </item>
- <item> Tie </item>
- <item> TieColumn </item>
- <item> TimeSignature </item>
- <item> TrillPitchAccidental </item>
- <item> TrillPitchGroup </item>
- <item> TrillPitchHead </item>
- <item> TrillSpanner </item>
- <item> TupletBracket </item>
- <item> TupletNumber </item>
- <item> UnaCordaPedal </item>
- <item> UnaCordaPedalLineSpanner </item>
- <item> VaticanaLigature </item>
- <item> VerticalAlignment </item>
- <item> VerticalAxisGroup </item>
- <item> VoiceFollower </item>
- <item> VoltaBracket </item>
- <item> VoltaBracketSpanner </item>
+ <item> Accidental </item>
+ <item> AccidentalCautionary </item>
+ <item> AccidentalPlacement </item>
+ <item> AccidentalSuggestion </item>
+ <item> Ambitus </item>
+ <item> AmbitusAccidental </item>
+ <item> AmbitusLine </item>
+ <item> AmbitusNoteHead </item>
+ <item> Arpeggio </item>
+ <item> BalloonTextItem </item>
+ <item> BarLine </item>
+ <item> BarNumber </item>
+ <item> BassFigure </item>
+ <item> BassFigureAlignment </item>
+ <item> BassFigureAlignmentPositioning </item>
+ <item> BassFigureBracket </item>
+ <item> BassFigureContinuation </item>
+ <item> BassFigureLine </item>
+ <item> Beam </item>
+ <item> BendAfter </item>
+ <item> BreakAlignGroup </item>
+ <item> BreakAlignment </item>
+ <item> BreathingSign </item>
+ <item> ChordName </item>
+ <item> Clef </item>
+ <item> ClusterSpanner </item>
+ <item> ClusterSpannerBeacon </item>
+ <item> CombineTextScript </item>
+ <item> Custos </item>
+ <item> DotColumn </item>
+ <item> Dots </item>
+ <item> DoublePercentRepeat </item>
+ <item> DoublePercentRepeatCounter </item>
+ <item> DynamicLineSpanner </item>
+ <item> DynamicText </item>
+ <item> DynamicTextSpanner </item>
+ <item> Fingering </item>
+ <item> FretBoard </item>
+ <item> Glissando </item>
+ <item> GraceSpacing </item>
+ <item> GridLine </item>
+ <item> GridPoint </item>
+ <item> Hairpin </item>
+ <item> HarmonicParenthesesItem </item>
+ <item> HorizontalBracket </item>
+ <item> InstrumentName </item>
+ <item> InstrumentSwitch </item>
+ <item> KeyCancellation </item>
+ <item> KeySignature </item>
+ <item> LaissezVibrerTie </item>
+ <item> LaissezVibrerTieColumn </item>
+ <item> LedgerLineSpanner </item>
+ <item> LeftEdge </item>
+ <item> LigatureBracket </item>
+ <item> LyricExtender </item>
+ <item> LyricHyphen </item>
+ <item> LyricSpace </item>
+ <item> LyricText </item>
+ <item> MeasureGrouping </item>
+ <item> MelodyItem </item>
+ <item> MensuralLigature </item>
+ <item> MetronomeMark </item>
+ <item> MultiMeasureRest </item>
+ <item> MultiMeasureRestNumber </item>
+ <item> MultiMeasureRestText </item>
+ <item> NonMusicalPaperColumn </item>
+ <item> NoteCollision </item>
+ <item> NoteColumn </item>
+ <item> NoteHead </item>
+ <item> NoteName </item>
+ <item> NoteSpacing </item>
+ <item> OctavateEight </item>
+ <item> OttavaBracket </item>
+ <item> PaperColumn </item>
+ <item> ParenthesesItem </item>
+ <item> PercentRepeat </item>
+ <item> PercentRepeatCounter </item>
+ <item> PhrasingSlur </item>
+ <item> PianoPedalBracket </item>
+ <item> RehearsalMark </item>
+ <item> RepeatSlash </item>
+ <item> RepeatTie </item>
+ <item> RepeatTieColumn </item>
+ <item> Rest </item>
+ <item> RestCollision </item>
+ <item> Script </item>
+ <item> ScriptColumn </item>
+ <item> ScriptRow </item>
+ <item> SeparationItem </item>
+ <item> Slur </item>
+ <item> SostenutoPedal </item>
+ <item> SostenutoPedalLineSpanner </item>
+ <item> SpacingSpanner </item>
+ <item> SpanBar </item>
+ <item> StaffSpacing </item>
+ <item> StaffSymbol </item>
+ <item> StanzaNumber </item>
+ <item> Stem </item>
+ <item> StemTremolo </item>
+ <item> StringNumber </item>
+ <item> StrokeFinger </item>
+ <item> SustainPedal </item>
+ <item> SustainPedalLineSpanner </item>
+ <item> System </item>
+ <item> SystemStartBar </item>
+ <item> SystemStartBrace </item>
+ <item> SystemStartBracket </item>
+ <item> SystemStartSquare </item>
+ <item> TabNoteHead </item>
+ <item> TextScript </item>
+ <item> TextSpanner </item>
+ <item> Tie </item>
+ <item> TieColumn </item>
+ <item> TimeSignature </item>
+ <item> TrillPitchAccidental </item>
+ <item> TrillPitchGroup </item>
+ <item> TrillPitchHead </item>
+ <item> TrillSpanner </item>
+ <item> TupletBracket </item>
+ <item> TupletNumber </item>
+ <item> UnaCordaPedal </item>
+ <item> UnaCordaPedalLineSpanner </item>
+ <item> VaticanaLigature </item>
+ <item> VerticalAlignment </item>
+ <item> VerticalAxisGroup </item>
+ <item> VoiceFollower </item>
+ <item> VoltaBracket </item>
+ <item> VoltaBracketSpanner </item>
</list>
<list name="properties">
<item> aDueText </item>
@@ -265,6 +274,7 @@
<item> decrescendoText </item>
<item> defaultBarType </item>
<item> doubleSlurs </item>
+ <item> doubleRepeatType </item>
<item> drumPitchTable </item>
<item> drumStyleTable </item>
<item> dynamicAbsoluteVolumeFunction </item>
@@ -389,94 +399,94 @@
<item> vocNam </item>
</list>
<list name="musicexpressions">
- <item> AbsoluteDynamicEvent </item>
- <item> AnnotateOutputEvent </item>
- <item> ApplyContext </item>
- <item> ApplyOutputEvent </item>
- <item> ArpeggioEvent </item>
- <item> ArticulationEvent </item>
- <item> AutoChangeMusic </item>
- <item> BarCheck </item>
- <item> BassFigureEvent </item>
- <item> BeamEvent </item>
- <item> BeamForbidEvent </item>
- <item> BendAfterEvent </item>
- <item> BreathingEvent </item>
- <item> ClusterNoteEvent </item>
- <item> ContextChange </item>
- <item> ContextSpeccedMusic </item>
- <item> CrescendoEvent </item>
- <item> DecrescendoEvent </item>
- <item> Event </item>
- <item> EventChord </item>
- <item> ExtenderEvent </item>
- <item> FingeringEvent </item>
- <item> GlissandoEvent </item>
- <item> GraceMusic </item>
- <item> HarmonicEvent </item>
- <item> HyphenEvent </item>
- <item> KeyChangeEvent </item>
- <item> LabelEvent </item>
- <item> LaissezVibrerEvent </item>
- <item> LigatureEvent </item>
- <item> LineBreakEvent </item>
- <item> LyricCombineMusic </item>
- <item> LyricEvent </item>
- <item> MarkEvent </item>
- <item> MultiMeasureRestEvent </item>
- <item> MultiMeasureRestMusic </item>
- <item> MultiMeasureTextEvent </item>
- <item> Music </item>
- <item> NoteEvent </item>
- <item> NoteGroupingEvent </item>
- <item> OverrideProperty </item>
- <item> PageBreakEvent </item>
- <item> PageTurnEvent </item>
- <item> PartCombineMusic </item>
- <item> PercentEvent </item>
- <item> PercentRepeatedMusic </item>
- <item> PesOrFlexaEvent </item>
- <item> PhrasingSlurEvent </item>
- <item> PropertySet </item>
- <item> PropertyUnset </item>
- <item> QuoteMusic </item>
- <item> RelativeOctaveCheck </item>
- <item> RelativeOctaveMusic </item>
- <item> RepeatTieEvent </item>
- <item> RepeatedMusic </item>
- <item> RestEvent </item>
- <item> RevertProperty </item>
- <item> ScriptEvent </item>
- <item> SequentialMusic </item>
- <item> SimultaneousMusic </item>
- <item> SkipEvent </item>
- <item> SkipMusic </item>
- <item> SlurEvent </item>
- <item> SoloOneEvent </item>
- <item> SoloTwoEvent </item>
- <item> SostenutoEvent </item>
- <item> SpacingSectionEvent </item>
- <item> SpanEvent </item>
- <item> StaffSpanEvent </item>
- <item> StringNumberEvent </item>
- <item> StrokeFingerEvent </item>
- <item> SustainEvent </item>
- <item> TextScriptEvent </item>
- <item> TextSpanEvent </item>
- <item> TieEvent </item>
- <item> TimeScaledMusic </item>
- <item> TransposedMusic </item>
- <item> TremoloEvent </item>
- <item> TremoloRepeatedMusic </item>
- <item> TremoloSpanEvent </item>
- <item> TrillSpanEvent </item>
- <item> TupletSpanEvent </item>
- <item> UnaCordaEvent </item>
- <item> UnfoldedRepeatedMusic </item>
- <item> UnisonoEvent </item>
- <item> UnrelativableMusic </item>
- <item> VoiceSeparator </item>
- <item> VoltaRepeatedMusic </item>
+ <item> AbsoluteDynamicEvent </item>
+ <item> AnnotateOutputEvent </item>
+ <item> ApplyContext </item>
+ <item> ApplyOutputEvent </item>
+ <item> ArpeggioEvent </item>
+ <item> ArticulationEvent </item>
+ <item> AutoChangeMusic </item>
+ <item> BarCheck </item>
+ <item> BassFigureEvent </item>
+ <item> BeamEvent </item>
+ <item> BeamForbidEvent </item>
+ <item> BendAfterEvent </item>
+ <item> BreathingEvent </item>
+ <item> ClusterNoteEvent </item>
+ <item> ContextChange </item>
+ <item> ContextSpeccedMusic </item>
+ <item> CrescendoEvent </item>
+ <item> DecrescendoEvent </item>
+ <item> Event </item>
+ <item> EventChord </item>
+ <item> ExtenderEvent </item>
+ <item> FingeringEvent </item>
+ <item> GlissandoEvent </item>
+ <item> GraceMusic </item>
+ <item> HarmonicEvent </item>
+ <item> HyphenEvent </item>
+ <item> KeyChangeEvent </item>
+ <item> LabelEvent </item>
+ <item> LaissezVibrerEvent </item>
+ <item> LigatureEvent </item>
+ <item> LineBreakEvent </item>
+ <item> LyricCombineMusic </item>
+ <item> LyricEvent </item>
+ <item> MarkEvent </item>
+ <item> MultiMeasureRestEvent </item>
+ <item> MultiMeasureRestMusic </item>
+ <item> MultiMeasureTextEvent </item>
+ <item> Music </item>
+ <item> NoteEvent </item>
+ <item> NoteGroupingEvent </item>
+ <item> OverrideProperty </item>
+ <item> PageBreakEvent </item>
+ <item> PageTurnEvent </item>
+ <item> PartCombineMusic </item>
+ <item> PercentEvent </item>
+ <item> PercentRepeatedMusic </item>
+ <item> PesOrFlexaEvent </item>
+ <item> PhrasingSlurEvent </item>
+ <item> PropertySet </item>
+ <item> PropertyUnset </item>
+ <item> QuoteMusic </item>
+ <item> RelativeOctaveCheck </item>
+ <item> RelativeOctaveMusic </item>
+ <item> RepeatTieEvent </item>
+ <item> RepeatedMusic </item>
+ <item> RestEvent </item>
+ <item> RevertProperty </item>
+ <item> ScriptEvent </item>
+ <item> SequentialMusic </item>
+ <item> SimultaneousMusic </item>
+ <item> SkipEvent </item>
+ <item> SkipMusic </item>
+ <item> SlurEvent </item>
+ <item> SoloOneEvent </item>
+ <item> SoloTwoEvent </item>
+ <item> SostenutoEvent </item>
+ <item> SpacingSectionEvent </item>
+ <item> SpanEvent </item>
+ <item> StaffSpanEvent </item>
+ <item> StringNumberEvent </item>
+ <item> StrokeFingerEvent </item>
+ <item> SustainEvent </item>
+ <item> TextScriptEvent </item>
+ <item> TextSpanEvent </item>
+ <item> TieEvent </item>
+ <item> TimeScaledMusic </item>
+ <item> TransposedMusic </item>
+ <item> TremoloEvent </item>
+ <item> TremoloRepeatedMusic </item>
+ <item> TremoloSpanEvent </item>
+ <item> TrillSpanEvent </item>
+ <item> TupletSpanEvent </item>
+ <item> UnaCordaEvent </item>
+ <item> UnfoldedRepeatedMusic </item>
+ <item> UnisonoEvent </item>
+ <item> UnrelativableMusic </item>
+ <item> VoiceSeparator </item>
+ <item> VoltaRepeatedMusic </item>
</list>
<list name="drumpitchnames">
<item> acousticbassdrum </item>
@@ -634,7 +644,7 @@
<IncludeRules context="music"/>
<RegExpr String="\b[a-z]+\s*=" insensitive="true" lookAhead="true" context="assignment"/>
</context>
-
+
<!-- Music expressions -->
<context name="music" attribute="Normal Text" lineEndContext="#stay">
<AnyChar String="()~" attribute="Slur"/>
@@ -648,7 +658,7 @@
<RegExpr String="(&rest;|&pitch;)" context="pitch"/>
<RegExpr String=":\d*" attribute="Tremolo"/>
</context>
-
+
<!-- Default Lilypond code to be recognized e.g. also inside lyrics -->
<context name="default" attribute="Normal Text" lineEndContext="#stay">
<Detect2Chars char="<" char1="<" attribute="Keyword" beginRegion="simultaneous"/>
@@ -659,7 +669,7 @@
<DetectChar char="\" context="command" lookAhead="true"/>
<IncludeRules context="basic"/>
</context>
-
+
<!-- Basic Lilypond syntax that also works inside markup -->
<context name="basic" attribute="Normal Text" lineEndContext="#stay">
<Detect2Chars char="%" char1="{" context="commentblock" beginRegion="comment"/>
@@ -668,7 +678,7 @@
<DetectChar char="#" context="scheme"/>
<DetectChar char="$" context="schemesub"/>
</context>
-
+
<context name="musiccommand" attribute="Normal Text" lineEndContext="#pop"
fallthrough="true" fallthroughContext="#pop">
<RegExpr String="\\(&dynamics;)&b;" attribute="Dynamic"/>
@@ -694,6 +704,7 @@
<RegExpr String="\\(un)?set\b" attribute="Keyword" context="set"/>
<RegExpr String="\\(override(Property)?|revert)&b;" attribute="Keyword" context="override"/>
<RegExpr String="\\skip&b;" attribute="Command" context="duration"/>
+ <RegExpr String="\\tempo&b;" attribute="Command" context="tempo"/>
<RegExpr String="\\(&keywords;)&b;" attribute="Keyword"/>
<RegExpr String="\\(&commands;)&b;" attribute="Command"/>
<RegExpr String="\\(&toplevelvars;)&b;" attribute="Variable"/>
@@ -704,32 +715,33 @@
<RegExpr String="\\[A-Za-z]+" attribute="User Command"/>
<DetectChar char="\" attribute="Invalid"/>
</context>
-
+
<context name="assignment" attribute="Normal Text" lineEndContext="#pop">
<RegExpr String="\b(&toplevelvars;)\b" attribute="Variable" context="#pop"/>
<RegExpr String="[a-z]+" insensitive="true" attribute="User Command" context="#pop"/>
</context>
-
+
<context name="pitch" attribute="Pitch" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop">
<RegExpr String="=\s*('+|,+)?" attribute="Check"/>
+ <AnyChar String="!?"/>
<IncludeRules context="duration"/>
</context>
-
+
<context name="duration" attribute="Normal Text" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop">
<DetectSpaces attribute="Normal Text"/>
<RegExpr String="&duration;" attribute="Duration" context="#pop"/>
<RegExpr String="\d+" attribute="Invalid" context="#pop"/><!-- uncaught (wrong) durations -->
</context>
-
+
<context name="chord" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char=">" context="chordend"/>
<RegExpr String="&pitch;" context="chordpitch"/>
<AnyChar String="<{}srR" attribute="Invalid"/><!-- no rests in chord allowed -->
<IncludeRules context="music"/>
</context>
-
+
<context name="chordpitch" attribute="Pitch" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop">
<DetectSpaces attribute="Normal Text"/>
@@ -737,50 +749,50 @@
<RegExpr String="&duration;" attribute="Invalid" context="#pop"/><!-- no duration in chord allowed -->
<RegExpr String="\d+" attribute="Invalid" context="#pop"/><!-- catch other (wrong) durations as well -->
</context>
-
+
<context name="chordend" attribute="Chord" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop#pop">
<DetectSpaces attribute="Normal Text"/>
<RegExpr String="&duration;" attribute="Duration" context="#pop#pop"/>
</context>
-
+
<context name="commentline" attribute="Comment" lineEndContext="#pop">
<IncludeRules context="##Alerts"/>
</context>
-
+
<context name="commentblock" attribute="Comment" lineEndContext="#stay">
<Detect2Chars char="%" char1="}" attribute="Comment" context="#pop" endRegion="comment"/>
<IncludeRules context="##Alerts"/>
</context>
-
+
<context name="string" attribute="Quoted Text" lineEndContext="#stay">
<DetectChar char=""" attribute="Quoted Text" context="#pop"/>
<Detect2Chars char="\" char1="\"/>
<Detect2Chars char="\" char1="""/>
</context>
-
+
<context name="connect" attribute="Articulation" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop">
<AnyChar String=".-+|>^_12345" attribute="Articulation" context="#pop"/>
</context>
-
+
<!-- Scheme -->
<context name="scheme" attribute="Scheme" lineEndContext="#stay"
fallthrough="true" fallthroughContext="scheme2">
<DetectSpaces/>
</context>
-
+
<context name="scheme2" attribute="Scheme" lineEndContext="#pop#pop">
<DetectChar char="(" attribute="Scheme Keyword" context="scheme3" beginRegion="scheme"/>
<IncludeRules context="schemerules"/>
<DetectSpaces lookAhead="true" context="#pop#pop"/>
</context>
-
+
<context name="scheme3" attribute="Scheme" lineEndContext="#stay">
<DetectChar char=")" attribute="Scheme Keyword" context="#pop#pop#pop" endRegion="scheme"/>
<IncludeRules context="schemerules"/>
</context>
-
+
<context name="schemerules" attribute="Scheme" lineEndContext="#stay">
<DetectChar char="(" context="schemerules" beginRegion="scheme"/>
<DetectChar char=")" context="#pop" endRegion="scheme"/>
@@ -800,85 +812,85 @@
<RegExpr String="&schemefunc;" attribute="Scheme Keyword"/>
<RegExpr String="&schemename;"/>
</context>
-
+
<context name="schemequote" attribute="Scheme" lineEndContext="#pop"
fallthrough="true" fallthroughContext="#pop">
<RegExpr String="&schemefunc;"/>
</context>
-
+
<context name="schemelily" attribute="Normal Text" lineEndContext="#stay">
<Detect2Chars char="#" char1="}" attribute="Scheme Keyword" context="#pop" endRegion="schemelily"/>
<IncludeRules context="lilypond"/>
</context>
-
+
<context name="schemecommentline" attribute="Scheme Comment" lineEndContext="#pop">
<IncludeRules context="##Alerts"/>
</context>
-
+
<context name="schemecommentblock" attribute="Scheme Comment" lineEndContext="#stay">
<Detect2Chars char="!" char1="#" attribute="Scheme Comment" context="#pop" endRegion="schemecomment"/>
<IncludeRules context="##Alerts"/>
</context>
-
+
<context name="schemesub" attribute="Scheme Subst" lineEndContext="#pop"
fallthrough="true" fallthroughContext="#pop">
<RegExpr String="&schemename;" attribute="Scheme Subst" context="#pop"/>
</context>
-
+
<context name="schemestring" attribute="Scheme String" lineEndContext="#stay">
<DetectChar char=""" attribute="Scheme String" context="#pop"/>
<RegExpr String="\\[0fnrtav\\"]"/>
</context>
-
+
<!-- NoteMode -->
<context name="notemode" attribute="Other Mode" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop">
<DetectChar char="{" attribute="Keyword" context="notemode2" beginRegion="sequential"/>
<DetectSpaces/>
</context>
-
+
<context name="notemode2" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="sequential"/>
<IncludeRules context="noterules"/>
</context>
-
+
<context name="noterules" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char="{" attribute="Keyword" context="noterules" beginRegion="sequential"/>
<DetectChar char="}" attribute="Keyword" context="#pop" endRegion="sequential"/>
<IncludeRules context="music"/>
</context>
-
+
<!-- Drummode -->
<context name="drummode" attribute="Other Mode" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop">
<DetectChar char="{" attribute="Keyword" context="drummode2" beginRegion="sequential"/>
<DetectSpaces/>
</context>
-
+
<context name="drummode2" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="sequential"/>
<IncludeRules context="drumrules"/>
</context>
-
+
<context name="drumrules" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char="{" attribute="Keyword" context="drumrules" beginRegion="sequential"/>
<DetectChar char="}" attribute="Keyword" context="#pop" endRegion="sequential"/>
<keyword attribute="Other Text" String="drumpitchnames" context="duration"/>
<IncludeRules context="music"/>
</context>
-
+
<!-- Chordmode -->
<context name="chordmode" attribute="Other Mode" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop">
<DetectChar char="{" attribute="Keyword" context="chordmode2" beginRegion="sequential"/>
<DetectSpaces/>
</context>
-
+
<context name="chordmode2" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="sequential"/>
<IncludeRules context="chordrules"/>
</context>
-
+
<context name="chordrules" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char="{" attribute="Keyword" context="chordrules" beginRegion="sequential"/>
<DetectChar char="}" attribute="Keyword" context="#pop" endRegion="sequential"/>
@@ -892,12 +904,12 @@
<DetectChar char="{" attribute="Keyword" context="figuremode2" beginRegion="sequential"/>
<DetectSpaces/>
</context>
-
+
<context name="figuremode2" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="sequential"/>
<IncludeRules context="figurerules"/>
</context>
-
+
<context name="figurerules" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char="{" attribute="Keyword" context="figurerules" beginRegion="sequential"/>
<DetectChar char="}" attribute="Keyword" context="#pop" endRegion="sequential"/>
@@ -905,7 +917,7 @@
<RegExpr String="&rest;" attribute="Pitch" context="duration"/>
<IncludeRules context="default"/>
</context>
-
+
<context name="figure" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char=">" attribute="Chord" context="chordend"/>
<IncludeRules context="basic"/>
@@ -919,12 +931,12 @@
<DetectChar char="{" attribute="Keyword" context="lyricmode2" beginRegion="sequential"/>
<DetectSpaces/>
</context>
-
+
<context name="lyricmode2" attribute="Lyric Text" lineEndContext="#stay">
<DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="sequential"/>
<IncludeRules context="lyricrules"/>
</context>
-
+
<!-- LyricsTo has extra parameter -->
<context name="lyricsto" attribute="Lyricmode" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop">
@@ -932,7 +944,7 @@
<RegExpr String="[A-Za-z]+" attribute="Normal Text" context="lyricsto2"/>
<DetectSpaces/>
</context>
-
+
<context name="lyricsto2" attribute="Normal Text" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop#pop">
<DetectChar char="{" attribute="Keyword" context="lyricsto3" beginRegion="sequential"/>
@@ -943,7 +955,7 @@
<DetectChar char="}" attribute="Keyword" context="#pop#pop#pop" endRegion="sequential"/>
<IncludeRules context="lyricrules"/>
</context>
-
+
<context name="lyricrules" attribute="Lyric Text" lineEndContext="#stay">
<DetectChar char="{" attribute="Keyword" context="lyricrules" beginRegion="sequential"/>
<DetectChar char="}" attribute="Keyword" context="#pop" endRegion="sequential"/>
@@ -953,7 +965,7 @@
<IncludeRules context="default"/>
<RegExpr String="\S+\}" attribute="Invalid" context="#pop" endRegion="sequential"/>
</context>
-
+
<!-- Markup -->
<context name="markup" attribute="Normal Text" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop">
@@ -965,12 +977,12 @@
<DetectChar char="#" context="scheme"/>
<RegExpr String="[^"\s\\#%{}$]+" attribute="Normal Text" context="#pop"/>
</context>
-
+
<context name="markup2" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="markup"/>
<IncludeRules context="markuprules"/>
</context>
-
+
<context name="markuprules" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char="}" attribute="Keyword" context="#pop" endRegion="markup"/>
<DetectChar char="{" attribute="Keyword" context="markuprules" beginRegion="markup"/>
@@ -980,31 +992,31 @@
<RegExpr String="\\[A-Za-z]+(-[A-Za-z]+)*" attribute="User Command"/>
<IncludeRules context="basic"/>
</context>
-
+
<!-- \paper, \layout, \midi, \header, \with -->
<context name="section" attribute="Keyword" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop">
<DetectChar char="{" attribute="Keyword" context="section2" beginRegion="section"/>
<DetectSpaces/>
</context>
-
+
<context name="section2" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="section"/>
<IncludeRules context="sectionrules"/>
</context>
-
+
<context name="sectionrules" attribute="Normal Text" lineEndContext="#stay">
<DetectChar char="}" attribute="Keyword" context="#pop" endRegion="section"/>
<DetectChar char="{" attribute="Keyword" context="sectionrules" beginRegion="section"/>
<keyword String="contexts" attribute="Context"/>
<keyword String="layoutobjects" attribute="Layout Object"/>
<keyword String="properties" attribute="Property"/>
- <keyword String="deprecatedproperties" attribute="Deprecated Property"/>
<RegExpr String="\b(&headervars;|&papervars;|&layoutvars;)\b" attribute="Variable"/>
+ <keyword String="deprecatedproperties" attribute="Deprecated Property"/>
<RegExpr String="("?)\b(&engravers;)\b\1" attribute="Engraver"/>
<IncludeRules context="default"/>
</context>
-
+
<!-- \new, \context, \change -->
<context name="context" attribute="Normal Text" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop">
@@ -1013,13 +1025,13 @@
<RegExpr String="[A-Za-z]+" attribute="User Command" context="context2"/>
<DetectChar char="{" attribute="Keyword" context="section2" beginRegion="section"/>
</context>
-
+
<context name="context2" attribute="Normal Text" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop#pop">
<DetectSpaces/>
<RegExpr String="=(\s*[A-Za-z]+)?" attribute="Normal Text" context="#pop#pop"/>
</context>
-
+
<!-- \set, \unset -->
<context name="set" attribute="Normal Text" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop">
@@ -1030,7 +1042,7 @@
<keyword String="deprecatedproperties" attribute="Deprecated Property" context="#pop"/>
<RegExpr String="[A-Za-z]+" attribute="User Command" context="#pop"/>
</context>
-
+
<!-- \override, \overrideProperty, \revert -->
<context name="override" attribute="Normal Text" lineEndContext="#stay"
fallthrough="true" fallthroughContext="#pop">
@@ -1041,6 +1053,17 @@
<RegExpr String="[A-Za-z]+(?=\s*\.)" attribute="User Command"/>
<RegExpr String="[A-Za-z]+" attribute="User Command" context="#pop"/>
</context>
+
+ <!-- special cases for individual commands -->
+ <!-- \tempo -->
+ <context name="tempo" attribute="Normal Text" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\\markup(lines)?&b;" attribute="Markup" context="markup"/>
+ <RegExpr String="\d+\.*\s*=\s*\d+" attribute="Command" context="#pop"/>
+ <DetectSpaces/>
+ <IncludeRules context="basic"/>
+ </context>
+
</contexts>
<itemDatas>
<itemData name="Pitch" defStyleNum="dsNormal"/>
@@ -1088,8 +1111,7 @@
</comments>
<keywords casesensitive="true" additionalDeliminator="'_0123456789"/>
</general>
-
</language>
<!--
- // kate: space-indent on; indent-width 2; replace-tabs on; dynamic-word-wrap off;
- -->
+ kate: space-indent on; indent-width 2; replace-tabs on;
+-->
--- kjs/lexer.cpp
+++ kjs/lexer.cpp
@@ -475,7 +475,7 @@
if (!done)
shift(1);
#ifndef KJS_PURE_ECMA
- if (state != Start && state != InSingleLineComment)
+ if (state != Start && state != InMultiLineComment)
bol = false;
#endif
}
--- kfile/kdirselectdialog.cpp
+++ kfile/kdirselectdialog.cpp
@@ -190,7 +190,9 @@
void KDirSelectDialog::Private::_k_slotComboTextChanged( const QString& text )
{
+ m_treeView->blockSignals(true);
m_treeView->setCurrentUrl( KUrl( text ) );
+ m_treeView->blockSignals(false);
}
void KDirSelectDialog::Private::_k_slotContextMenu( const QPoint& pos )
--- kded/kded.cpp
+++ kded/kded.cpp
@@ -169,6 +169,10 @@
if (obj == "ksycoca")
return; // Ignore this one.
+ // This happens when kded goes down and some modules try to clean up.
+ if (!self())
+ return;
+
if (self()->m_dontLoad.value(obj, 0))
return;
--- solid/solid/backends/hal/halaudiointerface.cpp
+++ solid/solid/backends/hal/halaudiointerface.cpp
@@ -166,7 +166,8 @@
if (!parentUdi.isEmpty()) {
QDBusInterface parentIface(QLatin1String("org.freedesktop.Hal"), m_device->parentUdi(), "org.freedesktop.Hal.Device", QDBusConnection::systemBus());
const QDBusMessage &reply = parentIface.call("GetProperty", QLatin1String("info.subsystem"));
- if (reply.type() != QDBusMessage::ReplyMessage && reply.errorName() == "org.freedesktop.Hal.NoSuchProperty") {
+ if ((reply.type() != QDBusMessage::ReplyMessage && reply.errorName() == "org.freedesktop.Hal.NoSuchProperty") ||
+ (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().at(0) == "sound")) {
const QDBusMessage &reply2 = parentIface.call("GetProperty", QLatin1String("info.parent"));
if (reply2.type() == QDBusMessage::ReplyMessage) {
parentUdi = reply2.arguments().at(0).toString();
--- solid/solid/backends/hal/halstorageaccess.cpp
+++ solid/solid/backends/hal/halstorageaccess.cpp
@@ -233,9 +233,27 @@
QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.Hal", udi,
"org.freedesktop.Hal.Device.Volume",
"Mount");
- QStringList options;
+
+ // HAL 0.5.12 supports using alternative drivers for the same filesystem.
+ // This is mainly used to integrate the ntfs-3g driver.
+ // Unfortunately, the primary driver gets used unless we
+ // specify some other driver (fstype) to the Mount method.
+ // TODO: Allow the user to choose the driver.
+
+ QString fstype = m_device->property("volume.fstype").toString();
QStringList halOptions = m_device->property("volume.mount.valid_options").toStringList();
+ QString alternativePreferred = m_device->property("volume.fstype.alternative.preferred").toString();
+ if (!alternativePreferred.isEmpty()) {
+ QStringList alternativeFstypes = m_device->property("volume.fstype.alternative").toStringList();
+ if (alternativeFstypes.contains(alternativePreferred)) {
+ fstype = alternativePreferred;
+ halOptions = m_device->property("volume.mount."+fstype+".valid_options").toStringList();
+ }
+ }
+
+ QStringList options;
+
#ifdef Q_OS_FREEBSD
QString uid="-u=";
#else
@@ -245,7 +263,6 @@
options << uid+QString::number(::getuid());
}
- QString fstype=m_device->property("volume.fstype").toString();
#ifdef Q_OS_FREEBSD
char *cType;
if ( fstype=="vfat" && halOptions.contains("-L=")) {
@@ -275,7 +292,7 @@
#endif
- msg << "" << "" << options;
+ msg << "" << fstype << options;
return c.callWithCallback(msg, this,
SLOT(slotDBusReply(const QDBusMessage &)),
--- kioslave/http/kcookiejar/kcookiejar.cpp
+++ kioslave/http/kcookiejar/kcookiejar.cpp
@@ -1182,11 +1182,8 @@
void KCookieJar::eatAllCookies()
{
- for ( QStringList::Iterator it=m_domainList.begin();
- it != m_domainList.end();)
- {
- QString domain = *it++;
- // This might remove domain from domainList!
+ Q_FOREACH(const QString& domain, m_domainList) {
+ // This might remove domain from m_domainList!
eatCookiesForDomain(domain);
}
}
--- kioslave/http/http.cpp
+++ kioslave/http/http.cpp
@@ -4479,6 +4479,9 @@
if ( !checkRequestUrl( url ) )
return;
+ // Make sure we read in the cache info.
+ resetSessionSettings();
+
m_request.path = url.path();
m_request.query = url.query();
m_request.cache = CC_Reload;
--- kioslave/http/http_cache_cleaner.cpp
+++ kioslave/http/http_cache_cleaner.cpp
@@ -50,7 +50,7 @@
static const char appFullName[] = "org.kde.kio_http_cache_cleaner";
static const char appName[] = "kio_http_cache_cleaner";
-static const char version[] = "1.0.0";
+static const char version[] = "9";
struct FileInfo {
QString name;
@@ -73,8 +73,8 @@
};
// !START OF SYNC!
-// Keep the following in sync with the cache code in http.cc
-#define CACHE_REVISION "7\n"
+// Keep the following in sync with the cache code in http.cpp
+#define CACHE_REVISION "9\n"
FileInfo *readEntry( const QString &filename)
{
--- kio/kio/slavebase.cpp
+++ kio/kio/slavebase.cpp
@@ -876,7 +876,7 @@
const QString &dontAskAgainName )
{
kDebug(7019) << "messageBox " << type << " " << text << " - " << caption << buttonYes << buttonNo;
- KIO_DATA << (qint32)type << text << caption << buttonYes << buttonNo;
+ KIO_DATA << (qint32)type << text << caption << buttonYes << buttonNo << dontAskAgainName;
send( INF_MESSAGEBOX, data );
if ( waitForAnswer( CMD_MESSAGEBOXANSWER, 0, data ) != -1 )
{
--- kio/kio/kfileitem.cpp
+++ kio/kio/kfileitem.cpp
@@ -903,7 +903,7 @@
{
if ( d->m_fileMode == KFileItem::Unknown )
{
- kDebug() << "can't say -> false";
+ kDebug(7101) << "can't say -> false";
return false; // can't say for sure, so no
}
return (S_ISDIR(d->m_fileMode));
--- kio/kio/kdirmodel.cpp
+++ kio/kio/kdirmodel.cpp
@@ -166,6 +166,7 @@
{
KUrl url(_url);
url.adjustPath(KUrl::RemoveTrailingSlash); // KDirLister does this too, so we remove the slash before comparing with the root node url.
+ url.cleanPath(); // remove double slashes in the path
url.setQuery(QString());
url.setRef(QString());
@@ -203,7 +204,7 @@
// E.g. pathStr is /a/b/c and nodePath is /a. We want to find the child "b" in dirNode.
const QString relativePath = pathStr.mid(nodePath.length());
- Q_ASSERT(!relativePath.startsWith('/')); // huh? we need double-slash simplification?
+ Q_ASSERT(!relativePath.startsWith('/')); // check if multiple slashes have been removed
const int nextSlash = relativePath.indexOf('/');
const QString fileName = relativePath.left(nextSlash); // works even if nextSlash==-1
KDirModelNode* node = dirNode->m_childNodesByName.value(fileName);
--- kio/kfile/kopenwithdialog.cpp
+++ kio/kfile/kopenwithdialog.cpp
@@ -443,9 +443,19 @@
*/
void init(const QString &text, const QString &value);
+ /**
+ * Called by checkAccept() in order to save the history of the combobox
+ */
+ void saveComboboxHistory();
+
+ /**
+ * Process the choices made by the user, and return true if everything is OK.
+ * Called by KOpenWithDialog::accept(), i.e. when clicking on OK or typing Return.
+ */
+ bool checkAccept();
+
// slots
void _k_slotDbClick();
- void _k_slotOK();
bool saveNewApps;
bool m_terminaldirty;
@@ -606,8 +616,6 @@
edit->comboBox()->setAutoDeleteCompletionObject( true );
}
- QObject::connect(edit, SIGNAL(returnPressed()), q, SLOT(_k_slotOK()));
- QObject::connect(q, SIGNAL(okClicked()), q, SLOT(_k_slotOK()));
QObject::connect(edit, SIGNAL(textChanged(QString)), q, SLOT(slotTextChanged()));
view = new KApplicationView(mainWidget);
@@ -730,7 +738,7 @@
if (view->isDirSel()) {
return;
}
- _k_slotOK();
+ q->accept();
}
void KOpenWithDialog::setSaveNewApplications(bool b)
@@ -774,11 +782,11 @@
Q_ASSERT( m_pService );
}
-void KOpenWithDialogPrivate::_k_slotOK()
+bool KOpenWithDialogPrivate::checkAccept()
{
QString typedExec(edit->url().pathOrUrl());
if (typedExec.isEmpty())
- return;
+ return false;
QString fullExec(typedExec);
QString serviceName;
@@ -792,7 +800,7 @@
serviceName = KRun::binaryName( typedExec, true );
if (serviceName.isEmpty()) {
KMessageBox::error(q, i18n("Could not extract executable name from '%1', please type a valid program name.", serviceName));
- return;
+ return false;
}
initialServiceName = serviceName;
kDebug(250) << "initialServiceName=" << initialServiceName;
@@ -826,6 +834,12 @@
serviceName = m_pService->name();
initialServiceName = serviceName;
fullExec = m_pService->exec();
+ } else {
+ // Ensure that the typed binary name actually exists (#81190)
+ if (KStandardDirs::findExe(serviceName).isEmpty()) {
+ KMessageBox::error(q, i18n("'%1' not found, please type a valid program name.", serviceName));
+ return false;
+ }
}
if (terminal->isChecked()) {
@@ -887,7 +901,15 @@
addToMimeAppsList(menuId);
}
}
- q->accept();
+
+ saveComboboxHistory();
+ return true;
+}
+
+void KOpenWithDialog::accept()
+{
+ if (d->checkAccept())
+ KDialog::accept();
}
QString KOpenWithDialog::text() const
@@ -916,11 +938,11 @@
return d->m_pService;
}
-void KOpenWithDialog::accept()
+void KOpenWithDialogPrivate::saveComboboxHistory()
{
- KHistoryComboBox *combo = static_cast<KHistoryComboBox*>(d->edit->comboBox());
- if ( combo ) {
- combo->addToHistory(d->edit->url().url());
+ KHistoryComboBox *combo = static_cast<KHistoryComboBox*>(edit->comboBox());
+ if (combo) {
+ combo->addToHistory(edit->url().url());
KConfigGroup cg( KGlobal::config(), QString::fromLatin1("Open-with settings") );
cg.writeEntry( "History", combo->historyItems() );
@@ -929,8 +951,6 @@
// executables
cg.sync();
}
-
- QDialog::accept();
}
#include "kopenwithdialog.moc"
--- kio/kfile/kacleditwidget.cpp
+++ kio/kfile/kacleditwidget.cpp
@@ -638,6 +638,7 @@
setSortingEnabled( false );
setSelectionMode( QAbstractItemView::ExtendedSelection );
header()->setResizeMode( QHeaderView::ResizeToContents );
+ setRootIsDecorated( false );
// Load the avatars
for ( int i=0; i < LAST_IDX; ++i ) {
--- kio/kfile/kopenwithdialog.h
+++ kio/kfile/kopenwithdialog.h
@@ -31,7 +31,7 @@
/**
* "Open With" dialog box.
*
- * @note To let the user choose an application and run it immediately,
+ * @note To let the user choose an application and run it immediately,
* use simpler KRun::displayOpenWithDialog().
*
* @author David Faure <faure@kde.org>
@@ -123,7 +123,7 @@
protected Q_SLOTS:
/**
- * Reimplemented from QDialog::accept() to save history of the combobox
+ * Reimplemented from QDialog::accept()
*/
virtual void accept();
@@ -134,7 +134,6 @@
Q_DISABLE_COPY(KOpenWithDialog)
Q_PRIVATE_SLOT(d, void _k_slotDbClick())
- Q_PRIVATE_SLOT(d, void _k_slotOK())
};
#endif
--- kio/misc/rlogin.protocol
+++ kio/misc/rlogin.protocol
@@ -10,4 +10,4 @@
makedir=false
deleting=false
X-DocPath=kioslave/rlogin.html
-Icon=konsole
+Icon=utilities-terminal
--- kio/misc/telnet.protocol
+++ kio/misc/telnet.protocol
@@ -10,4 +10,4 @@
makedir=false
deleting=false
X-DocPath=kioslave/telnet.html
-Icon=konsole
+Icon=utilities-terminal
--- kio/misc/ssh.protocol
+++ kio/misc/ssh.protocol
@@ -9,5 +9,5 @@
writing=false
makedir=false
deleting=false
-Icon=konsole
+Icon=utilities-terminal
--- kio/tests/kdirmodeltest.cpp
+++ kio/tests/kdirmodeltest.cpp
@@ -563,6 +563,20 @@
fillModel(true);
}
+void KDirModelTest::testMultipleSlashes()
+{
+ const QString path = m_tempDir->name();
+
+ QModelIndex index = m_dirModel.indexForUrl(KUrl(path+"subdir//testfile"));
+ QVERIFY(index.isValid());
+
+ index = m_dirModel.indexForUrl(path+"subdir//subsubdir//");
+ QVERIFY(index.isValid());
+
+ index = m_dirModel.indexForUrl(path+"subdir///subsubdir////testfile");
+ QVERIFY(index.isValid());
+}
+
void KDirModelTest::testUrlWithRef() // #171117
{
const QString path = m_tempDir->name();
--- kio/tests/kdirmodeltest.h
+++ kio/tests/kdirmodeltest.h
@@ -45,6 +45,7 @@
void testExpandToUrl_data();
void testExpandToUrl();
void testFilter();
+ void testMultipleSlashes();
void testUrlWithRef();
void testUrlWithHost();
void testZipFile();
--- kdeui/dialogs/kshortcutsdialog_p.h
+++ kdeui/dialogs/kshortcutsdialog_p.h
@@ -188,6 +188,7 @@
void commit();
virtual QVariant data(int column, int role) const;
+ virtual bool operator<(const QTreeWidgetItem &other) const;
QKeySequence keySequence(uint column) const;
void setKeySequence(uint column, const QKeySequence &seq);
--- kdeui/dialogs/kshortcutseditoritem.cpp
+++ kdeui/dialogs/kshortcutseditoritem.cpp
@@ -27,6 +27,7 @@
#include <kaction.h>
#include <kdebug.h>
+#include <kstringhandler.h>
#include <QTreeWidgetItem>
@@ -161,6 +162,13 @@
}
+bool KShortcutsEditorItem::operator<(const QTreeWidgetItem &other) const
+{
+ const int column = treeWidget() ? treeWidget()->sortColumn() : 0;
+ return KStringHandler::naturalCompare(text(column), other.text(column)) < 0;
+}
+
+
QKeySequence KShortcutsEditorItem::keySequence(uint column) const
{
switch (column) {
--- kdeui/shortcuts/kdedglobalaccel_adaptor.h
+++ kdeui/shortcuts/kdedglobalaccel_adaptor.h
@@ -75,16 +75,16 @@
inline QList<int> setShortcut(const QStringList &actionId, const QList<int> &keys, uint flags)
{ return p()->setShortcut(actionId, keys, flags); }
//this is used if application A wants to change shortcuts of application B
- inline Q_NOREPLY void setForeignShortcut(const QStringList &actionId, const QList<int> &keys)
+ inline void setForeignShortcut(const QStringList &actionId, const QList<int> &keys)
{ return p()->setForeignShortcut(actionId, keys); }
//to be called when a KAction is destroyed or setGlobalShortcutAllowed(false) is called.
//The shortcut stays in our data structures for conflict resolution but won't trigger
//until woken up again by calling setShortcut().
- inline Q_NOREPLY void setInactive(const QStringList &actionId)
+ inline void setInactive(const QStringList &actionId)
{ return p()->setInactive(actionId); }
- inline Q_NOREPLY void doRegister(const QStringList &actionId)
+ inline void doRegister(const QStringList &actionId)
{ return p()->doRegister(actionId); }
- inline Q_NOREPLY void unRegister(const QStringList &actionId)
+ inline void unRegister(const QStringList &actionId)
{ return p()->unRegister(actionId); }
Q_SIGNALS:
--- kdeui/shortcuts/kdedglobalaccel_interface.h
+++ kdeui/shortcuts/kdedglobalaccel_interface.h
@@ -83,36 +83,36 @@
argumentList);
}
- Q_NOREPLY void setForeignShortcut(const QStringList &actionId,
+ void setForeignShortcut(const QStringList &actionId,
const QList<int> &keys)
{
QList<QVariant> argumentList;
argumentList << qVariantFromValue(actionId) << qVariantFromValue(keys);
- callWithArgumentList(QDBus::NoBlock, QLatin1String("setForeignShortcut"),
+ callWithArgumentList(QDBus::Block, QLatin1String("setForeignShortcut"),
argumentList);
}
- Q_NOREPLY void setInactive(const QStringList &actionId)
+ void setInactive(const QStringList &actionId)
{
QList<QVariant> argumentList;
argumentList << qVariantFromValue(actionId);
- callWithArgumentList(QDBus::NoBlock, QLatin1String("setInactive"),
+ callWithArgumentList(QDBus::Block, QLatin1String("setInactive"),
argumentList);
}
- Q_NOREPLY void doRegister(const QStringList &actionId)
+ void doRegister(const QStringList &actionId)
{
QList<QVariant> argumentList;
argumentList << qVariantFromValue(actionId);
- callWithArgumentList(QDBus::NoBlock, QLatin1String("doRegister"),
+ callWithArgumentList(QDBus::Block, QLatin1String("doRegister"),
argumentList);
}
- Q_NOREPLY void unRegister(const QStringList &actionId)
+ void unRegister(const QStringList &actionId)
{
QList<QVariant> argumentList;
argumentList << qVariantFromValue(actionId);
- callWithArgumentList(QDBus::NoBlock, QLatin1String("unRegister"),
+ callWithArgumentList(QDBus::Block, QLatin1String("unRegister"),
argumentList);
}
--- kdeui/shortcuts/kdedglobalaccel.cpp
+++ kdeui/shortcuts/kdedglobalaccel.cpp
@@ -513,6 +513,13 @@
actionData *ad = d->findAction(actionId);
if (!ad)
return;
+ static bool norecurse = false;
+ if (ad->uniqueName.startsWith("_k_session:") && !norecurse) { // don't keep these
+ norecurse = true;
+ unRegister(actionId);
+ norecurse = false;
+ return;
+ }
ad->isPresent = false;
const int len = ad->keys.count();
@@ -539,7 +546,7 @@
friendlyGroup.writeEntry("Friendly Name", cd->friendlyName);
foreach (const actionData *const ad, cd->actions) {
- if (ad->isFresh) {
+ if (ad->isFresh || ad->uniqueName.startsWith("_k_session:")) {
//no shortcut assignement took place, the action was only registered
//(we could still write it out to document its existence, but the "fresh"
//state should be regarded as transitional *only*.)
--- kdeui/tests/kwordwraptest.cpp
+++ kdeui/tests/kwordwraptest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003 David Faure <faure@kde.org>
+ * Copyright 2003, 2008 David Faure <faure@kde.org>
*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -17,30 +17,52 @@
* Boston, MA 02110-1301, USA.
*/
-#include <kcmdlineargs.h>
-#include <kapplication.h>
+#include <QFontMetrics>
+#include <qtest_kde.h>
+
#include <kdebug.h>
-#include <QtGui/QWidget>
+#include <QObject>
#include "kwordwrap.h"
-int main(int argc, char *argv[])
+class KWordWrap_UnitTest : public QObject
{
- KCmdLineArgs::init( argc, argv, "test", 0, ki18n("Test"), "1.0", ki18n("test app"));
- KApplication app;
-
- QFont font( "helvetica", 12 ); // let's hope we all have the same...
- QFontMetrics fm( font );
- QRect r( 0, 0, 100, -1 );
- QString str = "test wadabada [/foo/bar/waba]";
- KWordWrap* ww = KWordWrap::formatText( fm, r, 0, str );
- kDebug() << str << " => " << ww->truncatedString();
- delete ww;
+ Q_OBJECT
- str = "</p></p></p></p>";
- for ( ; r.width() > 0 ; r.setWidth( r.width()-10 ) )
+private Q_SLOTS:
+ void oldTruncationTest()
{
- ww = KWordWrap::formatText( fm, r, 0, str );
+ QFont font( "helvetica", 12 ); // let's hope we all have the same...
+ QFontMetrics fm( font );
+ QRect r( 0, 0, 100, -1 );
+ QString str = "test wadabada [/foo/bar/waba]";
+ KWordWrap* ww = KWordWrap::formatText( fm, r, 0, str );
kDebug() << str << " => " << ww->truncatedString();
+ QVERIFY(ww->truncatedString().endsWith("..."));
delete ww;
+
+ str = "</p></p></p></p>";
+ for ( ; r.width() > 0 ; r.setWidth( r.width()-10 ) )
+ {
+ ww = KWordWrap::formatText( fm, r, 0, str );
+ kDebug() << str << " => " << ww->truncatedString();
+ QVERIFY(ww->truncatedString().endsWith("..."));
+ delete ww;
+ }
}
-}
+
+ void testWithExistingNewlines() // when the input string has \n already
+ {
+ QRect r( 0, 0, 1000, -1 ); // very wide
+ QFont font( "helvetica", 12 ); // let's hope we all have the same...
+ QFontMetrics fm( font );
+ QString inputString = "The title here\nFoo (bar)\nFoo2 (bar2)";
+ KWordWrap* ww = KWordWrap::formatText( fm, r, 0, inputString );
+ QString str = ww->wrappedString();
+ QCOMPARE(str, inputString);
+ delete ww;
+ }
+};
+
+QTEST_KDEMAIN(KWordWrap_UnitTest, GUI)
+
+#include "kwordwraptest.moc"
--- kdeui/tests/CMakeLists.txt
+++ kdeui/tests/CMakeLists.txt
@@ -36,6 +36,7 @@
kstandardactiontest
kstandardshortcuttest
kuniqueapptest
+ kwordwraptest
kapplication_unittest
kcolorutilstest
kxmlgui_unittest
@@ -81,7 +82,6 @@
kdatetabletest
kinputdialogtest
ktabwidgettest
- kwordwraptest
ksqueezedtextlabeltest
kpixmapregionselectordialogtest
ktoolbarlabelactiontest
--- kdeui/widgets/ksqueezedtextlabel.cpp
+++ kdeui/widgets/ksqueezedtextlabel.cpp
@@ -91,6 +91,11 @@
squeezeTextToLabel();
}
+void KSqueezedTextLabel::clear() {
+ d->fullText = QString();
+ QLabel::clear();
+}
+
void KSqueezedTextLabel::squeezeTextToLabel() {
QFontMetrics fm(fontMetrics());
int labelWidth = size().width();
--- kdeui/widgets/kcompletionbox.cpp
+++ kdeui/widgets/kcompletionbox.cpp
@@ -54,16 +54,11 @@
d->upwardBox = false;
d->emitSelected = true;
- setWindowFlags( Qt::Popup ); // calls setVisible, so must be done after initializations
+ setWindowFlags( Qt::ToolTip ); // calls setVisible, so must be done after initializations
setLineWidth( 1 );
setFrameStyle( QFrame::Box | QFrame::Plain );
- if ( parent ) {
- setFocusProxy( parent );
- } else
- setFocusPolicy( Qt::NoFocus );
-
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@@ -113,14 +108,28 @@
bool KCompletionBox::eventFilter( QObject *o, QEvent *e )
{
int type = e->type();
+ QWidget *wid = qobject_cast<QWidget*>(o);
+
+ if (o == this) {
+ return false;
+ }
+
+ if (wid && (wid->windowFlags() & Qt::Window) && (type == QEvent::Move || type == QEvent::Resize)) {
+ hide();
+ return false;
+ }
- if ((o==this) && (type==QEvent::KeyPress)) {
- //not sure if this is a work around for a Qt bug or a fix for changed qt behaviour, at least it makes the kcombobox work again for me
- QApplication::sendEvent(d->m_parent,e);
- return true;
+ if (type == QEvent::MouseButtonPress && (wid && !isAncestorOf(wid))) {
+ if (!d->emitSelected && currentItem() && !qobject_cast<QScrollBar*>(o)) {
+ Q_ASSERT(currentItem());
+ emit currentTextChanged(currentItem()->text() );
+ }
+ hide();
+ e->accept();
+ return true;
}
- if ( o == d->m_parent ) {
+ if (wid && wid->isAncestorOf(d->m_parent)) {
if ( isVisible() ) {
if ( type == QEvent::KeyPress ) {
QKeyEvent *ev = static_cast<QKeyEvent *>( e );
@@ -229,43 +238,22 @@
break;
}
}
-
// parent gets a click -> we hide
else if ( type == QEvent::Resize ||
type == QEvent::Close || type == QEvent::Hide ) {
hide();
}
-
else if ( type == QEvent::FocusOut ) {
QFocusEvent* event = static_cast<QFocusEvent*>( e );
if (event->reason() != Qt::PopupFocusReason)
hide();
}
-
- }
- }
-
- // any mouse-click on something else than "this" makes us hide
- else if ( type == QEvent::MouseButtonPress ) {
- QMouseEvent *ev = static_cast<QMouseEvent *>( e );
- if ( !rect().contains( ev->pos() )) // this widget
- hide();
-
- if ( !d->emitSelected && currentItem() && !qobject_cast<QScrollBar*>(o) )
- {
- Q_ASSERT( currentItem() );
-
- emit currentTextChanged( currentItem()->text() );
- hide();
- ev->accept(); // Consume the mouse click event...
- return true;
}
}
return KListWidget::eventFilter( o, e );
}
-
void KCompletionBox::popup()
{
if ( count() == 0 )
@@ -282,12 +270,6 @@
else if ( size().height() != sizeHint().height() )
sizeAndPosition();
}
-
- // Make sure we give the focus back to the parent widget (ereslibre)
- if ( parentWidget() ) {
- QFocusEvent focusEvent( QEvent::FocusIn );
- QApplication::sendEvent( parentWidget(), &focusEvent );
- }
}
void KCompletionBox::sizeAndPosition()
--- kdeui/widgets/kmainwindow.cpp
+++ kdeui/widgets/kmainwindow.cpp
@@ -890,11 +890,12 @@
int state = ( size.width() > desk.width() ? NET::MaxHoriz : 0 )
| ( size.height() > desk.height() ? NET::MaxVert : 0 );
if(( state & NET::Max ) == NET::Max )
- ; // no resize
+ resize( desk.width(), desk.height() ); // WORKAROUND: this should not be needed. KWindowSystem::setState
+ // should be enough for maximizing. (ereslibre)
else if(( state & NET::MaxHoriz ) == NET::MaxHoriz )
- resize( width(), size.height());
+ resize( width(), desk.height());
else if(( state & NET::MaxVert ) == NET::MaxVert )
- resize( size.width(), height());
+ resize( desk.width(), height());
else
resize( size );
// QWidget::showMaximized() is both insufficient and broken
--- kdeui/widgets/ksqueezedtextlabel.h
+++ kdeui/widgets/ksqueezedtextlabel.h
@@ -91,6 +91,11 @@
* @param mode The new text.
*/
void setText( const QString &text );
+ /**
+ * Clears the text. Same remark as above.
+ *
+ */
+ void clear();
protected:
/**
--- kdeui/util/kwordwrap.h
+++ kdeui/util/kwordwrap.h
@@ -66,7 +66,7 @@
* @param len Length of text to wrap (default is -1 for all).
* @return a KWordWrap instance. The caller is responsible for storing and deleting the result.
*/
- static KWordWrap* formatText( QFontMetrics &fm, const QRect & r, int flags, const QString & str, int len = -1 );
+ static KWordWrap* formatText( QFontMetrics &fm, const QRect & r, int flags, const QString & str, int len = -1 ); // KDE5 TODO: return a value, not a pointer, and use QSharedDataPointer.
/**
* @return the bounding rect, calculated by formatText. The width is the
--- kdeui/util/kwordwrap.cpp
+++ kdeui/util/kwordwrap.cpp
@@ -61,11 +61,12 @@
bool wasBreakable = false; // value of isBreakable for last char (i-1)
bool isParens = false; // true if one of ({[
bool wasParens = false; // value of isParens for last char (i-1)
+ QString inputString = str;
for ( int i = 0 ; i < len; ++i )
{
- QChar c = str.at(i);
- int ww = fm.charWidth( str, i );
+ const QChar c = inputString.at(i);
+ const int ww = fm.charWidth(inputString, i);
isParens = ( c == QLatin1Char('(') || c == QLatin1Char('[')
|| c == QLatin1Char('{') );
@@ -74,7 +75,7 @@
// Special case for '(', '[' and '{': we want to break before them
if ( !isBreakable && i < len-1 ) {
- QChar nextc = str.at(i + 1); // look at next char
+ const QChar nextc = inputString.at(i + 1); // look at next char
isBreakable = ( nextc == QLatin1Char('(')
|| nextc == QLatin1Char('[')
|| nextc == QLatin1Char('{') );
@@ -93,7 +94,7 @@
breakAt = lastBreak;
if ( x + ww > w - 4 && lastBreak == -1 ) // time to break but found nowhere [-> break here]
breakAt = i;
- if ( i == len - 2 && x + ww + fm.charWidth( str, i+1 ) > w ) // don't leave the last char alone
+ if (i == len - 2 && x + ww + fm.charWidth(inputString, i+1) > w) // don't leave the last char alone
breakAt = lastBreak == -1 ? i - 1 : lastBreak;
if ( c == QLatin1Char('\n') ) // Forced break here
{
@@ -104,6 +105,7 @@
}
// remove the line feed from the string
kw->d->m_text.remove(i, 1);
+ inputString.remove(i, 1);
len--;
}
if ( breakAt != -1 )
--- kdecore/services/kmimetypefactory.cpp
+++ kdecore/services/kmimetypefactory.cpp
@@ -391,7 +391,7 @@
while (magicIter.hasPrevious()) { // global first, then local. Turns out it doesn't matter though.
const QString fileName = magicIter.previous();
QFile magicFile(fileName);
- kDebug() << "Now parsing " << fileName;
+ kDebug(7009) << "Now parsing " << fileName;
if (magicFile.open(QIODevice::ReadOnly))
m_magicRules += parseMagicFile(&magicFile, fileName);
}
--- kdecore/localization/ktranscript.cpp
+++ kdecore/localization/ktranscript.cpp
@@ -118,6 +118,7 @@
JSValue *getPropf (ExecState *exec, JSValue *phrase, JSValue *prop);
JSValue *setPropf (ExecState *exec, JSValue *phrase, JSValue *prop, JSValue *value);
JSValue *toUpperFirstf (ExecState *exec, JSValue *str, JSValue *nalt);
+ JSValue *toLowerFirstf (ExecState *exec, JSValue *str, JSValue *nalt);
JSValue *getConfStringf (ExecState *exec, JSValue *key, JSValue *dval);
JSValue *getConfBoolf (ExecState *exec, JSValue *key, JSValue *dval);
JSValue *getConfNumberf (ExecState *exec, JSValue *key, JSValue *dval);
@@ -144,6 +145,7 @@
GetProp,
SetProp,
ToUpperFirst,
+ ToLowerFirst,
GetConfString,
GetConfBool,
GetConfNumber
@@ -695,6 +697,7 @@
getProp Scriptface::GetProp DontDelete|ReadOnly|Function 2
setProp Scriptface::SetProp DontDelete|ReadOnly|Function 3
toUpperFirst Scriptface::ToUpperFirst DontDelete|ReadOnly|Function 2
+ toLowerFirst Scriptface::ToLowerFirst DontDelete|ReadOnly|Function 2
getConfString Scriptface::GetConfString DontDelete|ReadOnly|Function 2
getConfBool Scriptface::GetConfBool DontDelete|ReadOnly|Function 2
getConfNumber Scriptface::GetConfNumber DontDelete|ReadOnly|Function 2
@@ -795,6 +798,8 @@
return obj->setPropf(exec, CALLARG(0), CALLARG(1), CALLARG(2));
case Scriptface::ToUpperFirst:
return obj->toUpperFirstf(exec, CALLARG(0), CALLARG(1));
+ case Scriptface::ToLowerFirst:
+ return obj->toLowerFirstf(exec, CALLARG(0), CALLARG(1));
case Scriptface::GetConfString:
return obj->getConfStringf(exec, CALLARG(0), CALLARG(1));
case Scriptface::GetConfBool:
@@ -1182,33 +1187,19 @@
return jsUndefined();
}
-JSValue *Scriptface::toUpperFirstf (ExecState *exec,
- JSValue *str, JSValue *nalt)
+static QString toCaseFirst (const QString &qstr, int qnalt, bool toupper)
{
static QString head("~@");
static int hlen = head.length();
- if (!str->isString()) {
- return throwError(exec, TypeError,
- SPREF"toUpperFirst: expected string as first argument");
- }
- if (!(nalt->isNumber() || nalt->isNull())) {
- return throwError(exec, TypeError,
- SPREF"toUpperFirst: expected number as second argument");
- }
-
- QString qstr = str->toString(exec).qstring();
- int qnalt = nalt->isNull() ? 0 : nalt->toInteger(exec);
-
// If the first letter is found within an alternatives directive,
- // upcase the first letter in each of the alternatives in that directive.
-
- QString qstruc = qstr;
+ // change case of the first letter in each of the alternatives.
+ QString qstrcc = qstr;
int len = qstr.length();
QChar altSep;
int remainingAlts = 0;
bool checkCase = true;
- int numUpcased = 0;
+ int numChcased = 0;
int i = 0;
while (i < len) {
QChar c = qstr[i];
@@ -1219,7 +1210,7 @@
if (i >= len) break; // malformed directive, bail out
// Record alternatives separator, set number of remaining
// alternatives, reactivate case checking.
- altSep = qstruc[i];
+ altSep = qstrcc[i];
remainingAlts = qnalt;
checkCase = true;
}
@@ -1230,16 +1221,20 @@
checkCase = true;
}
else if (checkCase && c.isLetter()) {
- // Case check is active and the character is a letter; upcase.
- qstruc[i] = c.toUpper();
- ++numUpcased;
+ // Case check is active and the character is a letter; change case.
+ if (toupper) {
+ qstrcc[i] = c.toUpper();
+ } else {
+ qstrcc[i] = c.toLower();
+ }
+ ++numChcased;
// No more case checks until next alternatives separator.
checkCase = false;
}
- // If any letter has been upcased, and there are no more alternatives
+ // If any letter has been changed, and there are no more alternatives
// to be processed, we're done.
- if (numUpcased > 0 && remainingAlts == 0) {
+ if (numChcased > 0 && remainingAlts == 0) {
break;
}
@@ -1247,9 +1242,49 @@
++i;
}
+ return qstrcc;
+}
+
+JSValue *Scriptface::toUpperFirstf (ExecState *exec,
+ JSValue *str, JSValue *nalt)
+{
+ if (!str->isString()) {
+ return throwError(exec, TypeError,
+ SPREF"toUpperFirst: expected string as first argument");
+ }
+ if (!(nalt->isNumber() || nalt->isNull())) {
+ return throwError(exec, TypeError,
+ SPREF"toUpperFirst: expected number as second argument");
+ }
+
+ QString qstr = str->toString(exec).qstring();
+ int qnalt = nalt->isNull() ? 0 : nalt->toInteger(exec);
+
+ QString qstruc = toCaseFirst(qstr, qnalt, true);
+
return jsString(qstruc);
}
+JSValue *Scriptface::toLowerFirstf (ExecState *exec,
+ JSValue *str, JSValue *nalt)
+{
+ if (!str->isString()) {
+ return throwError(exec, TypeError,
+ SPREF"toLowerFirst: expected string as first argument");
+ }
+ if (!(nalt->isNumber() || nalt->isNull())) {
+ return throwError(exec, TypeError,
+ SPREF"toLowerFirst: expected number as second argument");
+ }
+
+ QString qstr = str->toString(exec).qstring();
+ int qnalt = nalt->isNull() ? 0 : nalt->toInteger(exec);
+
+ QString qstrlc = toCaseFirst(qstr, qnalt, false);
+
+ return jsString(qstrlc);
+}
+
JSValue *Scriptface::getConfStringf (ExecState *exec,
JSValue *key, JSValue *dval)
{
--- kdecore/all_languages.desktop
+++ kdecore/all_languages.desktop
@@ -3883,7 +3883,7 @@
Name[da]=Øvre Sorbisk
Name[de]=Obersorbisch
Name[eo]=Alta soraba
-Name[es]=Alto sórabo
+Name[es]=Alto sorabo
Name[et]=Ülemsorbi
Name[eu]=Goi Serbiera
Name[fa]=صربستان شمالی
--- kdecore/util/kshell_unix.cpp
+++ kdecore/util/kshell_unix.cpp
@@ -123,12 +123,12 @@
int pos2 = pos;
QChar cc;
do {
- if (++pos2 >= args.length()) {
+ if (pos2 >= args.length()) {
// Exactly one word
- ret += args.mid(pos);
+ ret += args.mid(pos - 1);
goto okret;
}
- cc = args[pos2];
+ cc = args[pos2++];
} while (cc == QLatin1Char('_') ||
(cc >= QLatin1Char('A') && cc <= QLatin1Char('Z')) ||
(cc >= QLatin1Char('a') && cc <= QLatin1Char('z')) ||
Property changes on: .
___________________________________________________________________
Deleted: svn:mergeinfo
Added: svn:externals
+