Allow base folder to be overridden by reversing the mount paths lookup (#713)
* Allow base folder to be overridden by reversing the mount paths lookup * Improve label communicating how assets work
This commit is contained in:
parent
7e9ad9946b
commit
18412cc930
@ -953,7 +953,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
|
||||
ui_asset_lbl = new QLabel(ui_assets_tab);
|
||||
ui_asset_lbl->setText(
|
||||
tr("Add or remove base folders for use by assets. "
|
||||
"Base folders will be searched in the order provided."));
|
||||
"Base folders on the bottom are prioritized over those above them."));
|
||||
ui_asset_lbl->setWordWrap(true);
|
||||
ui_assets_tab_layout->addWidget(ui_asset_lbl);
|
||||
|
||||
|
@ -267,8 +267,17 @@ QString AOApplication::get_real_path(const VPath &vpath) {
|
||||
|
||||
// Cache miss; try all known mount paths
|
||||
QStringList bases = get_mount_paths();
|
||||
bases.push_front(get_base_path());
|
||||
bases.prepend(get_base_path());
|
||||
// base
|
||||
// content 1
|
||||
// content 2
|
||||
|
||||
// We search last to first
|
||||
std::reverse(bases.begin(), bases.end());
|
||||
|
||||
// content 2
|
||||
// content 1
|
||||
// base
|
||||
for (const QString &base : bases) {
|
||||
QDir baseDir(base);
|
||||
QString path = baseDir.absoluteFilePath(vpath.toQString());
|
||||
|
Loading…
Reference in New Issue
Block a user