Skip to content

Commit 2e662c6

Browse files
committed
Fix files necessary for the demo not always properly copied
1 parent 9b9ccde commit 2e662c6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/database.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ using namespace cv;
4040
Database::Database() {
4141
db = QSqlDatabase::addDatabase("QSQLITE");
4242
QString dbLocation = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
43+
QDir().mkpath(dbLocation);
4344
url = QUrl(dbLocation + "/figures.db");
4445
}
4546

src/demodialog.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ void DemoDialog::on_openDocumentButton_clicked() {
3030
QUrl bubbleUrl = QUrl(dir.filePath("bubble.html"));
3131
QUrl dbUrl = db->getUrl();
3232

33-
Q_ASSERT_X(QFile::copy(":/demo/paper.pdf", paperUrl.toString()), "File copy", "Could not copy paper.pdf");
34-
Q_ASSERT_X(QFile::copy(":/demo/bubble.html", bubbleUrl.toString()), "File copy", "Could not copy bubble.html");
35-
Q_ASSERT_X(QFile::copy(":/demo/figures.db", dbUrl.toString()), "File copy", "Could not copy figures.db");
33+
QFile::copy(":/demo/paper.pdf", paperUrl.toString());
34+
QFile::copy(":/demo/bubble.html", bubbleUrl.toString());
35+
QFile::copy(":/demo/figures.db", dbUrl.toString());
36+
3637
QFile::setPermissions(dbUrl.toString(), QFileDevice::ReadOwner|QFileDevice::WriteOwner);
3738

3839
db->load();

0 commit comments

Comments
 (0)