diff options
author | Dominik Wenger <domonoky@googlemail.com> | 2009-08-29 18:55:52 +0000 |
---|---|---|
committer | Dominik Wenger <domonoky@googlemail.com> | 2009-08-29 18:55:52 +0000 |
commit | 6fd6adbc4414e05ec73003c9ffb662c9ad000d57 (patch) | |
tree | 0b621e437df25b1b8e39e3077b161f6ff803becb | |
parent | 7aec70f3679a0afb18dc3ea9d1fdb9397a21889d (diff) | |
download | rockbox-6fd6adbc4414e05ec73003c9ffb662c9ad000d57.tar.gz rockbox-6fd6adbc4414e05ec73003c9ffb662c9ad000d57.zip |
rbutil: dont write logfile if user aborts filename selection.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22544 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | rbutil/rbutilqt/progressloggergui.cpp | 7 | ||||
-rw-r--r-- | rbutil/rbutilqt/systrace.cpp | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/progressloggergui.cpp b/rbutil/rbutilqt/progressloggergui.cpp index de2be96165..c553c1dc82 100644 --- a/rbutil/rbutilqt/progressloggergui.cpp +++ b/rbutil/rbutilqt/progressloggergui.cpp | |||
@@ -144,9 +144,12 @@ void ProgressLoggerGui::saveErrorLog() | |||
144 | { | 144 | { |
145 | QString filename = QFileDialog::getSaveFileName(downloadProgress, tr("Save system trace log"), | 145 | QString filename = QFileDialog::getSaveFileName(downloadProgress, tr("Save system trace log"), |
146 | QDir::homePath(), "*.log"); | 146 | QDir::homePath(), "*.log"); |
147 | 147 | if(filename == "") | |
148 | return; | ||
149 | |||
148 | QFile file(filename); | 150 | QFile file(filename); |
149 | file.open(QIODevice::WriteOnly); | 151 | if(!file.open(QIODevice::WriteOnly)) |
152 | return; | ||
150 | 153 | ||
151 | //Logger texts | 154 | //Logger texts |
152 | QString loggerTexts = "\n*********************************************\n" | 155 | QString loggerTexts = "\n*********************************************\n" |
diff --git a/rbutil/rbutilqt/systrace.cpp b/rbutil/rbutilqt/systrace.cpp index 42babfe2f8..21b4a1f93b 100644 --- a/rbutil/rbutilqt/systrace.cpp +++ b/rbutil/rbutilqt/systrace.cpp | |||
@@ -46,9 +46,12 @@ void SysTrace::save(void) | |||
46 | { | 46 | { |
47 | QString fp = QFileDialog::getSaveFileName(this, tr("Save system trace log"), | 47 | QString fp = QFileDialog::getSaveFileName(this, tr("Save system trace log"), |
48 | QDir::homePath(), "*.log"); | 48 | QDir::homePath(), "*.log"); |
49 | 49 | if(fp == "") | |
50 | return; | ||
51 | |||
50 | QFile fh(fp); | 52 | QFile fh(fp); |
51 | fh.open(QIODevice::WriteOnly); | 53 | if(!fh.open(QIODevice::WriteOnly)) |
54 | return; | ||
52 | fh.write(debugbuffer.toUtf8(), debugbuffer.size()); | 55 | fh.write(debugbuffer.toUtf8(), debugbuffer.size()); |
53 | fh.close(); | 56 | fh.close(); |
54 | } | 57 | } |