Commit b00d47ae authored by Oliver Kellogg's avatar Oliver Kellogg
Browse files

Fix for empty filename on using CodeImpThread::emitMessageToLog from importers:

umbrello/codeimpwizard/codeimpthread.h
- In explicit constructor pass argument `file' by reference.
- Change private member m_file to reference.

umbrello/codeimpwizard/codeimpthread.cpp
- In function emitMessageToLog, if the `file' argument is passed in
  empty then provide m_file.fileName() to signal messageToLog().
parent 826889ae
......@@ -30,7 +30,7 @@
* Constructor.
* @param file File to import for which the thread shall be spawned
*/
CodeImpThread::CodeImpThread(QFileInfo file, QObject* parent)
CodeImpThread::CodeImpThread(QFileInfo& file, QObject* parent)
: QObject(parent),
m_file(file)
{
......@@ -101,7 +101,11 @@ int CodeImpThread::emitAskQuestion(const QString& question)
*/
void CodeImpThread::emitMessageToLog(const QString& file, const QString& text)
{
emit messageToLog(file, text);
if (file.isEmpty()) {
emit messageToLog(m_file.fileName(), text);
} else {
emit messageToLog(file, text);
}
}
/**
......
......@@ -36,7 +36,7 @@ class CodeImpThread : public QObject
{
Q_OBJECT
public:
explicit CodeImpThread(QFileInfo file, QObject* parent = 0);
explicit CodeImpThread(QFileInfo& file, QObject* parent = 0);
virtual ~CodeImpThread();
public slots:
......@@ -58,7 +58,7 @@ private slots:
void questionAsked(const QString& question, int& answer);
private:
QFileInfo m_file;
QFileInfo& m_file;
//QWaitCondition m_waitCondition;
//QMutex m_mutex;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment