Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. //store the paths you iterate
  2. std::vector<QString> paths;
  3. paths.emplace_back("first path");
  4. paths.emplace_back("second path");
  5. if(input_path == "cd"){
  6. QDir new_path(paths.back());
  7. new_path.cd();
  8. paths.emplace_back(new_path.absolutePath());
  9. }
  10.  
  11. //back to previous path, stl split back and pop_back to two actions for the sake of exception safe
  12. auto const path = paths.back();
  13. paths.pop_back();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement