Compare commits

...

2 Commits

Author SHA1 Message Date
luc-git eec6d22f59
Merge 572d5ee906 into f58f9746d7 2025-01-10 15:13:26 +01:00
luc-git 572d5ee906 Add a button to add dir to the library 2024-02-16 21:12:04 +01:00
2 changed files with 6 additions and 1 deletions

View File

@ -120,6 +120,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)) {