diff --git a/sources/conductornumexport.cpp b/sources/conductornumexport.cpp index 970c1448f..fd5abeb04 100644 --- a/sources/conductornumexport.cpp +++ b/sources/conductornumexport.cpp @@ -44,10 +44,10 @@ ConductorNumExport::ConductorNumExport(QETProject *project, QWidget *parent) : */ bool ConductorNumExport::toCsv() { - QString name = QObject::tr("numero_de_fileries_") + m_project->title(); - if(!name.endsWith(".csv")) { - name += ".csv"; - } + QString name = QObject::tr("numero_de_fileries_") + m_project->title() + ".csv"; +// if(!name.endsWith(".csv")) { +// name += ".csv"; +// } QString filename = QFileDialog::getSaveFileName(m_parent_widget, QObject::tr("Enregister sous... "), name, QObject::tr("Fichiers csv (*.csv)")); QFile file(filename); diff --git a/sources/editor/qetelementeditor.cpp b/sources/editor/qetelementeditor.cpp index e7c0a2a4c..b88fc6beb 100644 --- a/sources/editor/qetelementeditor.cpp +++ b/sources/editor/qetelementeditor.cpp @@ -1237,9 +1237,9 @@ bool QETElementEditor::slot_saveAsFile() if (fn.isEmpty()) return(false); -// //If the name doesn't end by .elmt, we add it -// if (!fn.endsWith(".elmt", Qt::CaseInsensitive)) -// fn += ".elmt"; + //If the name doesn't end by .elmt, we add it + if (!fn.endsWith(".elmt", Qt::CaseInsensitive)) + fn += ".elmt"; bool result_save = toFile(fn); //If the save success, the filename is keep diff --git a/sources/nomenclature.cpp b/sources/nomenclature.cpp index eac1f8e8b..1ddcc319d 100644 --- a/sources/nomenclature.cpp +++ b/sources/nomenclature.cpp @@ -48,7 +48,7 @@ nomenclature::~nomenclature() { bool nomenclature::saveToCSVFile() { // SAVE IN FILE - QString name = QObject::tr("nomenclature_") + QString(m_project -> title()); + QString name = QObject::tr("nomenclature_") + QString(m_project -> title() + ".csv"); if (!name.endsWith(".csv")) { name += ".csv"; } diff --git a/sources/projectview.cpp b/sources/projectview.cpp index a6a3a4771..c74520e2a 100644 --- a/sources/projectview.cpp +++ b/sources/projectview.cpp @@ -313,7 +313,7 @@ QString ProjectView::askUserForFilePath(bool assign) { QString filepath = QFileDialog::getSaveFileName( this, tr("Enregistrer sous", "dialog title"), - m_project -> currentDir(), + m_project -> currentDir() + "/" + tr("sansnom") + ".qet", tr("Projet QElectroTech (*.qet)", "filetypes allowed when saving a project file") ); diff --git a/sources/ui/bomexportdialog.cpp b/sources/ui/bomexportdialog.cpp index 17e91de49..4ae13115e 100644 --- a/sources/ui/bomexportdialog.cpp +++ b/sources/ui/bomexportdialog.cpp @@ -125,10 +125,10 @@ int BOMExportDialog::exec() if (r == QDialog::Accepted) { //save in csv file - QString file_name = tr("nomenclature_") + QString(m_project ->title()); - if (!file_name.endsWith(".csv")) { - file_name += ".csv"; - } + QString file_name = tr("nomenclature_") + QString(m_project ->title() + ".csv"); +// if (!file_name.endsWith(".csv")) { +// file_name += ".csv"; +// } QString file_path = QFileDialog::getSaveFileName(this, tr("Enregister sous... "), file_name, tr("Fichiers csv (*.csv)")); QFile file(file_path); if (!file_path.isEmpty())