mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-12 13:41:34 +00:00
drop SQLiteCpp dependency
This commit is contained in:
parent
6c2dc8c4ac
commit
dfcc131ce2
@ -16,8 +16,7 @@ apt install git\
|
||||
libglibmm-2.68-dev\
|
||||
libgtkmm-4.0-dev\
|
||||
libpangomm-2.48-dev\
|
||||
libsqlite3-dev\
|
||||
libsqlitecpp-dev
|
||||
libsqlite3-dev
|
||||
```
|
||||
|
||||
* `git clone https://github.com/YGGverse/Yoda.git`
|
||||
@ -68,5 +67,4 @@ pkg-config --cflags --libs gio-2.0\
|
||||
|
||||
* [GTK](https://gtk.org) - free and open-source cross-platform widget toolkit
|
||||
* [gtkmm](https://gtkmm.org) - official C++ interface for GTK
|
||||
* [SQLite](https://sqlite.org) - profile database
|
||||
* [SQLiteCpp](https://github.com/SRombauts/SQLiteCpp) - SQLite3 C++ wrapper
|
||||
* [SQLite](https://sqlite.org) - profile database
|
@ -6,9 +6,11 @@ int main(
|
||||
char * argv[]
|
||||
) {
|
||||
// Init database
|
||||
SQLite::Database db(
|
||||
sqlite3 * db;
|
||||
|
||||
sqlite3_open(
|
||||
"database.sqlite3",
|
||||
SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE
|
||||
&db
|
||||
);
|
||||
|
||||
// Init application
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <glibmm/refptr.h>
|
||||
#include <gtkmm/application.h>
|
||||
#include <SQLiteCpp/SQLiteCpp.h>
|
||||
#include <sqlite3.h>
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
|
@ -5,7 +5,7 @@
|
||||
using namespace app;
|
||||
|
||||
Browser::Browser(
|
||||
SQLite::Database & db,
|
||||
sqlite3 * db,
|
||||
const Glib::RefPtr<Gtk::Application> & APP
|
||||
) {
|
||||
// Init window actions
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <gtkmm/application.h>
|
||||
#include <gtkmm/applicationwindow.h>
|
||||
#include <gtkmm/object.h>
|
||||
#include <SQLiteCpp/SQLiteCpp.h>
|
||||
#include <sqlite3.h>
|
||||
|
||||
namespace lib
|
||||
{
|
||||
@ -35,7 +35,7 @@ namespace app
|
||||
public:
|
||||
|
||||
Browser(
|
||||
SQLite::Database & db,
|
||||
sqlite3 * db,
|
||||
const Glib::RefPtr<Gtk::Application> & APP
|
||||
);
|
||||
};
|
||||
|
@ -4,7 +4,7 @@
|
||||
using namespace app::browser;
|
||||
|
||||
Main::Main(
|
||||
SQLite::Database & db,
|
||||
sqlite3 * db,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ACTIVE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL,
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <glibmm/ustring.h>
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/object.h>
|
||||
#include <SQLiteCpp/SQLiteCpp.h>
|
||||
#include <sqlite3.h>
|
||||
|
||||
namespace app::browser
|
||||
{
|
||||
@ -27,7 +27,7 @@ namespace app::browser
|
||||
public:
|
||||
|
||||
Main(
|
||||
SQLite::Database & db,
|
||||
sqlite3 * db,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ACTIVE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL,
|
||||
|
@ -5,7 +5,7 @@
|
||||
using namespace app::browser::main;
|
||||
|
||||
Tab::Tab(
|
||||
SQLite::Database & db,
|
||||
sqlite3 * db,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ACTIVE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL,
|
||||
@ -14,7 +14,10 @@ Tab::Tab(
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_UPDATE
|
||||
) {
|
||||
// Init database
|
||||
db.exec(
|
||||
char * errmsg;
|
||||
|
||||
::sqlite3_exec(
|
||||
db,
|
||||
R"SQL(
|
||||
CREATE TABLE IF NOT EXISTS `app_browser_main_tab`
|
||||
(
|
||||
@ -22,7 +25,10 @@ Tab::Tab(
|
||||
`time` INTEGER NOT NULL,
|
||||
`request` VARCHAR(1024)
|
||||
)
|
||||
)SQL"
|
||||
)SQL",
|
||||
nullptr,
|
||||
nullptr,
|
||||
&errmsg
|
||||
);
|
||||
|
||||
// Init actions
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <glibmm/refptr.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#include <gtkmm/notebook.h>
|
||||
#include <SQLiteCpp/SQLiteCpp.h>
|
||||
#include <sqlite3.h>
|
||||
|
||||
namespace app::browser::main
|
||||
{
|
||||
@ -42,7 +42,7 @@ namespace app::browser::main
|
||||
public:
|
||||
|
||||
Tab(
|
||||
SQLite::Database & db,
|
||||
sqlite3 * db,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_CLOSE_ACTIVE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL,
|
||||
|
Loading…
x
Reference in New Issue
Block a user