From 784d127a6ec6adf0fac2d8eadf34dc63111619bf Mon Sep 17 00:00:00 2001 From: xawotihs Date: Wed, 30 Oct 2013 22:28:09 +0100 Subject: [PATCH] I think I got it ... messy / not appearing at the end of folders in the travis linux where it appears fine on mine :( --- projects/mtg/src/MTGDeck.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/projects/mtg/src/MTGDeck.cpp b/projects/mtg/src/MTGDeck.cpp index e441f2ea1..c3a5ed55b 100644 --- a/projects/mtg/src/MTGDeck.cpp +++ b/projects/mtg/src/MTGDeck.cpp @@ -336,8 +336,18 @@ void MTGAllCards::init() initCounters(); } -void MTGAllCards::loadFolder(const string& folder, const string& filename ) +void MTGAllCards::loadFolder(const string& infolder, const string& filename ) { + string folder = infolder; + + // Make sure the base paths finish with a '/' or a '\' + if (! folder.empty()) { + string::iterator c = folder.end();//userPath.at(userPath.size()-1); + c--; + if ((*c != '/') && (*c != '\\')) + folder += '/'; + } + vector files = JFileSystem::GetInstance()->scanfolder(folder); if (!files.size()) @@ -355,7 +365,7 @@ void MTGAllCards::loadFolder(const string& folder, const string& filename ) continue; if(JFileSystem::GetInstance()->DirExists(afile)) - loadFolder(string(afile).c_str(), filename); + loadFolder(afile, filename); if (!JFileSystem::GetInstance()->FileExists(afile)) continue;