Merge branch 'master' of github.com:Almamu/linux-wallpaperengine

This commit is contained in:
Alexis Maiquez 2019-09-04 22:08:49 +02:00
commit be68fe209f

View File

@ -142,6 +142,19 @@ void print_help (const char* route)
<< " --screen-root <screen name>\tDisplay as screen's background" << std::endl; << " --screen-root <screen name>\tDisplay as screen's background" << std::endl;
} }
std::string stringPathFixes(const std::string& s){
std::string str(s);
if(str.empty())
return s;
if(str[0] == '\'' && str[str.size() - 1] == '\''){
str.erase(str.size() - 1, 1);
str.erase(0,1);
}
if(str[str.size() - 1] != '/')
str += '/';
return std::move(str);
}
int main (int argc, char* argv[]) int main (int argc, char* argv[])
{ {
int mode = 0; int mode = 0;
@ -215,6 +228,7 @@ int main (int argc, char* argv[])
// pkg mode // pkg mode
case 1: case 1:
path = stringPathFixes(path);
wallpaper_path = wp::irrlicht::device->getFileSystem ()->getAbsolutePath (path.c_str ()); wallpaper_path = wp::irrlicht::device->getFileSystem ()->getAbsolutePath (path.c_str ());
project_path = wallpaper_path + "project.json"; project_path = wallpaper_path + "project.json";
scene_path = wallpaper_path + "scene.pkg"; scene_path = wallpaper_path + "scene.pkg";
@ -224,6 +238,7 @@ int main (int argc, char* argv[])
// folder mode // folder mode
case 2: case 2:
path = stringPathFixes(path);
wallpaper_path = wp::irrlicht::device->getFileSystem ()->getAbsolutePath (path.c_str ()); wallpaper_path = wp::irrlicht::device->getFileSystem ()->getAbsolutePath (path.c_str ());
project_path = wallpaper_path + "project.json"; project_path = wallpaper_path + "project.json";