Change html export path
This commit is contained in:
parent
2018375062
commit
37276b5d90
@ -21,6 +21,7 @@
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
|
||||
int MainWindow::indexPath = 0;
|
||||
|
||||
@ -198,10 +199,12 @@ void MainWindow::exportHTMLMap(int index)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
QDir dir;
|
||||
dir.mkdir("./data/HTML-exports");
|
||||
dir.mkdir("./data/HTML-exports/pages");
|
||||
|
||||
QString safeName = p->getName().simplified().replace(" ", "_");
|
||||
std::string fileName = "./pages/parcours_" + safeName.toStdString() + ".html";
|
||||
std::string fileName = "./data/HTML-exports/pages/parcours_" + safeName.toStdString() + ".html";
|
||||
std::ofstream file(fileName);
|
||||
|
||||
if (!file.is_open()) {
|
||||
@ -331,10 +334,10 @@ margin-bottom:20px;
|
||||
QString imagePath = p->getImage();
|
||||
QFileInfo fileInfo(imagePath);
|
||||
QString imageName = fileInfo.fileName();
|
||||
QString destPath = "./pages/images/" + imageName;
|
||||
QString destPath = "../data/HTML-exports/pages/images/" + imageName;
|
||||
|
||||
// Crée le dossier images s’il n’existe pas
|
||||
QDir().mkpath("./pages/images");
|
||||
QDir().mkpath("./data/HTML-exports/pages/images");
|
||||
|
||||
// Copie l’image dans le dossier pages/images
|
||||
QFile::copy(imagePath, destPath);
|
||||
@ -1056,7 +1059,7 @@ void MainWindow::on_actionExit_triggered() { QApplication::quit(); }
|
||||
|
||||
|
||||
void MainWindow::openIndexSite() {
|
||||
QString filePath = "index.html";
|
||||
QString filePath = "./data/HTML-exports/index.html";
|
||||
QFileInfo fileInfo(filePath);
|
||||
|
||||
if (fileInfo.exists() && fileInfo.isFile()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user