Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //store the paths you iterate
- std::vector<QString> paths;
- paths.emplace_back("first path");
- paths.emplace_back("second path");
- if(input_path == "cd"){
- QDir new_path(paths.back());
- new_path.cd();
- paths.emplace_back(new_path.absolutePath());
- }
- //back to previous path, stl split back and pop_back to two actions for the sake of exception safe
- auto const path = paths.back();
- paths.pop_back();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement