fix Asset::list_files

This commit is contained in:
2019-03-01 20:36:28 +01:00
parent a14afe5b44
commit 9f1ac3730f
7 changed files with 9 additions and 8 deletions

View File

@@ -74,7 +74,7 @@ void App::cloud_upload()
void App::cloud_upload_all()
{
std::thread([this] {
auto names = Asset::list_files(data_path, false, ".*\\.ppi");
auto names = Asset::list_files(data_path, ".*\\.ppi");
gl_state gl;
std::shared_ptr<NodeProgressBar> pb;

View File

@@ -37,8 +37,9 @@ bool Asset::exist(std::string path)
return false; // useless return for the stupid xcode
}
std::vector<std::string> Asset::list_files(std::string folder, bool is_asset, const std::string& filter_regex)
std::vector<std::string> Asset::list_files(std::string folder, const std::string& filter_regex)
{
bool is_asset = Asset::is_asset(folder);
std::vector<std::string> names;
#ifdef _WIN32
WIN32_FIND_DATAA fd;

View File

@@ -7,7 +7,7 @@ public:
static AAssetManager* m_am;
AAsset* m_asset = nullptr;
#endif
static std::vector<std::string> list_files(std::string folder, bool is_asset, const std::string& filter_regex);
static std::vector<std::string> list_files(std::string folder, const std::string& filter_regex);
static bool exist(std::string path);
static bool delete_file(const std::string& path);
static std::string absolute(const std::string& path);

View File

@@ -125,7 +125,7 @@ void NodeDialogBrowse::init_list()
std::vector<std::tuple<std::string/*file-name*/, std::string/*path*/>> files;
for (auto sp : search_paths)
{
auto items = Asset::list_files(sp, false, ".*\\.ppi");
auto items = Asset::list_files(sp, ".*\\.ppi");
for (const auto& i : items)
{
files.push_back({i, sp + '/' + i});

View File

@@ -69,7 +69,7 @@ void NodeDialogOpen::init_controls()
root()->update();
};
container = find<Node>("files-list");
auto names = Asset::list_files(App::I.work_path, false, ".*\\.ppi");
auto names = Asset::list_files(App::I.work_path, ".*\\.ppi");
for (const auto& n : names)
{
auto node = new NodeDialogOpenItem;

View File

@@ -147,7 +147,7 @@ void NodePanelBrush::init()
restore();
if (m_container->m_children.empty() && !m_dir_name.empty())
{
auto icons = Asset::list_files("data/" + m_dir_name, true, ".*\\.png$");
auto icons = Asset::list_files("data/" + m_dir_name, ".*\\.png$");
for (auto& i : icons)
{
std::string path = "data/" + m_dir_name + "/thumbs/" + i;
@@ -165,7 +165,7 @@ void NodePanelBrush::init()
brush->on_click = std::bind(&NodePanelBrush::handle_click, this, std::placeholders::_1);
}
auto custom_icons = Asset::list_files(App::I.data_path + "/" + m_dir_name, true, ".*\\.png$");
auto custom_icons = Asset::list_files(App::I.data_path + "/" + m_dir_name, ".*\\.png$");
for (auto& i : custom_icons)
{
std::string path_thumb = App::I.data_path + "/" + m_dir_name + "/thumbs/" + i;

View File

@@ -236,7 +236,7 @@ void NodePanelStroke::init_controls()
m_pattern_popup = std::make_shared<NodePanelBrush>();
m_pattern_popup->m_manager = m_manager;
m_pattern_popup->m_dir_name = "textures";
m_pattern_popup->m_dir_name = "patterns";
m_pattern_popup->init();
m_pattern_popup->create();
m_pattern_popup->loaded();