diff -r 16f6717a218b -r 80bea7a6e84f src/settingseditor/librarieseditor.cpp --- a/src/settingseditor/librarieseditor.cpp Wed Apr 19 22:42:43 2023 +0300 +++ b/src/settingseditor/librarieseditor.cpp Wed Apr 19 22:51:56 2023 +0300 @@ -63,7 +63,7 @@ tr("The directory %1 cannot be read.").arg(quoted(dir.path())) ); } - model->addLibrary({Library::OfficialLibrary, dir}); + model->addLibrary({library_role_e::official, dir}); this->ui.newLibraryPath->clear(); } } @@ -83,10 +83,10 @@ this, &LibrariesEditor::removeCurrentLibrary); QMenu* roleMenu = new QMenu{tr("Set role"), contextMenu}; - for (const Library::Role role : Library::allRoles) + for (const library_role_e role : all_library_roles) { - QAction* setRoleAction = new QAction{Library::libraryRoleName(role)}; - setRoleAction->setData(role); + QAction* setRoleAction = new QAction{library_role_name(role)}; + setRoleAction->setData(QVariant::fromValue(role)); roleMenu->addAction(setRoleAction); connect( setRoleAction, @@ -121,7 +121,7 @@ const index_t libraryIndex = currentLibraryIndex(); QObject* senderObject = sender(); QAction* senderAction = qobject_cast(senderObject); - const Library::Role role = senderAction->data().value(); + const library_role_e role = senderAction->data().value(); model->setLibraryRole(libraryIndex, role); } }