diff --git a/databasewindow.cpp b/databasewindow.cpp index 6df5615..45136e1 100644 --- a/databasewindow.cpp +++ b/databasewindow.cpp @@ -1,10 +1,9 @@ -#include #include #include #include #include #include -#include +#include #include "databasewindow.hpp" #include "filesystem.hpp" @@ -47,9 +46,6 @@ DatabaseWindow::DatabaseWindow( bool _linux, auto *button_remove = new Gtk::Button(); auto *button_quit = new Gtk::Button(); - scrolled_window->set_size_request( 550, 300 ); - scrolled_window->add( *m_tree_database ); - // pack boxes box->pack_start( *scrolled_window, Gtk::PACK_EXPAND_WIDGET ); box->pack_start( *buttons, Gtk::PACK_SHRINK ); @@ -62,11 +58,13 @@ DatabaseWindow::DatabaseWindow( bool _linux, buttons->set_margin_top( 5 ); buttons->set_margin_bottom( 5 ); + scrolled_window->add( *m_tree_database ); + buttons->pack_start( *button_save, Gtk::PACK_SHRINK ); buttons->pack_start( *button_remove, Gtk::PACK_SHRINK ); buttons->pack_end( *button_quit, Gtk::PACK_SHRINK ); - button_save->set_margin_right(5); + button_save->set_margin_right( 5 ); // set button texts button_save->set_label( "Save" ); @@ -120,7 +118,6 @@ DatabaseWindow::DatabaseWindow( bool _linux, void DatabaseWindow::save() { if ( changed_rows.size() == 0 ) return; - std::cout << "Starting for" << std::endl; for ( auto &x : m_model->children() ) { auto index = static_cast< size_t >( x[m_columns_database.m_col_id] ); if ( changed_rows.find( index ) != changed_rows.end() ) { @@ -132,8 +129,6 @@ void DatabaseWindow::save() { std::transform( dvd_string.begin(), dvd_string.end(), dvd_string.begin(), ::tolower ); bool dvd = dvd_string == "yes"; - std::cout << index << " " << path << " " << lang << " " << show_id - << " " << dvd_string << std::endl; changeDB( index, path, lang, show_id, dvd ); } } @@ -141,7 +136,7 @@ void DatabaseWindow::save() { auto *pw = new ProgressWindow; app->add_window( *pw ); - t = std::thread( refreshSelectDB, changed_rows, linux, pw ); + std::thread t = std::thread( refreshSelectDB, changed_rows, linux, pw ); t.detach(); // lambda capture @@ -159,9 +154,6 @@ void DatabaseWindow::save() { void DatabaseWindow::remove() { auto selected = m_tree_database->get_selection()->get_selected(); - std::cout << static_cast< size_t >( - ( *selected )[m_columns_database.m_col_id] ) - << std::endl; removeFromDB( static_cast< std::string >( ( *selected )[m_columns_database.m_col_path] ) ); m_model->erase( selected ); diff --git a/databasewindow.hpp b/databasewindow.hpp index c7b296e..30802d6 100644 --- a/databasewindow.hpp +++ b/databasewindow.hpp @@ -4,11 +4,8 @@ #include #include #include -#include #include -#include "network.hpp" - class DatabaseWindow : public Gtk::Window { public: DatabaseWindow() = delete; @@ -54,7 +51,6 @@ protected: bool linux; Glib::RefPtr< Gtk::Application > app; - std::thread t; }; #endif // GTKMM_MAIN_WINDOW