Skip to content

Commit 8d268c9

Browse files
author
Kaspar Schmid
committed
improved logging for unix
1 parent 0d27adc commit 8d268c9

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

ImagePlay/src/ImageViewerWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ ImageViewerWindow::updateImage
184184
*/
185185
void ImageViewerWindow::updateImage()
186186
{
187-
qDebug() << "ImageViewerWindow::udpateImage";
187+
qDebug() << "ImageViewerWindow::updateImage";
188188
if(ui && ui->tabWidget->isVisible())
189189
{
190190
// update the currently visible image

ImagePlay/src/MainWindow.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,26 +139,30 @@ void MainWindow::logMessage(QtMsgType type, const QMessageLogContext &context, c
139139
abort();
140140
}
141141

142+
142143
// write log file. one file per day
143144
if(logFileEnabled())
144145
{
145-
#ifdef Q_OS_MAC
146-
QDir logDir(QDir::homePath() + "/ImagePlay_log/");
147-
#else
146+
#ifdef Q_OS_WIN
148147
QDir logDir(qApp->applicationDirPath() + "/log/");
149-
#endif
150148
if(!logDir.exists())
151149
{
152150
logDir.mkdir(".");
153151
}
154152

155-
#ifdef Q_OS_MAC
156-
QString fileName = QDir::homePath() + "/ImagePlay_log/";
153+
QString fileName = logDir.absolutePath();
154+
fileName += "/";
155+
fileName += QDate::currentDate().toString("yyyy-MM-dd");
156+
fileName += ".log";
157157
#else
158-
QString fileName = qApp->applicationDirPath() + "/log/";
159-
#endif
158+
QDir logDir("/tmp/");
159+
160+
161+
QString fileName = logDir.absolutePath();
162+
fileName += "/ImagePlay.";
160163
fileName += QDate::currentDate().toString("yyyy-MM-dd");
161164
fileName += ".log";
165+
#endif
162166

163167
QFile logFile(fileName);
164168

ImagePlay/ui/AboutWindow.ui

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ p, li { white-space: pre-wrap; }
333333
</property>
334334
<item>
335335
<widget class="QTextEdit" name="textEdit_7">
336+
<property name="readOnly">
337+
<bool>true</bool>
338+
</property>
336339
<property name="html">
337340
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
338341
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;

0 commit comments

Comments
 (0)