mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Improve files names extension for Gnome DE and Flatpak
This commit is contained in:
parent
6535a93b66
commit
85a2600e58
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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";
|
||||
}
|
||||
|
@ -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")
|
||||
);
|
||||
|
||||
|
@ -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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user