Save absolute path of the snapshot filename.
Otherwise if one starts qapple with --load-state with a relative path it does not work (as we have cd'ed to allow loading disks). Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
b7fb13576f
commit
9afb9c631f
1 changed files with 7 additions and 2 deletions
|
@ -477,7 +477,7 @@ void QApple::on_actionLoad_state_triggered()
|
|||
const std::string & filename = Snapshot_GetFilename();
|
||||
|
||||
const QFileInfo file(QString::fromStdString(filename));
|
||||
const QString path = file.absoluteDir().canonicalPath();
|
||||
const QString path = file.absolutePath();
|
||||
// this is useful as snapshots from the test
|
||||
// have relative disk location
|
||||
SetCurrentImageDir(path.toStdString().c_str());
|
||||
|
@ -582,6 +582,11 @@ void QApple::on_actionNext_video_mode_triggered()
|
|||
|
||||
void QApple::loadStateFile(const QString & filename)
|
||||
{
|
||||
Snapshot_SetFilename(filename.toStdString().c_str());
|
||||
const QFileInfo path(filename);
|
||||
// store it as absolute path
|
||||
// use case is:
|
||||
// later, when we change dir to allow loading of disks relative to the yamls file,
|
||||
// a snapshot relative path would be lost
|
||||
Snapshot_SetFilename(path.absoluteFilePath().toStdString().c_str());
|
||||
ui->actionLoad_state->trigger();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue