Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void adjust_profile(std::string& profile)
- {
- // Create a temp copy
- std::string temp = profile;
- static const std::string path_adjust = "/transparent";
- const std::string::size_type offset = profile.find_last_of('/', profile.find('~'));
- // If the path already refers to /transparent...
- if(profile.find(path_adjust) && offset != std::string::npos) {
- if(!image::locator(profile).file_exists()) {
- profile.replace(profile.find(path_adjust), path_adjust.length(), "");
- }
- return;
- }
- // else, check for the file with /transparent appended...
- offset != std::string::npos ?
- temp.insert(offset, path_adjust) : temp = path_adjust + temp;
- // and use that path if it exists
- if(image::locator(temp).file_exists()) {
- profile = temp;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment