[Uml-devel] KDE/kdesdk/umbrello/umbrello/codeimpwizard
Andi Fischer
andi.fischer at hispeed.ch
Tue Jan 3 08:26:25 UTC 2012
SVN commit 1271127 by fischer:
Krazy2 issues about Qt classes that should not be used fixed.
M +8 -8 codeimpthread.cpp
M +2 -3 codeimpthread.h
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimpwizard/codeimpthread.cpp #1271126:1271127
@@ -24,6 +24,7 @@
// kde includes
#include <klocale.h>
+#include <kmessagebox.h>
/**
* Constructor.
@@ -33,8 +34,8 @@
: QObject(parent),
m_file(file)
{
- connect(this, SIGNAL(askQuestion(QString,QMessageBox::StandardButton*)),
- this, SLOT(questionAsked(QString,QMessageBox::StandardButton*)));
+ connect(this, SIGNAL(askQuestion(QString,int)),
+ this, SLOT(questionAsked(QString,int)));
}
/**
@@ -72,14 +73,13 @@
/**
* Emit a signal to the main gui thread to show a question box.
* @param question the text of the question
- * @return the code of the answer button
+ * @return the code of the answer button @ref KMessageBox::ButtonCode
*/
int CodeImpThread::emitAskQuestion(const QString& question)
{
int buttonCode = 0;
- QMessageBox::StandardButton buttonCodeOld;
//QMutexLocker locker(&m_mutex);
- emit askQuestion(question, &buttonCodeOld);
+ emit askQuestion(question, buttonCode);
//m_waitCondition.wait(&m_mutex);
return buttonCode;
}
@@ -97,11 +97,11 @@
/**
* Slot for signal askQuestion.
* @param question the question to ask
- * @param answer the pressed answer button code
+ * @param answer the pressed answer button code @ref KMessageBox::ButtonCode
*/
-void CodeImpThread::questionAsked(const QString& question, QMessageBox::StandardButton* answer)
+void CodeImpThread::questionAsked(const QString& question, int& answer)
{
//QMutexLocker locker(&m_mutex);
- *answer = QMessageBox::question(0, "Question:", question, QMessageBox::Yes|QMessageBox::No);
+ answer = KMessageBox::questionYesNo(0, question, "Question code import:");
//m_waitCondition.wakeOne();
}
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimpwizard/codeimpthread.h #1271126:1271127
@@ -24,7 +24,6 @@
#include <QtCore/QMutex>
#include <QtCore/QThread>
#include <QtCore/QWaitCondition>
-#include <QtGui/QMessageBox>
class ClassImport;
@@ -47,7 +46,7 @@
void emitMessageToLog(const QString& file, const QString& text);
signals:
- void askQuestion(const QString& question, QMessageBox::StandardButton* answer);
+ void askQuestion(const QString& question, int& answer);
void messageToWiz(const QString& file, const QString& text);
void messageToLog(const QString& file, const QString& text);
void messageToApp(const QString& text);
@@ -55,7 +54,7 @@
void aborted();
private slots:
- void questionAsked(const QString& question, QMessageBox::StandardButton* answer);
+ void questionAsked(const QString& question, int& answer);
private:
QFileInfo m_file;
More information about the umbrello-devel
mailing list