Changeset View
Changeset View
Standalone View
Standalone View
addons/symbolviewer/bash_parser.cpp
Show All 36 Lines | 26 | { | |||
---|---|---|---|---|---|
37 | QTreeWidgetItem *funcNode = nullptr; | 37 | QTreeWidgetItem *funcNode = nullptr; | ||
38 | QTreeWidgetItem *lastFuncNode = nullptr; | 38 | QTreeWidgetItem *lastFuncNode = nullptr; | ||
39 | 39 | | |||
40 | QPixmap func( ( const char** ) class_xpm ); | 40 | QPixmap func( ( const char** ) class_xpm ); | ||
41 | 41 | | |||
42 | //It is necessary to change names | 42 | //It is necessary to change names | ||
43 | m_func->setText(i18n("Show Functions")); | 43 | m_func->setText(i18n("Show Functions")); | ||
44 | 44 | | |||
45 | if(m_plugin->treeOn) | 45 | if(m_treeOn->isChecked()) | ||
46 | { | 46 | { | ||
47 | funcNode = new QTreeWidgetItem(m_symbols, QStringList(i18n("Functions") ) ); | 47 | funcNode = new QTreeWidgetItem(m_symbols, QStringList(i18n("Functions") ) ); | ||
48 | funcNode->setIcon(0, QIcon(func)); | 48 | funcNode->setIcon(0, QIcon(func)); | ||
49 | 49 | | |||
50 | if (m_plugin->expandedOn) | 50 | if (m_plugin->expandedOn) | ||
51 | { | 51 | { | ||
52 | m_symbols->expandItem(funcNode); | 52 | m_symbols->expandItem(funcNode); | ||
53 | } | 53 | } | ||
Show All 31 Lines | 77 | { | |||
85 | 85 | | |||
86 | // strip everything unneeded and get the function's name | 86 | // strip everything unneeded and get the function's name | ||
87 | currline.remove(QRegExp(QLatin1String("^(function )*"))); | 87 | currline.remove(QRegExp(QLatin1String("^(function )*"))); | ||
88 | funcName = currline.split(QRegExp(QLatin1String("((\\( *\\))|[^a-zA-Z0-9-_])")))[0].simplified(); | 88 | funcName = currline.split(QRegExp(QLatin1String("((\\( *\\))|[^a-zA-Z0-9-_])")))[0].simplified(); | ||
89 | if(!funcName.size()) | 89 | if(!funcName.size()) | ||
90 | continue; | 90 | continue; | ||
91 | funcName.append(QLatin1String("()")); | 91 | funcName.append(QLatin1String("()")); | ||
92 | 92 | | |||
93 | if (m_plugin->treeOn) | 93 | if (m_treeOn->isChecked()) | ||
94 | { | 94 | { | ||
95 | node = new QTreeWidgetItem(funcNode, lastFuncNode); | 95 | node = new QTreeWidgetItem(funcNode, lastFuncNode); | ||
96 | lastFuncNode = node; | 96 | lastFuncNode = node; | ||
97 | } | 97 | } | ||
98 | else | 98 | else | ||
99 | node = new QTreeWidgetItem(m_symbols); | 99 | node = new QTreeWidgetItem(m_symbols); | ||
100 | 100 | | |||
101 | node->setText(0, funcName); | 101 | node->setText(0, funcName); | ||
102 | node->setIcon(0, QIcon(func)); | 102 | node->setIcon(0, QIcon(func)); | ||
103 | node->setText(1, QString::number( i, 10)); | 103 | node->setText(1, QString::number( i, 10)); | ||
104 | } | 104 | } | ||
105 | } //for i loop | 105 | } //for i loop | ||
106 | } | 106 | } |