116 /** |
116 /** |
117 * @brief Changes the role of the specified library |
117 * @brief Changes the role of the specified library |
118 * @param libraryIndex Index of the library |
118 * @param libraryIndex Index of the library |
119 * @param role New role |
119 * @param role New role |
120 */ |
120 */ |
121 void LibrariesModel::setLibraryRole(index_t libraryIndex, const Library::Role role) |
121 void LibrariesModel::setLibraryRole(index_t libraryIndex, const library_role_e role) |
122 { |
122 { |
123 if (this->isValidIndex(libraryIndex)) |
123 if (this->isValidIndex(libraryIndex)) |
124 { |
124 { |
125 this->libraries[libraryIndex].role = role; |
125 this->libraries[libraryIndex].role = role; |
126 this->signalLibraryChange(libraryIndex); |
126 this->signalLibraryChange(libraryIndex); |
213 /** |
213 /** |
214 * @brief Gets a human-readable string for the specified role |
214 * @brief Gets a human-readable string for the specified role |
215 * @param role Role to get a string for |
215 * @param role Role to get a string for |
216 * @returns string |
216 * @returns string |
217 */ |
217 */ |
218 QString Library::libraryRoleName(const Role role) |
218 QString library_role_name(const library_role_e role) |
219 { |
219 { |
220 switch (role) |
220 switch (role) |
221 { |
221 { |
222 case Library::OfficialLibrary: |
222 case library_role_e::official: |
223 return LibrariesModel::tr("Official library"); |
223 return LibrariesModel::tr("Official library"); |
224 case Library::UnofficialLibrary: |
224 case library_role_e::unofficial: |
225 return LibrariesModel::tr("Unofficial library"); |
225 return LibrariesModel::tr("Unofficial library"); |
226 case Library::WorkingLibrary: |
226 case library_role_e::working: |
227 return LibrariesModel::tr("Working library"); |
227 return LibrariesModel::tr("Working library"); |
228 } |
228 } |
229 return "???"; |
229 return "???"; |
230 } |
230 } |
231 |
231 |