mirror of
https://github.com/opentx/opentx.git
synced 2025-07-14 03:49:52 +03:00
Re #1567:
introduced generateProcessUniqueTempFileName() which is used everywhere we need temporary file renamed unlink() into qunlink() fixed missing deletion of curve pngs in print dialog
This commit is contained in:
parent
4103adf75d
commit
741ef45f3e
9 changed files with 57 additions and 47 deletions
|
@ -31,12 +31,12 @@ PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralS
|
|||
te->clear();
|
||||
QString modelname=g_model->name;
|
||||
if (modelname.isEmpty()) {
|
||||
curvefile5=QString("%1/curve5.png").arg(qd->tempPath());
|
||||
curvefile9=QString("%1/curve9.png").arg(qd->tempPath());
|
||||
curvefile5=generateProcessUniqueTempFileName("curve5.png");
|
||||
curvefile9=generateProcessUniqueTempFileName("curve9.png");
|
||||
}
|
||||
else {
|
||||
curvefile5=QString("%1/%2-curve5.png").arg(qd->tempPath()).arg(modelname);
|
||||
curvefile9=QString("%1/%2-curve9.png").arg(qd->tempPath()).arg(modelname);
|
||||
curvefile5=generateProcessUniqueTempFileName(QString("%1-curve5.png").arg(modelname));
|
||||
curvefile9=generateProcessUniqueTempFileName(QString("%1-curve9.png").arg(modelname));
|
||||
}
|
||||
printSetup();
|
||||
if (gvars) {
|
||||
|
@ -60,15 +60,16 @@ PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralS
|
|||
|
||||
void PrintDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if (printfilename.isEmpty()) {
|
||||
unlink(curvefile5);
|
||||
unlink(curvefile9);
|
||||
}
|
||||
// if (printfilename.isEmpty()) {
|
||||
// }
|
||||
}
|
||||
|
||||
PrintDialog::~PrintDialog()
|
||||
{
|
||||
delete ui;
|
||||
qDebug() << "PrintDialog::~PrintDialog";
|
||||
qunlink(curvefile5);
|
||||
qunlink(curvefile9);
|
||||
delete ui;
|
||||
}
|
||||
|
||||
QString doTC(const QString s, const QString color="", bool bold=false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue