Bug 75340 - Code snippets delimiter configuration has no effect
Summary: Code snippets delimiter configuration has no effect
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: 3.0.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-16 11:58 UTC by Bernd Pol
Modified: 2004-05-14 23:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
fixes bug in getting the delimiter from the configuration (1.28 KB, patch)
2004-05-11 18:19 UTC, Robert Gruber
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Pol 2004-02-16 11:58:51 UTC
Version:           3.0.0 (using KDE 3.2.90 (CVS >= 20040117), compiled sources)
Compiler:          gcc version 3.3.1 (SuSE Linux)
OS:          Linux (i686) release 2.4.21-99-athlon

On the Code Snippets configuration page, selecting another delimiter than the predefined 'S' has no effect. The code snippets tool still only tries to resolve $-delimited text as variables.
I tested this on snippets which already contained $-delimited text, existing snippets as well as new added ones.
Comment 1 Bernd Pol 2004-04-14 21:32:19 UTC
*** Bug has been marked as fixed ***.
Comment 2 Bernd Pol 2004-04-14 21:48:24 UTC
Sorry, this was the wrong one closed. Reopening.
Comment 3 Robert Gruber 2004-05-11 18:19:52 UTC
Created attachment 5947 [details]
fixes bug in getting the delimiter from the configuration

hi,

this patch fixes the bug#75340.

The problem was that I'd forgotten to retrieve the current delimiter from the
configuration. That's why the default '$' was used all the time.

Can someone please commit it to CVS, thank.

Greets
Robert
Comment 4 Jens Dagerbo 2004-05-14 23:33:31 UTC
CVS commit by dagerbo: 

Applied Robert Gruber's patch. Thanks!

CCMAIL: 75340-done@bugs.kde.org


  M +6 -6      snippet_widget.cpp   1.6
  M +1 -1      snippet_widget.h   1.3


--- kdevelop/parts/snippet/snippet_widget.cpp  #1.5:1.6
@@ -148,5 +148,5 @@ void SnippetWidget::slotEdit()
 /*!
     On a DoubleClick the clicked snippet gets inserted at the
-    aktual cursor position of the active view
+    current cursor position of the active view
 */
 void SnippetWidget::slotListDblClicked(QListViewItem * item, const QPoint &, int)
@@ -167,6 +167,6 @@ void SnippetWidget::slotListDblClicked(Q
   //OK, now we've got the clicked snippet
 
-  //process variables if any and then insert into the active view
-  insertIntoActivView( parseText(pSnippet->getText()) );
+  //process variables if any, then insert into the active view
+  insertIntoActiveView( parseText(pSnippet->getText(), _SnippetConfig.getDelimiter()) );
 }
 
@@ -190,8 +190,8 @@ SnippetItem * SnippetWidget::pFindByName
 
 /*!
-    \fn SnippetWidget::insertIntoActivView(QString text)
+    \fn SnippetWidget::insertIntoActiveView(QString text)
     Inserts the parameter text into the activ view
  */
-void SnippetWidget::insertIntoActivView(QString text)
+void SnippetWidget::insertIntoActiveView(QString text)
 {
   //get the interfaces for the KTexteditor parts
@@ -371,5 +371,5 @@ void SnippetWidget::showPopupMenu( QList
 
 
-//  fn SnippetWidget::parseText(QString text)
+//  fn SnippetWidget::parseText(QString text, QString del)
 /*!
     This function is used to parse the given QString for variables. If found the user will be prompted

--- kdevelop/parts/snippet/snippet_widget.h  #1.2:1.3
@@ -59,5 +59,5 @@ protected:
 
 private:
-    void insertIntoActivView(QString text);
+    void insertIntoActiveView(QString text);
     QString parseText(QString text, QString del="$");
     bool showMultiVarDialog(QMap<QString, QString> * map, QMap<QString, QString> * mapSave,