mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 12:25:12 +03:00
Re #1567: introduced unlink() function that takes QString parameter
This commit is contained in:
parent
c0e612531d
commit
4103adf75d
7 changed files with 19 additions and 19 deletions
|
@ -376,7 +376,7 @@ void burnConfigDialog::restFuses(bool eeProtect)
|
|||
lfuses="lfuse:w:0x3F:m";
|
||||
}
|
||||
file.close();
|
||||
unlink(tempFile.toAscii());
|
||||
unlink(tempFile);
|
||||
}
|
||||
else {
|
||||
lfuses="lfuse:w:0x3F:m";
|
||||
|
|
|
@ -156,12 +156,8 @@ void CompareDialog::dropEvent(QDropEvent *event)
|
|||
|
||||
void CompareDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
QByteArray ba = curvefile5.toLatin1();
|
||||
char *name = ba.data();
|
||||
unlink(name);
|
||||
ba = curvefile9.toLatin1();
|
||||
name = ba.data();
|
||||
unlink(name);
|
||||
unlink(curvefile5);
|
||||
unlink(curvefile9);
|
||||
}
|
||||
|
||||
CompareDialog::~CompareDialog()
|
||||
|
|
|
@ -964,3 +964,10 @@ QString index2version(int index)
|
|||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int unlink(const QString & fileName)
|
||||
{
|
||||
QByteArray ba = fileName.toLatin1();
|
||||
return unlink(ba.constData());
|
||||
}
|
||||
|
|
|
@ -139,4 +139,7 @@ class QTimeS : public QTime
|
|||
int seconds() const { return hour()*3600 + minute()*60 + second(); };
|
||||
};
|
||||
|
||||
|
||||
int unlink(const QString & fileName);
|
||||
|
||||
#endif // HELPERS_H
|
||||
|
|
|
@ -806,7 +806,7 @@ QStringList MainWindow::GetSambaArguments(const QString &tcl)
|
|||
|
||||
QString tclFilename = QDir::tempPath() + "/temp.tcl";
|
||||
if (QFile::exists(tclFilename)) {
|
||||
unlink(tclFilename.toAscii());
|
||||
unlink(tclFilename);
|
||||
}
|
||||
QFile tclFile(tclFilename);
|
||||
if (!tclFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
|
@ -963,7 +963,7 @@ void MainWindow::readEeprom()
|
|||
child->newFile();
|
||||
child->loadFile(tempFile, false);
|
||||
child->show();
|
||||
unlink(tempFile.toAscii());
|
||||
unlink(tempFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1194,7 +1194,7 @@ void MainWindow::writeBackup()
|
|||
}
|
||||
fileName = restoreFile;
|
||||
}
|
||||
unlink(tempFlash.toAscii());
|
||||
unlink(tempFlash);
|
||||
}
|
||||
else {
|
||||
if (backupEnable) {
|
||||
|
|
|
@ -571,9 +571,7 @@ void MdiChild::writeEeprom() // write to Tx
|
|||
}
|
||||
tempFile=restoreFile;
|
||||
}
|
||||
QByteArray ba = tempFlash.toLatin1();
|
||||
char *name = ba.data();
|
||||
unlink(name);
|
||||
unlink(tempFlash);
|
||||
}
|
||||
else {
|
||||
if (backupEnable) {
|
||||
|
|
|
@ -61,12 +61,8 @@ PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralS
|
|||
void PrintDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if (printfilename.isEmpty()) {
|
||||
QByteArray ba = curvefile5.toLatin1();
|
||||
char *name = ba.data();
|
||||
unlink(name);
|
||||
ba = curvefile9.toLatin1();
|
||||
name = ba.data();
|
||||
unlink(name);
|
||||
unlink(curvefile5);
|
||||
unlink(curvefile9);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue