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

List:       kde-commits
Subject:    branches/KDE/3.5/kdelibs/kate/part
From:       Dominik Haumann <dhdev () gmx ! de>
Date:       2006-08-25 16:26:46
Message-ID: 1156523206.489155.4761.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 577126 by dhaumann:

fix the bug state in comment #3 of bug #132835.
(This includes deriving KateAutoIndent from QObject.)
CCBUG: 132835


 M  +5 -4      kateautoindent.cpp  
 M  +21 -2     kateautoindent.h  


--- branches/KDE/3.5/kdelibs/kate/part/kateautoindent.cpp #577125:577126
@@ -148,7 +148,7 @@
 }
 
 KateAutoIndent::KateAutoIndent (KateDocument *_doc)
-: doc(_doc)
+: QObject(), doc(_doc)
 {
 }
 KateAutoIndent::~KateAutoIndent ()
@@ -186,7 +186,10 @@
 KateNormalIndent::KateNormalIndent (KateDocument *_doc)
  : KateAutoIndent (_doc)
 {
+  // if highlighting changes, update attributes
+  connect(_doc, SIGNAL(hlChanged()), this, SLOT(updateConfig()));
 }
+
 KateNormalIndent::~KateNormalIndent ()
 {
 }
@@ -2022,7 +2025,7 @@
 };
 
 KateVarIndent::KateVarIndent( KateDocument *doc )
-: QObject( 0, "variable indenter"), KateNormalIndent( doc )
+: KateNormalIndent( doc )
 {
   d = new KateVarIndentPrivate;
   d->reIndentAfter = QRegExp( doc->variable( "var-indent-indent-after" ) );
@@ -2070,8 +2073,6 @@
 
 void KateVarIndent::processLine ( KateDocCursor &line )
 {
-  updateConfig(); // ### is it really nessecary *each time* ??
-
   QString indent; // store the indent string here
 
   // find the first line with content that is not starting with comment text,
--- branches/KDE/3.5/kdelibs/kate/part/kateautoindent.h #577125:577126
@@ -67,8 +67,10 @@
  * This baseclass is a real dummy, does nothing beside remembering the document it belongs too,
  * only to have the object around
  */
-class KateAutoIndent
+class KateAutoIndent : public QObject
 {
+  Q_OBJECT
+
   /**
    * Static methods to create and list indention modes
    */
@@ -133,11 +135,13 @@
      */
     virtual ~KateAutoIndent ();
 
+  public slots:
     /**
      * Update indenter's configuration (indention width, attributes etc.)
      */
     virtual void updateConfig () {};
 
+  public:
     /**
      * does this indenter support processNewLine
      * @return can you do it?
@@ -212,6 +216,8 @@
  */
 class KateNormalIndent : public KateAutoIndent
 {
+  Q_OBJECT
+
 public:
     /**
      * Constructor
@@ -224,11 +230,13 @@
      */
   virtual ~KateNormalIndent ();
 
+public slots:
     /**
      * Update indenter's configuration (indention width, attributes etc.)
      */
   virtual void updateConfig ();
 
+public:
     /**
      * does this indenter support processNewLine
      * @return can you do it?
@@ -334,6 +342,8 @@
 
 class KateCSmartIndent : public KateNormalIndent
 {
+  Q_OBJECT
+
   public:
     KateCSmartIndent (KateDocument *doc);
     ~KateCSmartIndent ();
@@ -363,6 +373,8 @@
 
 class KatePythonIndent : public KateNormalIndent
 {
+  Q_OBJECT
+
   public:
     KatePythonIndent (KateDocument *doc);
     ~KatePythonIndent ();
@@ -381,6 +393,8 @@
 
 class KateXmlIndent : public KateNormalIndent
 {
+  Q_OBJECT
+
   public:
     KateXmlIndent (KateDocument *doc);
     ~KateXmlIndent ();
@@ -408,6 +422,8 @@
 
 class KateCSAndSIndent : public KateNormalIndent
 {
+  Q_OBJECT
+
   public:
     KateCSAndSIndent (KateDocument *doc);
     ~KateCSAndSIndent ();
@@ -467,9 +483,10 @@
  * The idea is to provide a somewhat intelligent indentation for perl, php,
  * bash, scheme and in general formats with humble indentation needs.
  */
-class KateVarIndent :  public QObject, public KateNormalIndent
+class KateVarIndent : public KateNormalIndent
 {
   Q_OBJECT
+
   public:
     /**
      * Purely for readability, couples we know and love
@@ -519,6 +536,8 @@
 
 class KateScriptIndent : public KateNormalIndent
 {
+  Q_OBJECT
+
   public:
     KateScriptIndent( KateDocument *doc );
     ~KateScriptIndent();
[prev in list] [next in list] [prev in thread] [next in thread] 

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