mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-05 07:54:14 +00:00
require db on browser construct
This commit is contained in:
parent
c477c70c56
commit
4b2fe64b08
@ -4,7 +4,8 @@
|
||||
using namespace app;
|
||||
|
||||
Browser::Browser(
|
||||
const Glib::RefPtr<Gtk::Application> & app
|
||||
const Glib::RefPtr<Gtk::Application> & app,
|
||||
const lib::Database & db
|
||||
) {
|
||||
set_title(
|
||||
TITLE
|
||||
|
@ -4,6 +4,11 @@
|
||||
#include <glibmm/i18n.h>
|
||||
#include <gtkmm/applicationwindow.h>
|
||||
|
||||
namespace lib
|
||||
{
|
||||
class Database;
|
||||
}
|
||||
|
||||
namespace app
|
||||
{
|
||||
class Browser : public Gtk::ApplicationWindow
|
||||
@ -15,7 +20,8 @@ namespace app
|
||||
const int HEIGHT = 480;
|
||||
|
||||
Browser(
|
||||
const Glib::RefPtr<Gtk::Application> & app
|
||||
const Glib::RefPtr<Gtk::Application> & app,
|
||||
const lib::Database & db
|
||||
);
|
||||
|
||||
void debug();
|
||||
|
13
src/main.cpp
13
src/main.cpp
@ -6,11 +6,6 @@ int main(
|
||||
int argc,
|
||||
char * argv[]
|
||||
) {
|
||||
// Init profile
|
||||
auto database = lib::Database(
|
||||
"database.sqlite3"
|
||||
);
|
||||
|
||||
// Init app
|
||||
auto app = Gtk::Application::create(
|
||||
"io.github.yggverse.Yoda"
|
||||
@ -31,10 +26,16 @@ int main(
|
||||
"<Primary>q"
|
||||
);
|
||||
|
||||
// Init profile
|
||||
auto db = lib::Database(
|
||||
"database.sqlite3"
|
||||
);
|
||||
|
||||
// Launch browser component
|
||||
return app->make_window_and_run<app::Browser>(
|
||||
argc,
|
||||
argv,
|
||||
app
|
||||
app,
|
||||
db
|
||||
);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user