diff --git a/io/loadthread.cpp b/io/loadthread.cpp index 5fa67ac85..b7688a1a6 100644 --- a/io/loadthread.cpp +++ b/io/loadthread.cpp @@ -35,7 +35,7 @@ LoadThread::LoadThread(LoadDialog* l, bool a) : ld(l), autorecovery(a), cancelle connect(this, SIGNAL(start_create_effect_ui(QXmlStreamReader*, Clip*, int, const EffectMeta*, long, bool)), this, SLOT(create_effect_ui(QXmlStreamReader*, Clip*, int, const EffectMeta*, long, bool))); } -const EffectMeta* get_meta_from_name(const QString& name, int type) { +const EffectMeta* get_meta_from_name(const QString& name) { for (int j=0;jtrack < 0) ? EFFECT_TYPE_VIDEO : EFFECT_TYPE_AUDIO); + meta = get_meta_from_name(effect_name); } effects_loaded.unlock(); @@ -236,7 +236,7 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) { dout << "[INFO] Matched" << attr.value().toString() << "relative to project's internal directory"; } else if (m->url.contains('%')) { // hack for image sequences (qt won't be able to find the URL with %, but ffmpeg may) - m->url = proj_dir_test; + m->url = internal_proj_dir_test; dout << "[INFO] Guess image sequence" << attr.value().toString() << "path to project's current directory"; } else { dout << "[INFO] Failed to match" << attr.value().toString() << "to file"; @@ -486,7 +486,7 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) { primary = secondary; secondary = NULL; } - const EffectMeta* meta = get_meta_from_name(td.name, (primary->track < 0) ? EFFECT_TYPE_VIDEO : EFFECT_TYPE_AUDIO); + const EffectMeta* meta = get_meta_from_name(td.name); if (meta == NULL) { dout << "[WARNING] Failed to link transition with name:" << td.name; if (td.otc != NULL) td.otc->opening_transition = -1; diff --git a/mainwindow.cpp b/mainwindow.cpp index 43a9d7cbe..738e7c9b6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -171,19 +171,7 @@ MainWindow::MainWindow(QWidget *parent) : } } if (deleted_ars > 0) dout << "[INFO] Deleted" << deleted_ars << "preview" << ((deleted_ars == 1) ? "file that was" : "files that were") << "last read over 30 days ago"; - } - - // detect auto-recovery file - autorecovery_filename = data_dir + "/autorecovery.ove"; - if (QFile::exists(autorecovery_filename)) { - if (QMessageBox::question(NULL, "Auto-recovery", "Olive didn't close properly and an autorecovery file was detected. Would you like to open it?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { - updateTitle(autorecovery_filename); - panel_project->load_project(true); - } } - autorecovery_timer.setInterval(60000); - QObject::connect(&autorecovery_timer, SIGNAL(timeout()), this, SLOT(autorecover_interval())); - autorecovery_timer.start(); // search for open recents list recent_proj_file = data_dir + "/recents"; @@ -213,6 +201,20 @@ MainWindow::MainWindow(QWidget *parent) : panel_effect_controls = new EffectControls(this); panel_timeline = new Timeline(this); + if (!data_dir.isEmpty()) { + // detect auto-recovery file + autorecovery_filename = data_dir + "/autorecovery.ove"; + if (QFile::exists(autorecovery_filename)) { + if (QMessageBox::question(NULL, "Auto-recovery", "Olive didn't close properly and an autorecovery file was detected. Would you like to open it?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { + updateTitle(autorecovery_filename); + panel_project->load_project(true); + } + } + autorecovery_timer.setInterval(60000); + QObject::connect(&autorecovery_timer, SIGNAL(timeout()), this, SLOT(autorecover_interval())); + autorecovery_timer.start(); + } + setup_layout(false); init_audio(); diff --git a/panels/timeline.cpp b/panels/timeline.cpp index 33fd1c9b9..9b61aa6d8 100644 --- a/panels/timeline.cpp +++ b/panels/timeline.cpp @@ -453,8 +453,6 @@ void Timeline::repaint_timeline() { ui->audio_area->update(); if (sequence != NULL) { - long sequenceEndFrame = sequence->getEndFrame(); - set_sb_max(); if (last_frame != sequence->playhead) { diff --git a/playback/playback.cpp b/playback/playback.cpp index 13e71bac7..1448e312a 100644 --- a/playback/playback.cpp +++ b/playback/playback.cpp @@ -330,7 +330,7 @@ bool is_clip_active(Clip* c, long playhead) { } void set_sequence(Sequence* s) { - closeActiveClips(sequence, true); + closeActiveClips(sequence, true); panel_effect_controls->clear_effects(true); sequence = s; panel_sequence_viewer->set_main_sequence();