Commit 9ab659c6 authored by Cristian Oneț's avatar Cristian Oneț
Browse files

KMyMoneyCompletion should now work properly using input methods.

Remove previous workarounds that were added to hide this problem.

BUG: 272631
BUG: 272393
BUG: 320579
(cherry picked from commit ea6b2b13)
parent 66a09c25
......@@ -33,11 +33,7 @@
#include <QLabel>
#include <QList>
#include <QVBoxLayout>
// these are needed for a Windows only fix
#ifdef Q_OS_WIN32 // krazy:exclude=cpp
#include <QInputContext>
#include <QInputContextFactory>
#endif
// ----------------------------------------------------------------------------
// KDE Headers
......@@ -1203,10 +1199,6 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// just leave the transaction as imported.
MyMoneySchedule schedule(*(dynamic_cast<const MyMoneySchedule*>(o)));
if (KMessageBox::questionYesNo(0, QString("<qt>%1</qt>").arg(i18n("KMyMoney has found a scheduled transaction named <b>%1</b> which matches an imported transaction. Do you want KMyMoney to enter this schedule now so that the transaction can be matched? ", schedule.name())), i18n("Schedule found")) == KMessageBox::Yes) {
#ifdef Q_OS_WIN32 //krazy:exclude=cpp
// reset the input context on Windows or else we'll have a crash here caused by an invalid focus widget in the input context
qApp->setInputContext(QInputContextFactory::create(qApp->inputContext()->identifierName(), qApp));
#endif
KEnterScheduleDlg dlg(0, schedule);
editor = dlg.startEdit();
if (editor) {
......
......@@ -32,7 +32,6 @@
#include <QDesktopWidget>
#include <QLineEdit>
#include <QInputContext>
#include <QInputContextFactory>
// ----------------------------------------------------------------------------
// KDE Includes
......@@ -155,11 +154,10 @@ void kMyMoneyCompletion::show(bool presetSelected)
}
}
KVBox::show();
// after the popup is shown for the first time the input context of the combobox gets messed up
// so replace it whit a new input context of the same type to handle input methods correctly
if (m_parent) {
m_parent->setInputContext(QInputContextFactory::create(m_parent->inputContext()->identifierName(), m_parent));
}
// make sure that the parent is the input context's focus widget instead of the selector's list
if (qApp->inputContext()->focusWidget() == m_selector->listView())
qApp->inputContext()->setFocusWidget(m_parent);
}
void kMyMoneyCompletion::hide(void)
......
......@@ -30,9 +30,6 @@
#include <QRegExp>
#include <QHBoxLayout>
#include <QApplication>
#ifdef Q_OS_WIN32 // krazy:exclude=cpp
#include <QInputContext>
#endif
// ----------------------------------------------------------------------------
// KDE Includes
......@@ -76,12 +73,6 @@ KMyMoneySelector::KMyMoneySelector(QWidget *parent, Qt::WFlags flags) :
KMyMoneySelector::~KMyMoneySelector()
{
#ifdef Q_OS_WIN32 //krazy:exclude=cpp
// reset the focused widget or else we'll have a crash later
// caused by an already free'd focus widget in the input context
if (qApp->inputContext()->focusWidget() == m_treeWidget)
qApp->inputContext()->setFocusWidget(0);
#endif
}
void KMyMoneySelector::clear(void)
......
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