Add a button to add dir to the library

This commit is contained in:
luc-git 2024-02-16 21:12:04 +01:00
parent 398df56ac9
commit 572d5ee906
2 changed files with 6 additions and 1 deletions

View File

@ -116,6 +116,10 @@ Window::Window(CoreManager* manager, ConfigController* config, int playerId, QWi
i = m_savedScale;
}
#ifdef USE_SQLITE3
QPushButton* m_AddDirText = new QPushButton("Click to add a directory to the library", this);
m_AddDirText->connect(m_AddDirText, &QPushButton::clicked, [this] { addDirToLibrary();
});
m_AddDirText->setFixedSize(150 ,50);
m_libraryView = new LibraryController(nullptr, ConfigController::configDir() + "/library.sqlite3", m_config);
ConfigOption* showLibrary = m_config->addOption("showLibrary");
showLibrary->connect([this](const QVariant& value) {

View File

@ -155,7 +155,8 @@ void LibraryController::refresh() {
mLibraryListing listing;
mLibraryListingInit(&listing, 0);
mLibraryGetEntries(m_library.get(), &listing, 0, 0, nullptr);
size_t entries = mLibraryGetEntries(m_library.get(), &listing, 0, 0, nullptr);
setVisible(!entries == 0);
for (size_t i = 0; i < mLibraryListingSize(&listing); i++) {
LibraryEntry entry = mLibraryListingGetConstPointer(&listing, i);
if (!m_entries.contains(entry.fullpath)) {