src/settingseditor/librarieseditor.cpp

changeset 381
80bea7a6e84f
parent 300
3a4b132b8353
--- 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<QAction*>(senderObject);
-		const Library::Role role = senderAction->data().value<Library::Role>();
+		const library_role_e role = senderAction->data().value<library_role_e>();
 		model->setLibraryRole(libraryIndex, role);
 	}
 }

mercurial