diff --git a/addons/symbolviewer/bash_parser.cpp b/addons/symbolviewer/bash_parser.cpp --- a/addons/symbolviewer/bash_parser.cpp +++ b/addons/symbolviewer/bash_parser.cpp @@ -73,7 +73,7 @@ if(currline.at(0) == QLatin1Char('#')) comment = true; //mainprog=false; - if(!comment && func_on) + if(!comment && m_func->isChecked()) { QString funcName; diff --git a/addons/symbolviewer/cpp_parser.cpp b/addons/symbolviewer/cpp_parser.cpp --- a/addons/symbolviewer/cpp_parser.cpp +++ b/addons/symbolviewer/cpp_parser.cpp @@ -108,7 +108,7 @@ { //stripped.replace(0x9, QLatin1String(" ")); stripped = stripped.trimmed(); - if (macro_on == true) + if (m_macro->isChecked()) { if (m_plugin->treeOn) { @@ -146,7 +146,7 @@ if(cl.at(j)==QLatin1Char('{')) { mclass = 4; break;} stripped += cl.at(j); } - if(func_on == true) + if(m_func->isChecked()) { if (m_plugin->treeOn) { @@ -240,7 +240,7 @@ (cl.at(j)==QLatin1Char('{') && structure == false && cl.indexOf(QLatin1Char('}')) > (int)j)) { stripped.replace(0x9, QLatin1String(" ")); - if(func_on == true) + if(m_func->isChecked()) { QString strippedWithTypes = stripped; if (m_plugin->typesOn == false) @@ -322,7 +322,7 @@ //stripped.replace(0x9, QLatin1String(" ")); stripped.remove(QLatin1Char('{')); stripped.replace(QLatin1Char('}'), QLatin1String(" ")); - if(struct_on == true) + if(m_struct->isChecked()) { if (m_plugin->treeOn) { diff --git a/addons/symbolviewer/fortran_parser.cpp b/addons/symbolviewer/fortran_parser.cpp --- a/addons/symbolviewer/fortran_parser.cpp +++ b/addons/symbolviewer/fortran_parser.cpp @@ -122,7 +122,7 @@ { if(currline.startsWith(QLatin1String("program "))) mainprog=true; - if (macro_on == true) // not really a macro, but a subroutines + if (m_macro->isChecked()) // not really a macro, but a subroutines { stripped += currline.right(currline.length()); stripped = stripped.simplified(); @@ -177,7 +177,7 @@ //Modules else if(block==2) { - if (struct_on == true) // not really a struct, but a module + if (m_struct->isChecked()) // not really a struct, but a module { stripped = currline.right(currline.length()); stripped = stripped.simplified(); @@ -210,7 +210,7 @@ //Functions else if(block==3) { - if (func_on == true) + if (m_func->isChecked()) { stripped += currline.right(currline.length()); stripped = stripped.trimmed(); diff --git a/addons/symbolviewer/perl_parser.cpp b/addons/symbolviewer/perl_parser.cpp --- a/addons/symbolviewer/perl_parser.cpp +++ b/addons/symbolviewer/perl_parser.cpp @@ -78,7 +78,7 @@ cl = cl.trimmed(); //qDebug()<<"Trimmed line " << i << " : "<< cl; - if(cl.indexOf(QRegExp(QLatin1String("^use +[A-Z]"))) == 0 && macro_on) + if(cl.indexOf(QRegExp(QLatin1String("^use +[A-Z]"))) == 0 && m_macro->isChecked()) { QString stripped=cl.remove( QRegExp(QLatin1String("^use +")) ); //stripped=stripped.replace( QRegExp(QLatin1String(";$")), "" ); // Doesn't work ?? @@ -96,7 +96,7 @@ node->setText(1, QString::number( i, 10)); } #if 1 - if(cl.indexOf(QRegExp(QLatin1String("^use +[a-z]"))) == 0 && struct_on) + if(cl.indexOf(QRegExp(QLatin1String("^use +[a-z]"))) == 0 && m_struct->isChecked()) { QString stripped=cl.remove( QRegExp(QLatin1String("^use +")) ); stripped=stripped.remove( QRegExp(QLatin1String(";$")) ); @@ -114,7 +114,7 @@ } #endif #if 1 - if(cl.indexOf(QRegExp(QLatin1String("^sub +")))==0 && func_on) + if(cl.indexOf(QRegExp(QLatin1String("^sub +")))==0 && m_func->isChecked()) { QString stripped=cl.remove( QRegExp(QLatin1String("^sub +")) ); stripped=stripped.remove( QRegExp(QLatin1String("[{;] *$")) ); diff --git a/addons/symbolviewer/plugin_katesymbolviewer.h b/addons/symbolviewer/plugin_katesymbolviewer.h --- a/addons/symbolviewer/plugin_katesymbolviewer.h +++ b/addons/symbolviewer/plugin_katesymbolviewer.h @@ -124,8 +124,6 @@ QAction *m_struct; QAction *m_func; - bool macro_on, struct_on, func_on; // FIXME Remove and replace by m_foo->isChecked(); - QTimer m_updateTimer; QTimer m_currItemTimer; int m_oldCursorLine; diff --git a/addons/symbolviewer/plugin_katesymbolviewer.cpp b/addons/symbolviewer/plugin_katesymbolviewer.cpp --- a/addons/symbolviewer/plugin_katesymbolviewer.cpp +++ b/addons/symbolviewer/plugin_katesymbolviewer.cpp @@ -105,9 +105,6 @@ m_func->setChecked(true); m_treeOn->setChecked(m_plugin->treeOn); m_sort->setChecked(m_plugin->sortOn); - macro_on = true; - struct_on = true; - func_on = true; m_updateTimer.setSingleShot(true); connect(&m_updateTimer, &QTimer::timeout, this, &KatePluginSymbolViewerView::slotRefreshSymbol); @@ -159,19 +156,16 @@ void KatePluginSymbolViewerView::toggleShowMacros(void) { - macro_on = m_macro->isChecked(); slotRefreshSymbol(); } void KatePluginSymbolViewerView::toggleShowStructures(void) { - struct_on = m_struct->isChecked(); slotRefreshSymbol(); } void KatePluginSymbolViewerView::toggleShowFunctions(void) { - func_on = m_func->isChecked(); slotRefreshSymbol(); } diff --git a/addons/symbolviewer/python_parser.cpp b/addons/symbolviewer/python_parser.cpp --- a/addons/symbolviewer/python_parser.cpp +++ b/addons/symbolviewer/python_parser.cpp @@ -109,7 +109,7 @@ else //strip off the word "def " name = name.trimmed ().mid (4); - if (func_on == true && in_class == 1) + if (m_func->isChecked() && in_class == 1) { if (m_plugin->treeOn) { @@ -126,7 +126,7 @@ node->setText(1, QString::number( line, 10)); } - if (struct_on == true && in_class == 2) + if (m_struct->isChecked() && in_class == 2) { if (m_plugin->treeOn) { @@ -140,7 +140,7 @@ node->setText(1, QString::number( line, 10)); } - if (macro_on == true && in_class == 0) + if (m_macro->isChecked() && in_class == 0) { if (m_plugin->treeOn) { diff --git a/addons/symbolviewer/ruby_parser.cpp b/addons/symbolviewer/ruby_parser.cpp --- a/addons/symbolviewer/ruby_parser.cpp +++ b/addons/symbolviewer/ruby_parser.cpp @@ -60,7 +60,7 @@ if (cl.indexOf( QRegExp(QLatin1String("^class [a-zA-Z0-9]+[^#]")) ) >= 0) { - if (func_on == true) + if (m_func->isChecked()) { if (m_plugin->treeOn) { @@ -78,7 +78,7 @@ } if (cl.indexOf( QRegExp(QLatin1String("^def [a-zA-Z_]+[^#]")) ) >= 0 ) { - if (struct_on == true) + if (m_struct->isChecked()) { if (m_plugin->treeOn) { diff --git a/addons/symbolviewer/tcl_parser.cpp b/addons/symbolviewer/tcl_parser.cpp --- a/addons/symbolviewer/tcl_parser.cpp +++ b/addons/symbolviewer/tcl_parser.cpp @@ -82,7 +82,7 @@ { if(currline.startsWith(varStr) && block == 0) { - if (macro_on == true) // not really a macro, but a variable + if (m_macro->isChecked()) // not really a macro, but a variable { stripped = currline.right(currline.length() - 3); stripped = stripped.simplified(); @@ -129,7 +129,7 @@ if (args_par == 0) { //stripped = stripped.simplified(); - if(func_on == true) + if(m_func->isChecked()) { if (m_plugin->treeOn) { @@ -148,7 +148,7 @@ } } // block = 0 } // for j loop - }//func_on + }//m_func->isChecked() } // not a comment } //for i loop diff --git a/addons/symbolviewer/xslt_parser.cpp b/addons/symbolviewer/xslt_parser.cpp --- a/addons/symbolviewer/xslt_parser.cpp +++ b/addons/symbolviewer/xslt_parser.cpp @@ -85,7 +85,7 @@ if (comment==1) { continue; } if (templ==1) { continue; } - if(cl.indexOf(QRegExp(QLatin1String("^isChecked()) { QString stripped = cl.remove(QRegExp(QLatin1String("^setText(1, QString::number( i, 10)); } - if(cl.indexOf(QRegExp(QLatin1String("^isChecked()) { QString stripped = cl.remove(QRegExp(QLatin1String("^setText(1, QString::number( i, 10)); } - if(cl.indexOf(QRegExp(QLatin1String("^setText(1, QString::number( i, 10)); } - if(cl.indexOf(QRegExp(QLatin1String("^