Commit ea6b2b13 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
parent bd8d1590
...@@ -33,11 +33,7 @@ ...@@ -33,11 +33,7 @@
#include <QLabel> #include <QLabel>
#include <QList> #include <QList>
#include <QVBoxLayout> #include <QVBoxLayout>
// these are needed for a Windows only fix
#ifdef Q_OS_WIN32 // krazy:exclude=cpp
#include <QInputContext>
#include <QInputContextFactory>
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// KDE Headers // KDE Headers
...@@ -1307,10 +1303,6 @@ void MyMoneyStatementReader::handleMatchingOfScheduledTransaction(TransactionMat ...@@ -1307,10 +1303,6 @@ void MyMoneyStatementReader::handleMatchingOfScheduledTransaction(TransactionMat
QPointer<TransactionEditor> editor; QPointer<TransactionEditor> editor;
if (askUserToEnterScheduleForMatching(matchedSchedule, importedSplit)) { if (askUserToEnterScheduleForMatching(matchedSchedule, importedSplit)) {
#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, matchedSchedule); KEnterScheduleDlg dlg(0, matchedSchedule);
editor = dlg.startEdit(); editor = dlg.startEdit();
if (editor) { if (editor) {
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QLineEdit> #include <QLineEdit>
#include <QInputContext> #include <QInputContext>
#include <QInputContextFactory>
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// KDE Includes // KDE Includes
...@@ -155,11 +154,10 @@ void kMyMoneyCompletion::show(bool presetSelected) ...@@ -155,11 +154,10 @@ void kMyMoneyCompletion::show(bool presetSelected)
} }
} }
KVBox::show(); 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 // make sure that the parent is the input context's focus widget instead of the selector's list
if (m_parent) { if (qApp->inputContext()->focusWidget() == m_selector->listView())
m_parent->setInputContext(QInputContextFactory::create(m_parent->inputContext()->identifierName(), m_parent)); qApp->inputContext()->setFocusWidget(m_parent);
}
} }
void kMyMoneyCompletion::hide(void) void kMyMoneyCompletion::hide(void)
......
...@@ -30,9 +30,6 @@ ...@@ -30,9 +30,6 @@
#include <QRegExp> #include <QRegExp>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QApplication> #include <QApplication>
#ifdef Q_OS_WIN32 // krazy:exclude=cpp
#include <QInputContext>
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// KDE Includes // KDE Includes
...@@ -76,12 +73,6 @@ KMyMoneySelector::KMyMoneySelector(QWidget *parent, Qt::WFlags flags) : ...@@ -76,12 +73,6 @@ KMyMoneySelector::KMyMoneySelector(QWidget *parent, Qt::WFlags flags) :
KMyMoneySelector::~KMyMoneySelector() 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) 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