[DEV] add print log and correct the tree view
This commit is contained in:
parent
b7b962c3f5
commit
626c9ba386
@ -12,6 +12,7 @@ namespace appl {
|
|||||||
};
|
};
|
||||||
#define APPL_BASE(info,data) ELOG_BASE(appl::getLogId(),info,data)
|
#define APPL_BASE(info,data) ELOG_BASE(appl::getLogId(),info,data)
|
||||||
|
|
||||||
|
#define APPL_PRINT(data) APPL_BASE(-1, data)
|
||||||
#define APPL_CRITICAL(data) APPL_BASE(1, data)
|
#define APPL_CRITICAL(data) APPL_BASE(1, data)
|
||||||
#define APPL_ERROR(data) APPL_BASE(2, data)
|
#define APPL_ERROR(data) APPL_BASE(2, data)
|
||||||
#define APPL_WARNING(data) APPL_BASE(3, data)
|
#define APPL_WARNING(data) APPL_BASE(3, data)
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <appl/ctags/readtags.hpp>
|
#include <appl/ctags/readtags.hpp>
|
||||||
#include <appl/globalMsg.hpp>
|
#include <appl/globalMsg.hpp>
|
||||||
#include <appl/TextPluginCtags.hpp>
|
#include <appl/TextPluginCtags.hpp>
|
||||||
|
#include <appl/debug.hpp>
|
||||||
|
|
||||||
class MainApplication : public ewol::context::Application {
|
class MainApplication : public ewol::context::Application {
|
||||||
private:
|
private:
|
||||||
@ -38,8 +39,8 @@ class MainApplication : public ewol::context::Application {
|
|||||||
etk::String tmpppp = _context.getCmd().get(iii);
|
etk::String tmpppp = _context.getCmd().get(iii);
|
||||||
if ( tmpppp == "-h"
|
if ( tmpppp == "-h"
|
||||||
|| tmpppp == "--help") {
|
|| tmpppp == "--help") {
|
||||||
APPL_INFO(" --ctags=xxx c-flags-file-name" );
|
APPL_PRINT(" --ctags=xxx c-flags-file-name" );
|
||||||
APPL_INFO(" -h/--help display this help" );
|
APPL_PRINT(" -h/--help display this help" );
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,42 @@ void appl::widget::BufferTree::populateNodeIfNeeded(ememory::SharedPtr<etk::Tree
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_node->haveChild() == true) {
|
if (_node->haveChild() == true) {
|
||||||
// already populated...
|
// already populated... ==> updat list of elements: ...
|
||||||
|
etk::Vector<etk::Path> child = etk::path::list(value.m_path, etk::path::LIST_FOLDER|etk::path::LIST_FILE);
|
||||||
|
etk::algorithm::quickSort(child, localSort);
|
||||||
|
APPL_VERBOSE(" nbChilds: " << child.size() << " for path: " << value.m_path);
|
||||||
|
// Add missing element (at the end ...)
|
||||||
|
for (auto& it: child) {
|
||||||
|
bool find = false;
|
||||||
|
for (auto &nodeIt: _node->getChilds()) {
|
||||||
|
if (nodeIt->getData().m_path == it) {
|
||||||
|
find = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (find == false) {
|
||||||
|
auto elem = etk::TreeNode<appl::TreeElement>::create(TreeElement(it, false));
|
||||||
|
_node->addChild(elem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// remove destroyed elements:
|
||||||
|
|
||||||
|
size_t iii = 0;
|
||||||
|
while (iii < _node->getChilds().size()) {
|
||||||
|
auto node = _node->getChilds()[iii];
|
||||||
|
bool find = false;
|
||||||
|
for (auto& it: child) {
|
||||||
|
if (node->getData().m_path == it) {
|
||||||
|
find = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (find == false) {
|
||||||
|
_node->rmChild(node);
|
||||||
|
} else {
|
||||||
|
++iii;
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
etk::Vector<etk::Path> child = etk::path::list(value.m_path, etk::path::LIST_FOLDER|etk::path::LIST_FILE);
|
etk::Vector<etk::Path> child = etk::path::list(value.m_path, etk::path::LIST_FOLDER|etk::path::LIST_FILE);
|
||||||
@ -112,7 +147,6 @@ void appl::widget::BufferTree::populateNodeIfNeeded(ememory::SharedPtr<etk::Tree
|
|||||||
APPL_VERBOSE("add element: " << it);
|
APPL_VERBOSE("add element: " << it);
|
||||||
auto elem = etk::TreeNode<appl::TreeElement>::create(TreeElement(it, false));
|
auto elem = etk::TreeNode<appl::TreeElement>::create(TreeElement(it, false));
|
||||||
_node->addChild(elem);
|
_node->addChild(elem);
|
||||||
// TODO: ETK_FREE(etk::FSNode, it);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user