| 122 | } |
| 123 | |
| 124 | void UBFeaturesWidget::currentSelected(const QModelIndex ¤t) |
| 125 | { |
| 126 | if (!current.isValid()) { |
| 127 | qWarning() << "SLOT:currentSelected, invalid index catched"; |
| 128 | return; |
| 129 | } |
| 130 | |
| 131 | QString objName = sender()->objectName(); |
| 132 | |
| 133 | if (objName.isEmpty()) { |
| 134 | qWarning() << "incorrect sender"; |
| 135 | } else if (objName == objNamePathList) { |
| 136 | //Calling to reset the model for listView. Maybe separate function needed |
| 137 | controller->searchStarted("", centralWidget->listView()); |
| 138 | } |
| 139 | |
| 140 | UBFeature feature = controller->getFeature(current, objName); |
| 141 | |
| 142 | if ( feature.isFolder() ) { |
| 143 | QString newPath = feature.getFullVirtualPath(); |
| 144 | |
| 145 | controller->setCurrentElement(feature); |
| 146 | controller->siftElements(newPath); |
| 147 | |
| 148 | centralWidget->switchTo(UBFeaturesCentralWidget::MainList); |
| 149 | |
| 150 | if ( feature.getType() == FEATURE_FAVORITE ) { |
| 151 | mActionBar->setCurrentState( IN_FAVORITE ); |
| 152 | |
| 153 | } else if ( feature.getType() == FEATURE_CATEGORY && feature.getName() == "root" ) { |
| 154 | mActionBar->setCurrentState( IN_ROOT ); |
| 155 | |
| 156 | } else if (feature.getType() == FEATURE_TRASH) { |
| 157 | mActionBar->setCurrentState(IN_TRASH); |
| 158 | |
| 159 | } else if (feature.getType() == FEATURE_SEARCH) { |
| 160 | //The search feature behavior is not standard. If features list clicked - show empty element |
| 161 | //else show existing saved features search QWebView |
| 162 | if (sender()->objectName() == objNameFeatureList) { |
| 163 | centralWidget->showElement(feature, UBFeaturesCentralWidget::FeaturesWebView); |
| 164 | } else if (sender()->objectName() == objNamePathList) { |
| 165 | centralWidget->switchTo(UBFeaturesCentralWidget::FeaturesWebView); |
| 166 | } |
| 167 | |
| 168 | } else { |
| 169 | mActionBar->setCurrentState(IN_FOLDER); |
| 170 | } |
| 171 | |
| 172 | // } else if (feature.getType() == FEATURE_SEARCH) { |
| 173 | // centralWidget->showElement(feature, UBFeaturesCentralWidget::FeaturesWebView); |
| 174 | |
| 175 | } |
| 176 | else if (UBSettings::settings()->libraryShowDetailsForLocalItems->get().toBool() == true) { |
| 177 | centralWidget->showElement(feature, UBFeaturesCentralWidget::FeaturePropertiesList); |
| 178 | mActionBar->setCurrentState( IN_PROPERTIES ); |
| 179 | } |
| 180 | |
| 181 | mActionBar->updateButtons(feature); |
nothing calls this directly
no test coverage detected