| 2392 | } |
| 2393 | |
| 2394 | void |
| 2395 | FavoriteView::selectUrl(const QUrl &url) |
| 2396 | { |
| 2397 | disconnect( selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), |
| 2398 | this, SLOT(clicked(QModelIndex)) ); |
| 2399 | |
| 2400 | selectionModel()->clear(); |
| 2401 | |
| 2402 | QString urlPath = QtCompat::toLocalFileUrlFixed(url).toLocalFile(); |
| 2403 | |
| 2404 | for (int i = 0; i < model()->rowCount(); ++i) { |
| 2405 | QUrl otherUrl = model()->index(i, 0).data(UrlModel::UrlRole).toUrl(); |
| 2406 | QString otherUrlPath = QtCompat::toLocalFileUrlFixed(otherUrl).toLocalFile(); |
| 2407 | |
| 2408 | if (otherUrlPath == urlPath) { |
| 2409 | selectionModel()->select(model()->index(i, 0), QItemSelectionModel::Select); |
| 2410 | break; |
| 2411 | } |
| 2412 | } |
| 2413 | |
| 2414 | connect( selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), |
| 2415 | this, SLOT(clicked(QModelIndex)) ); |
| 2416 | } |
| 2417 | |
| 2418 | void |
| 2419 | FavoriteView::removeEntry() |
no test coverage detected