mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-14 13:22:23 +08:00
Merge branch 'master' of https://github.com/Almamu/linux-wallpaperengine into data-separation
# Conflicts: # main.cpp Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
commit
db89bf2e17
15
main.cpp
15
main.cpp
@ -89,6 +89,19 @@ void print_help (const char* route)
|
||||
<< " --win <WindowID>\tX Window ID to attach to" << 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 mode = 0;
|
||||
@ -164,6 +177,7 @@ int main (int argc, char* argv[])
|
||||
|
||||
// pkg mode
|
||||
case 1:
|
||||
path = stringPathFixes(path);
|
||||
wallpaper_path = WallpaperEngine::Irrlicht::device->getFileSystem ()->getAbsolutePath (path.c_str ());
|
||||
project_path = wallpaper_path + "project.json";
|
||||
scene_path = wallpaper_path + "scene.pkg";
|
||||
@ -173,6 +187,7 @@ int main (int argc, char* argv[])
|
||||
|
||||
// folder mode
|
||||
case 2:
|
||||
path = stringPathFixes(path);
|
||||
wallpaper_path = WallpaperEngine::Irrlicht::device->getFileSystem ()->getAbsolutePath (path.c_str ());
|
||||
project_path = wallpaper_path + "project.json";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user