Skip to content

Commit

Permalink
fix project folder in autosave-recovered session
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Jun 1, 2024
1 parent 1309d54 commit 40f9afa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,7 @@ bool MainWindow::open(QString url, const Mlt::Properties *properties, bool play,
if (info.isRelative()) {
QDir pwd(QDir::currentPath());
url = pwd.filePath(url);
info.setFile(url);
}
if (url.endsWith(".mlt") || url.endsWith(".xml")) {
if (url != untitledFileName()) {
Expand Down Expand Up @@ -1764,6 +1765,12 @@ bool MainWindow::open(QString url, const Mlt::Properties *properties, bool play,

setAudioChannels(MLT.audioChannels());
if (url.endsWith(".mlt") || url.endsWith(".xml")) {
if (MLT.producer()->get_int(kShotcutProjectFolder)) {
MLT.setProjectFolder(info.absolutePath());
ProxyManager::removePending();
} else {
MLT.setProjectFolder(QString());
}
setVideoModeMenu();
m_notesDock->setText(MLT.producer()->get(kShotcutProjectNote));
}
Expand Down
9 changes: 1 addition & 8 deletions src/mltcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,12 @@ int Controller::open(const QString &url, const QString &urlToSave, bool skipConv
}
updatePreviewProfile();
setPreviewScale(Settings.playerPreviewScale());
if ( url.endsWith(".mlt") ) {
if (url.endsWith(".mlt")) {
// Load the number of audio channels being used when this project was created.
int channels = newProducer->get_int(kShotcutProjectAudioChannels);
if (!channels)
channels = 2;
m_audioChannels = channels;
if (newProducer->get_int(kShotcutProjectFolder)) {
QFileInfo info(url);
setProjectFolder(info.absolutePath());
ProxyManager::removePending();
} else {
setProjectFolder(QString());
}
}
if (Util::isFpsDifferent(profile().fps(), fps) || (Settings.playerGPU()
&& !profile().is_explicit())) {
Expand Down

0 comments on commit 40f9afa

Please sign in to comment.