Commit c8d05f8d authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix tests after last commit

parent 659f2d35
Pipeline #54946 passed with stage
in 10 minutes and 13 seconds
......@@ -71,7 +71,7 @@ Core::~Core()
ClipController::mediaUnavailable.reset();
}
bool Core::build()
bool Core::build(bool testMode)
{
if (m_self) {
return true;
......@@ -91,18 +91,21 @@ bool Core::build()
qRegisterMetaType<QDomElement>("QDomElement");
qRegisterMetaType<requestClipInfo>("requestClipInfo");
// Check if we had a crash
QFile lockFile(QDir::temp().absoluteFilePath(QStringLiteral("kdenlivelock")));
if (lockFile.exists()) {
// a previous instance crashed, propose to delete config files
if (KMessageBox::questionYesNo(QApplication::activeWindow(), i18n("Kdenlive crashed on last startup.\nDo you want to reset the configuration files ?")) == KMessageBox::Yes) {
return false;
if (!testMode) {
// Check if we had a crash
QFile lockFile(QDir::temp().absoluteFilePath(QStringLiteral("kdenlivelock")));
if (lockFile.exists()) {
// a previous instance crashed, propose to delete config files
if (KMessageBox::questionYesNo(QApplication::activeWindow(), i18n("Kdenlive crashed on last startup.\nDo you want to reset the configuration files ?")) == KMessageBox::Yes)
{
return false;
}
} else {
// Create lock file
lockFile.open(QFile::WriteOnly);
lockFile.write(QByteArray());
lockFile.close();
}
} else {
// Create lock file
lockFile.open(QFile::WriteOnly);
lockFile.write(QByteArray());
lockFile.close();
}
m_self->m_projectItemModel = ProjectItemModel::construct();
......
......@@ -80,7 +80,7 @@ public:
* other binaries paths (melt, ffmpeg, etc)
* @param MltPath (optional) path to MLT environment
*/
static bool build();
static bool build(bool testMode = false);
/**
* @brief Init the GUI part of the app and show the main window
......
......@@ -7,8 +7,10 @@
#define private public
#define protected public
#include "core.h"
#include "mltconnection.h"
#include "src/effects/effectsrepository.hpp"
#include "src/mltcontroller/clipcontroller.h"
#include "bin/projectitemmodel.h"
/* This file is intended to remain empty.
Write your tests in a file with a name corresponding to what you're testing */
......@@ -18,8 +20,9 @@ int main(int argc, char *argv[])
app.setApplicationName(QStringLiteral("kdenlive"));
std::unique_ptr<Mlt::Repository> repo(Mlt::Factory::init(nullptr));
qputenv("MLT_TESTS", QByteArray("1"));
Mlt::Factory::init();
Core::build();
Core::build(true);
MltConnection::construct(QString());
pCore->projectItemModel()->buildPlaylist();
// if Kdenlive is not installed, ensure we have one keyframable effect
EffectsRepository::get()->reloadCustom(QFileInfo("../data/effects/audiobalance.xml").absoluteFilePath());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment