[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: HighlightInterface
From:       Anders Lund <anders () alweb ! dk>
Date:       2007-10-04 8:15:53
Message-ID: 200710041015.53859.anders () alweb ! dk
[Download RAW message or body]

On Wednesday 03 October 2007, Anders Lund wrote:
> I am preparing a set of patches that adds and implements these, will finish
> them tomorrow.

... and here are the patches. They compiles, and I have modified my local copy 
of filetemplates to use the highlightSection() function, so I know that it 
also works.

Now to the serious part: This is an API change. Can I commit it?

-- 
Anders

www: http://www.alweb.dk
jabber: anderslund@jabber.dk

["katepart-document-sections.patch" (text/x-diff)]

Index: document/katedocument.cpp
===================================================================
--- document/katedocument.cpp	(revision 720068)
+++ document/katedocument.cpp	(working copy)
@@ -3014,6 +3014,16 @@ QStringList KateDocument::highlightingMo
   return hls;
 }
 
+QString KateDocument::highlightSection( int index ) const
+{
+  return KateHlManager::self()->hlSection( index );
+}
+
+QString KateDocument::modeSection( int index ) const
+{
+  return KateGlobal::self()->modeManager()->list()[ index ]->section;
+}
+
 void KateDocument::bufferHlChanged ()
 {
   // update all views
Index: document/katedocument.h
===================================================================
--- document/katedocument.h	(revision 720068)
+++ document/katedocument.h	(working copy)
@@ -506,6 +506,21 @@ class KateDocument : public KTextEditor:
      * \return \e true on success, otherwise \e false
      */
     virtual bool setHighlightingMode(const QString &name);
+    /**
+     * Returns the name of the section for a highlight given its index in the highlight 
+     * list (as returned by highlightModes()).
+     * You can use this function to build a tree of the highlight names, organized in sections.
+     * \param name the name of the highlight for which to find the section name.
+     */
+    virtual QString highlightSection( int index ) const;
+
+    /**
+     * Returns the name of the section for a mode given its index in the highlight 
+     * list (as returned by modes()).
+     * You can use this function to build a tree of the mode names, organized in sections.
+     * \param name the name of the highlight for which to find the section name.
+     */
+    virtual QString modeSection( int index ) const;
 
   /*
    * SIGNALS

["ktexteditor-document-sections.patch" (text/x-diff)]

Index: document.h
===================================================================
--- document.h	(revision 720068)
+++ document.h	(working copy)
@@ -629,6 +629,22 @@ class KTEXTEDITOR_EXPORT Document : publ
      */
     virtual bool setHighlightingMode(const QString &name) = 0;
 
+    /**
+     * Returns the name of the section for a highlight given its index in the highlight 
+     * list (as returned by highlightModes()).
+     * You can use this function to build a tree of the highlight names, organized in sections.
+     * \param name the name of the highlight for which to find the section name.
+     */
+    virtual QString highlightSection( int index ) const = 0;
+
+    /**
+     * Returns the name of the section for a mode given its index in the highlight 
+     * list (as returned by modes()).
+     * You can use this function to build a tree of the mode names, organized in sections.
+     * \param name the name of the highlight for which to find the section name.
+     */
+    virtual QString modeSection( int index ) const = 0;
+
   /*
    * SIGNALS
    * Following signals should be emitted by the document if the mode


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic