rbutil: dont write logfile if user aborts filename selection.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22544 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Wenger 2009-08-29 18:55:52 +00:00
parent 7aec70f367
commit 6fd6adbc44
2 changed files with 10 additions and 4 deletions

View file

@ -144,9 +144,12 @@ void ProgressLoggerGui::saveErrorLog()
{
QString filename = QFileDialog::getSaveFileName(downloadProgress, tr("Save system trace log"),
QDir::homePath(), "*.log");
if(filename == "")
return;
QFile file(filename);
file.open(QIODevice::WriteOnly);
if(!file.open(QIODevice::WriteOnly))
return;
//Logger texts
QString loggerTexts = "\n*********************************************\n"

View file

@ -46,9 +46,12 @@ void SysTrace::save(void)
{
QString fp = QFileDialog::getSaveFileName(this, tr("Save system trace log"),
QDir::homePath(), "*.log");
if(fp == "")
return;
QFile fh(fp);
fh.open(QIODevice::WriteOnly);
if(!fh.open(QIODevice::WriteOnly))
return;
fh.write(debugbuffer.toUtf8(), debugbuffer.size());
fh.close();
}