Browse Source

Fixed error message when trying to open a file within a non-existing folder

merge-requests/365/head
eidheim 10 years ago
parent
commit
4221f1eebb
  1. 6
      src/juci.cc
  2. 1
      src/juci.h

6
src/juci.cc

@ -32,7 +32,7 @@ int Application::on_command_line(const Glib::RefPtr<Gio::ApplicationCommandLine>
files.emplace_back(new_p); files.emplace_back(new_p);
} }
else else
Terminal::get().print("Error: folder path "+parent_p.string()+" does not exist.\n", true); errors.emplace_back("Error: folder path "+parent_p.string()+" does not exist.\n");
} }
} }
} }
@ -66,8 +66,12 @@ void Application::on_activate() {
another_juci_app.detach(); another_juci_app.detach();
} }
} }
for(auto &file: files) for(auto &file: files)
Window::get().notebook.open(file); Window::get().notebook.open(file);
for(auto &error: errors)
Terminal::get().print(error, true);
} }
void Application::on_startup() { void Application::on_startup() {

1
src/juci.h

@ -13,6 +13,7 @@ public:
private: private:
std::vector<boost::filesystem::path> directories; std::vector<boost::filesystem::path> directories;
std::vector<boost::filesystem::path> files; std::vector<boost::filesystem::path> files;
std::vector<std::string> errors;
}; };
#endif // JUCI_JUCI_H_ #endif // JUCI_JUCI_H_

Loading…
Cancel
Save