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