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 @@
#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
......@@ -1307,10 +1303,6 @@ void MyMoneyStatementReader::handleMatchingOfScheduledTransaction(TransactionMat
QPointer<TransactionEditor> editor;
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);
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