Qt5: use 'Libc::with_libc()' where needed

Fixes #2282
This commit is contained in:
Christian Prochaska 2017-02-16 19:02:15 +01:00 committed by Christian Helmuth
parent b1a9addeb6
commit 1df4e53cba
2 changed files with 18 additions and 14 deletions

View File

@ -39,13 +39,15 @@ extern char **genode_argv;
void Libc::Component::construct(Libc::Env &env) void Libc::Component::construct(Libc::Env &env)
{ {
QApplication app(genode_argc, genode_argv); Libc::with_libc([&] {
QApplication app(genode_argc, genode_argv);
load_stylesheet(); load_stylesheet();
QMember<Main_window> main_window(env); QMember<Main_window> main_window(env);
main_window->show(); main_window->show();
app.exec(); app.exec();
});
} }

View File

@ -59,20 +59,22 @@ struct Qt_launchpad_namespace::Local_env : Genode::Env
void Libc::Component::construct(Libc::Env &env) void Libc::Component::construct(Libc::Env &env)
{ {
static Qt_launchpad_namespace::Local_env local_env(env); Libc::with_libc([&] {
Qt_launchpad_namespace::Local_env local_env(env);
static QApplication a(genode_argc, genode_argv); QApplication a(genode_argc, genode_argv);
static Qt_launchpad launchpad(local_env, env.ram().avail()); Qt_launchpad launchpad(local_env, env.ram().avail());
static Genode::Attached_rom_dataspace config(env, "config"); Genode::Attached_rom_dataspace config(env, "config");
try { launchpad.process_config(config.xml()); } catch (...) { } try { launchpad.process_config(config.xml()); } catch (...) { }
launchpad.move(300,100); launchpad.move(300,100);
launchpad.show(); launchpad.show();
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
a.exec(); a.exec();
});
} }