MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / updateButtons

Method updateButtons

src/gui/UBFeaturesActionBar.cpp:137–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137void UBFeaturesActionBar::updateButtons(UBFeature feature)
138{
139 if (!feature.isFolder())
140 {
141 QString featureFullPath = feature.getFullPath().toString();
142 if (featureFullPath.endsWith(".rdf"))
143 {
144 QString documentFoldername = featureFullPath.section('/', -2, -2); //section before "/metadata.rdf" is documentFolderName
145 if (featuresController->isDocumentInFavoriteList(documentFoldername))
146 {
147 mpRemoveFromFavoritesBtn->show();
148 mpAddToFavoritesBtn->hide();
149 }
150 else
151 {
152 mpAddToFavoritesBtn->show();
153 mpRemoveFromFavoritesBtn->hide();
154 }
155 }
156 else
157 {
158 if (featuresController->isInFavoriteList(feature.getFullPath()))
159 {
160 mpRemoveFromFavoritesBtn->show();
161 mpAddToFavoritesBtn->hide();
162 }
163 else
164 {
165 mpAddToFavoritesBtn->show();
166 mpRemoveFromFavoritesBtn->hide();
167 }
168 }
169 }
170 else
171 {
172 mpAddToFavoritesBtn->hide();
173 mpRemoveFromFavoritesBtn->hide();
174 }
175}
176
177void UBFeaturesActionBar::setButtons()
178{

Callers 1

currentSelectedMethod · 0.45

Calls 6

isFolderMethod · 0.80
getFullPathMethod · 0.80
showMethod · 0.45
hideMethod · 0.45
isInFavoriteListMethod · 0.45

Tested by

no test coverage detected