summaryrefslogtreecommitdiffstats
path: root/kate
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2015-08-07 23:38:43 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2015-08-07 23:38:43 +0900
commit4d976d10e8d99776881152c0911f80890ffba579 (patch)
treea4e93daf09727a15bd219ff3e2381fd9bda5c298 /kate
parent5e63e8ee969a7eb7d9c75f0082ff4d9a9fc0fc9d (diff)
downloadtdeaddons-4d976d10e8d99776881152c0911f80890ffba579.tar.gz
tdeaddons-4d976d10e8d99776881152c0911f80890ffba579.zip
Fixed recognition of C++ files in kate/cppsymbolviewer plugin. This resolves bug 2498. Also fixed building warnings.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kate')
-rw-r--r--kate/cppsymbolviewer/cpp_parser.cpp18
-rw-r--r--kate/cppsymbolviewer/plugin_katesymbolviewer.cpp2
2 files changed, 8 insertions, 12 deletions
diff --git a/kate/cppsymbolviewer/cpp_parser.cpp b/kate/cppsymbolviewer/cpp_parser.cpp
index b666983..9aceda2 100644
--- a/kate/cppsymbolviewer/cpp_parser.cpp
+++ b/kate/cppsymbolviewer/cpp_parser.cpp
@@ -23,9 +23,9 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
TQString cl; // Current Line
TQString stripped;
uint i, j, tmpPos = 0;
- int par = 0, graph = 0, retry = 0;
+ int par = 0, graph = 0;
char mclass = 0, block = 0, comment = 0; // comment: 0-no comment 1-inline comment 2-multiline comment 3-string
- char macro = 0, macro_pos = 0, func_close = 0;
+ char macro = 0, func_close = 0;
bool structure = false;
TQPixmap cls( ( const char** ) class_xpm );
TQPixmap sct( ( const char** ) struct_xpm );
@@ -76,7 +76,6 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
/* *********************** MACRO PARSING *****************************/
if(macro == 1)
{
- //macro_pos = cl.find("#");
for (j = 0; j < cl.length(); j++)
{
if(cl.at(j)=='/' && cl.at(j+1)=='/') { macro = 4; break; }
@@ -113,7 +112,6 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
node->setText(1, TQString::number( i, 10));
}
macro = 0;
- macro_pos = 0;
stripped = "";
//kdDebug(13000)<<"Macro -- Inserted : "<<stripped<<" at row : "<<i<<endl;
if (cl.at(cl.length() - 1) == '\\') macro = 5; // continue in rows below
@@ -158,7 +156,7 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
}
if (mclass == 3)
{
- if (cl.find('{') >= 0)
+ if (cl.find('{') >= 0)
{
cl = cl.right(cl.find('{'));
mclass = 4;
@@ -216,8 +214,8 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
break;
}
- if(cl.at(j)=='{' && structure == false && cl.find(";") < 0 ||
- cl.at(j)=='{' && structure == false && cl.find('}') > (int)j)
+ if((cl.at(j)=='{' && structure == false && cl.find(";") < 0) ||
+ (cl.at(j)=='{' && structure == false && cl.find('}') > (int)j))
{
stripped.replace(0x9, " ");
if(func_on == true)
@@ -240,7 +238,7 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
node = new TQListViewItem(mtdNode, lastMtdNode, stripped);
lastMtdNode = node;
}
- else
+ else
{
node = new TQListViewItem(clsNode, lastClsNode, stripped);
lastClsNode = node;
@@ -253,7 +251,6 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
node->setText(1, TQString::number( tmpPos, 10));
}
stripped = "";
- retry = 0;
block = 3;
}
if(cl.at(j)=='{' && structure == true)
@@ -263,7 +260,6 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
}
if(cl.at(j)=='(' && structure == true)
{
- retry = 1;
block = 0;
j = 0;
//kdDebug(13000)<<"Restart from the beginning of line..."<<endl;
@@ -319,7 +315,7 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
} // BLOCK > 0
if (mclass == 4 && block == 0 && func_close == 0)
{
- if (cl.find('}') >= 0)
+ if (cl.find('}') >= 0)
{
cl = cl.right(cl.find('}'));
mclass = 0;
diff --git a/kate/cppsymbolviewer/plugin_katesymbolviewer.cpp b/kate/cppsymbolviewer/plugin_katesymbolviewer.cpp
index 3bc152a..3de7fa2 100644
--- a/kate/cppsymbolviewer/plugin_katesymbolviewer.cpp
+++ b/kate/cppsymbolviewer/plugin_katesymbolviewer.cpp
@@ -219,7 +219,7 @@ void KatePluginSymbolViewerView::parseSymbols(void)
//TQListViewItem mcrNode = new TQListViewItem(symbols, symbols->lastItem(), hlModeName);
- if (hlModeName == "C++" || hlModeName == "C")
+ if (hlModeName == "C" || hlModeName == "ISO C++" || hlModeName.find("C++")==0)
parseCppSymbols();
else if (hlModeName == "Tcl/Tk")
parseTclSymbols();