MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / selectUrl

Method selectUrl

Gui/SequenceFileDialog.cpp:2394–2416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2392}
2393
2394void
2395FavoriteView::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
2418void
2419FavoriteView::removeEntry()

Callers 1

pathChangedMethod · 0.80

Calls 6

toLocalFileUrlFixedFunction · 0.85
clearMethod · 0.45
rowCountMethod · 0.45
dataMethod · 0.45
indexMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected