Hello community,

here is the log from the commit of package fcitx-qt5 for openSUSE:Factory 
checked in at 2016-12-03 18:28:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fcitx-qt5 (Old)
 and      /work/SRC/openSUSE:Factory/.fcitx-qt5.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fcitx-qt5"

Changes:
--------
--- /work/SRC/openSUSE:Factory/fcitx-qt5/fcitx-qt5.changes      2015-12-24 
12:17:27.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.fcitx-qt5.new/fcitx-qt5.changes 2016-12-03 
18:28:06.000000000 +0100
@@ -1,0 +2,13 @@
+Sat Dec  3 04:17:29 UTC 2016 - [email protected]
+
+- update version 1.0.6
+  * [qt5]fix inconsistency between qstring and ucs4 string
+    when handle surrounding
+  * [qt5]fromUcs4 expect a null terminated string by default,
+    give it a size
+  * [qt5]use new connection syntax
+  * [qt5]use more nullptr
+  * [qt5]remove usage of QPointer in icdata
+  * [qt5]don't crash if window->screen() is null
+
+-------------------------------------------------------------------

Old:
----
  fcitx-qt5-1.0.5.tar.xz

New:
----
  fcitx-qt5-1.0.6.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ fcitx-qt5.spec ++++++
--- /var/tmp/diff_new_pack.E0u64S/_old  2016-12-03 18:28:08.000000000 +0100
+++ /var/tmp/diff_new_pack.E0u64S/_new  2016-12-03 18:28:08.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package fcitx-qt5
 #
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           fcitx-qt5
-Version:        1.0.5
+Version:        1.0.6
 Release:        0
 Summary:        Fcitx QT5 Input Context
 License:        GPL-2.0+

++++++ fcitx-qt5-1.0.5.tar.xz -> fcitx-qt5-1.0.6.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx-qt5-1.0.5/dbusaddons/fcitxqtconnection.cpp 
new/fcitx-qt5-1.0.6/dbusaddons/fcitxqtconnection.cpp
--- old/fcitx-qt5-1.0.5/dbusaddons/fcitxqtconnection.cpp        2015-12-18 
01:02:37.000000000 +0100
+++ new/fcitx-qt5-1.0.6/dbusaddons/fcitxqtconnection.cpp        2016-10-13 
01:26:34.000000000 +0200
@@ -101,7 +101,7 @@
     ,m_displayNumber(-1)
     
,m_serviceName(QString("%1-%2").arg("org.fcitx.Fcitx").arg(displayNumber()))
     ,m_connection(0)
-    ,m_serviceWatcher(new QDBusServiceWatcher(conn))
+    ,m_serviceWatcher(new QDBusServiceWatcher(this))
     ,m_watcher(new QFileSystemWatcher(this))
     ,m_autoReconnect(true)
     ,m_connectedOnce(false)
@@ -130,8 +130,8 @@
         m_watcher->addPath(info.filePath());
     }
 
-    connect(m_watcher, SIGNAL(fileChanged(QString)), this, 
SLOT(socketFileChanged()));
-    connect(m_watcher, SIGNAL(directoryChanged(QString)), this, 
SLOT(socketFileChanged()));
+    connect(m_watcher, &QFileSystemWatcher::fileChanged, this, 
&FcitxQtConnectionPrivate::socketFileChanged);
+    connect(m_watcher, &QFileSystemWatcher::directoryChanged, this, 
&FcitxQtConnectionPrivate::socketFileChanged);
     m_initialized = true;
 }
 
@@ -139,8 +139,8 @@
     m_serviceWatcher->removeWatchedService(m_serviceName);
     m_watcher->removePaths(m_watcher->files());
     m_watcher->removePaths(m_watcher->directories());
-    m_watcher->disconnect(SIGNAL(fileChanged(QString)));
-    m_watcher->disconnect(SIGNAL(directoryChanged(QString)));
+    disconnect(m_watcher, &QFileSystemWatcher::fileChanged, this, 
&FcitxQtConnectionPrivate::socketFileChanged);
+    disconnect(m_watcher, &QFileSystemWatcher::directoryChanged, this, 
&FcitxQtConnectionPrivate::socketFileChanged);
     m_initialized = false;
 }
 
@@ -166,7 +166,7 @@
 #else
     QFile file1("/var/lib/dbus/machine-id");
     QFile file2("/etc/machine-id");
-    QFile* fileToRead = NULL;
+    QFile* fileToRead = nullptr;
     if (file1.open(QIODevice::ReadOnly)) {
         fileToRead = &file1;
     }
@@ -273,7 +273,7 @@
         return;
     }
 
-    
m_serviceWatcher->disconnect(SIGNAL(serviceOwnerChanged(QString,QString,QString)));
+    disconnect(m_serviceWatcher, &QDBusServiceWatcher::serviceOwnerChanged, 
this, &FcitxQtConnectionPrivate::imChanged);
     QString addr = address();
     if (!addr.isNull()) {
         QDBusConnection connection(QDBusConnection::connectToBus(addr, 
"fcitx"));
@@ -287,7 +287,7 @@
 
     if (!m_connection) {
         QDBusConnection* connection = new 
QDBusConnection(QDBusConnection::sessionBus());
-        connect(m_serviceWatcher, 
SIGNAL(serviceOwnerChanged(QString,QString,QString)), this, 
SLOT(imChanged(QString,QString,QString)));
+        connect(m_serviceWatcher, &QDBusServiceWatcher::serviceOwnerChanged, 
this, &FcitxQtConnectionPrivate::imChanged);
         QDBusReply<bool> registered = 
connection->interface()->isServiceRegistered(m_serviceName);
         if (!registered.isValid() || !registered.value()) {
             delete connection;
@@ -340,7 +340,7 @@
     QDBusConnection::disconnectFromBus("fcitx");
     if (m_connection) {
         delete m_connection;
-        m_connection = 0;
+        m_connection = nullptr;
         doemit = true;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fcitx-qt5-1.0.5/platforminputcontext/qfcitxplatforminputcontext.cpp 
new/fcitx-qt5-1.0.6/platforminputcontext/qfcitxplatforminputcontext.cpp
--- old/fcitx-qt5-1.0.5/platforminputcontext/qfcitxplatforminputcontext.cpp     
2015-12-18 01:02:37.000000000 +0100
+++ new/fcitx-qt5-1.0.6/platforminputcontext/qfcitxplatforminputcontext.cpp     
2016-10-13 01:26:34.000000000 +0200
@@ -92,7 +92,6 @@
     m_cursorPos(0),
     m_useSurroundingText(false),
     m_syncMode(get_boolean_env("FCITX_QT_USE_SYNC", false)),
-    m_lastWId(0),
     m_destroy(false),
     m_xkbContext(_xkb_context_new_helper()),
     m_xkbComposeTable(m_xkbContext ? 
xkb_compose_table_new_from_locale(m_xkbContext.data(), get_locale(), 
XKB_COMPOSE_COMPILE_NO_FLAGS) : 0),
@@ -100,8 +99,8 @@
 {
     FcitxQtFormattedPreedit::registerMetaType();
 
-    connect(m_connection, SIGNAL(connected()), this, SLOT(connected()));
-    connect(m_connection, SIGNAL(disconnected()), this, SLOT(cleanUp()));
+    connect(m_connection, &FcitxQtConnection::connected, this, 
&QFcitxPlatformInputContext::connected);
+    connect(m_connection, &FcitxQtConnection::disconnected, this, 
&QFcitxPlatformInputContext::cleanUp);
 
     m_connection->startConnection();
 }
@@ -192,7 +191,7 @@
     if (!proxy)
         return;
 
-    auto &data = m_icMap[window->winId()];
+    auto &data = m_icMap[window];
 
     QObject *input = qApp->focusObject();
     if (!input)
@@ -254,6 +253,12 @@
                     anchor = var2.toInt();
                 else
                     anchor = cursor;
+
+                // adjust it to real character size
+                QVector<uint> tempUCS4 = text.leftRef(cursor).toUcs4();
+                cursor = tempUCS4.size();
+                tempUCS4 = text.leftRef(anchor).toUcs4();
+                anchor = tempUCS4.size();
                 if (data.surroundingText != text) {
                     data.surroundingText = text;
                     proxy->SetSurroundingText(text, cursor, anchor);
@@ -284,16 +289,15 @@
 
 void QFcitxPlatformInputContext::setFocusObject(QObject* object)
 {
-    FcitxQtInputContextProxy* proxy = validICByWId(m_lastWId);
+    Q_UNUSED(object);
+    FcitxQtInputContextProxy* proxy = validICByWindow(m_lastWindow);
     if (proxy) {
         proxy->FocusOut();
     }
 
     QWindow *window = qApp->focusWindow();
-    if (window) {
-        m_lastWId = window->winId();
-    } else {
-        m_lastWId = 0;
+    m_lastWindow = window;
+    if (!window) {
         return;
     }
     proxy = validICByWindow(window);
@@ -307,12 +311,7 @@
 void QFcitxPlatformInputContext::windowDestroyed(QObject* object)
 {
     /* access QWindow is not possible here, so we use our own map to do so */
-    auto iter = m_windowToWidMap.find(object);
-    if (iter == m_windowToWidMap.end())
-        return;
-    auto wid = iter->second;
-    m_windowToWidMap.erase(iter);
-    m_icMap.erase(wid);
+    m_icMap.erase(reinterpret_cast<QWindow*>(object));
     // qDebug() << "Window Destroyed and we destroy IC correctly, horray!";
 }
 
@@ -325,7 +324,7 @@
     if (!proxy)
         return;
 
-    auto& data = m_icMap[inputWindow->winId()];
+    auto& data = m_icMap[inputWindow];
 
     QRect r = qApp->inputMethod()->cursorRectangle().toRect();
     if(!r.isValid())
@@ -341,7 +340,7 @@
     }
 }
 
-void QFcitxPlatformInputContext::createInputContext(WId w)
+void QFcitxPlatformInputContext::createInputContext(QWindow *w)
 {
     if (!m_connection->isConnected())
         return;
@@ -358,13 +357,13 @@
     QFileInfo info(QCoreApplication::applicationFilePath());
     QDBusPendingReply< int, bool, uint, uint, uint, uint > result = 
m_improxy->CreateICv3(info.fileName(), QCoreApplication::applicationPid());
     QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(result);
-    watcher->setProperty("wid", (qulonglong) w);
-    connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, 
SLOT(createInputContextFinished(QDBusPendingCallWatcher*)));
+    watcher->setProperty("wid", qVariantFromValue(static_cast<void*>(w)));
+    connect(watcher, &QDBusPendingCallWatcher::finished, this, 
&QFcitxPlatformInputContext::createInputContextFinished);
 }
 
 void 
QFcitxPlatformInputContext::createInputContextFinished(QDBusPendingCallWatcher* 
watcher)
 {
-    WId w = watcher->property("wid").toULongLong();
+    auto w = 
reinterpret_cast<QWindow*>(watcher->property("wid").value<void*>());
     auto iter = m_icMap.find(w);
     if (iter == m_icMap.end()) {
         return;
@@ -388,15 +387,16 @@
             delete data.proxy;
         }
         data.proxy = new FcitxQtInputContextProxy(m_connection->serviceName(), 
path, *m_connection->connection(), this);
-        connect(data.proxy, SIGNAL(CommitString(QString)), this, 
SLOT(commitString(QString)));
-        connect(data.proxy, SIGNAL(ForwardKey(uint, uint, int)), this, 
SLOT(forwardKey(uint, uint, int)));
-        connect(data.proxy, 
SIGNAL(UpdateFormattedPreedit(FcitxQtFormattedPreeditList,int)), this, 
SLOT(updateFormattedPreedit(FcitxQtFormattedPreeditList,int)));
-        connect(data.proxy, SIGNAL(DeleteSurroundingText(int,uint)), this, 
SLOT(deleteSurroundingText(int,uint)));
-        connect(data.proxy, SIGNAL(CurrentIM(QString,QString,QString)), this, 
SLOT(updateCurrentIM(QString,QString,QString)));
+        data.proxy->setProperty("icData", 
qVariantFromValue(static_cast<void*>(&data)));
+        connect(data.proxy, &FcitxQtInputContextProxy::CommitString, this, 
&QFcitxPlatformInputContext::commitString);
+        connect(data.proxy, &FcitxQtInputContextProxy::ForwardKey, this, 
&QFcitxPlatformInputContext::forwardKey);
+        connect(data.proxy, &FcitxQtInputContextProxy::UpdateFormattedPreedit, 
this, &QFcitxPlatformInputContext::updateFormattedPreedit);
+        connect(data.proxy, &FcitxQtInputContextProxy::DeleteSurroundingText, 
this, &QFcitxPlatformInputContext::deleteSurroundingText);
+        connect(data.proxy, &FcitxQtInputContextProxy::CurrentIM, this, 
&QFcitxPlatformInputContext::updateCurrentIM);
 
         if (data.proxy->isValid()) {
             QWindow* window = qApp->focusWindow();
-            if (window && window->winId() == w)
+            if (window && window == w)
                 data.proxy->FocusIn();
         }
 
@@ -480,15 +480,56 @@
     update(Qt::ImCursorRectangle);
 }
 
-void QFcitxPlatformInputContext::deleteSurroundingText(int offset, uint nchar)
+void QFcitxPlatformInputContext::deleteSurroundingText(int offset, uint _nchar)
 {
     QObject *input = qApp->focusObject();
     if (!input)
         return;
 
     QInputMethodEvent event;
-    event.setCommitString("", offset, nchar);
-    QCoreApplication::sendEvent(input, &event);
+
+    FcitxQtInputContextProxy *proxy = 
qobject_cast<FcitxQtInputContextProxy*>(sender());
+    if (!proxy) {
+        return;
+    }
+
+    FcitxQtICData *data = 
static_cast<FcitxQtICData*>(proxy->property("icData").value<void *>());
+    QVector<uint> ucsText = data->surroundingText.toUcs4();
+
+    int cursor = data->surroundingCursor;
+    // make nchar signed so we are safer
+    int nchar = _nchar;
+    // Qt's reconvert semantics is different from gtk's. It doesn't count the 
current
+    // selection. Discard selection from nchar.
+    if (data->surroundingAnchor < data->surroundingCursor) {
+        nchar -= data->surroundingCursor - data->surroundingAnchor;
+        offset += data->surroundingCursor - data->surroundingAnchor;
+        cursor = data->surroundingAnchor;
+    } else if (data->surroundingAnchor > data->surroundingCursor) {
+        nchar -= data->surroundingAnchor - data->surroundingCursor;
+        cursor = data->surroundingCursor;
+    }
+
+    // validates
+    if (nchar >= 0 && cursor + offset >= 0 && cursor + offset + nchar < 
ucsText.size()) {
+        // order matters
+        QVector<uint> replacedChars = ucsText.mid(cursor + offset, nchar);
+        nchar = QString::fromUcs4(replacedChars.data(), 
replacedChars.size()).size();
+
+        int start, len;
+        if (offset >= 0) {
+            start = cursor;
+            len = offset;
+        } else {
+            start = cursor;
+            len = -offset;
+        }
+
+        QVector<uint> prefixedChars = ucsText.mid(start, len);
+        offset = QString::fromUcs4(prefixedChars.data(), 
prefixedChars.size()).size() * (offset >= 0 ? 1 : -1);
+        event.setCommitString("", offset, nchar);
+        QCoreApplication::sendEvent(input, &event);
+    }
 }
 
 void QFcitxPlatformInputContext::forwardKey(uint keyval, uint state, int type)
@@ -521,13 +562,12 @@
 
 void QFcitxPlatformInputContext::createICData(QWindow* w)
 {
-    auto iter = m_icMap.find(w->winId());
+    auto iter = m_icMap.find(w);
     if (iter == m_icMap.end()) {
-        m_icMap.emplace(std::piecewise_construct, 
std::forward_as_tuple(w->winId()), std::forward_as_tuple());
-        m_windowToWidMap[w] = w->winId();
-        connect(w, SIGNAL(destroyed(QObject*)), this, 
SLOT(windowDestroyed(QObject*)));
+        m_icMap.emplace(std::piecewise_construct, std::forward_as_tuple(w), 
std::forward_as_tuple());
+        connect(w, &QObject::destroyed, this, 
&QFcitxPlatformInputContext::windowDestroyed);
     }
-    createInputContext(w->winId());
+    createInputContext(w);
 }
 
 QKeyEvent* QFcitxPlatformInputContext::createKeyEvent(uint keyval, uint state, 
int type)
@@ -626,8 +666,8 @@
         }
         else {
             ProcessKeyWatcher* watcher = new ProcessKeyWatcher(*keyEvent, 
qApp->focusWindow(), reply, this);
-            connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
-                    this, 
SLOT(processKeyEventFinished(QDBusPendingCallWatcher*)));
+            connect(watcher, &QDBusPendingCallWatcher::finished,
+                    this, 
&QFcitxPlatformInputContext::processKeyEventFinished);
             return true;
         }
     } while(0);
@@ -646,7 +686,7 @@
         return;
     }
 
-    const QKeyEvent& keyEvent = watcher->event();
+    const QKeyEvent& keyEvent = watcher->keyEvent();
 
     // use same variable name as in QXcbKeyboard::handleKeyEvent
     QEvent::Type type = keyEvent.type();
@@ -672,8 +712,12 @@
     if (!filtered) {
         // copied from QXcbKeyboard::handleKeyEvent()
         if (type == QEvent::KeyPress && qtcode == Qt::Key_Menu) {
-            const QPoint globalPos = 
window->screen()->handle()->cursor()->pos();
-            const QPoint pos = window->mapFromGlobal(globalPos);            
QWindowSystemInterface::handleContextMenuEvent(window, false, pos, globalPos, 
modifiers);
+            QPoint globalPos, pos;
+            if (window->screen()) {
+                globalPos = window->screen()->handle()->cursor()->pos();
+                pos = window->mapFromGlobal(globalPos);
+            }
+            QWindowSystemInterface::handleContextMenuEvent(window, false, pos, 
globalPos, modifiers);
         }
         QWindowSystemInterface::handleExtendedKeyEvent(window, time, type, 
qtcode, modifiers,
                                                        code, sym, state, 
string, isAutoRepeat);
@@ -695,39 +739,29 @@
 FcitxQtInputContextProxy* QFcitxPlatformInputContext::validIC()
 {
     if (m_icMap.empty()) {
-        return 0;
+        return nullptr;
     }
     QWindow* window = qApp->focusWindow();
     return validICByWindow(window);
 }
 
-FcitxQtInputContextProxy* QFcitxPlatformInputContext::validICByWId(WId wid)
+FcitxQtInputContextProxy* QFcitxPlatformInputContext::validICByWindow(QWindow* 
w)
 {
+    if (!w) {
+        return nullptr;
+    }
+
     if (m_icMap.empty()) {
         return nullptr;
     }
-    auto iter = m_icMap.find(wid);
+    auto iter = m_icMap.find(w);
     if (iter == m_icMap.end())
         return nullptr;
     auto &data = iter->second;
-    if (data.proxy.isNull()) {
+    if (!data.proxy || !data.proxy->isValid()) {
         return nullptr;
-    } else if (data.proxy->isValid()) {
-        return data.proxy.data();
-    }
-    return nullptr;
-}
-
-FcitxQtInputContextProxy* QFcitxPlatformInputContext::validICByWindow(QWindow* 
w)
-{
-    if (!w) {
-        return 0;
-    }
-
-    if (m_icMap.empty()) {
-        return 0;
     }
-    return validICByWId(w->winId());
+    return data.proxy;
 }
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fcitx-qt5-1.0.5/platforminputcontext/qfcitxplatforminputcontext.h 
new/fcitx-qt5-1.0.6/platforminputcontext/qfcitxplatforminputcontext.h
--- old/fcitx-qt5-1.0.5/platforminputcontext/qfcitxplatforminputcontext.h       
2015-12-18 01:02:37.000000000 +0100
+++ new/fcitx-qt5-1.0.6/platforminputcontext/qfcitxplatforminputcontext.h       
2016-10-13 01:26:34.000000000 +0200
@@ -109,7 +109,7 @@
 };
 
 struct FcitxQtICData {
-    FcitxQtICData() : capacity(0), proxy(0), surroundingAnchor(-1), 
surroundingCursor(-1) {}
+    FcitxQtICData() : capacity(0), proxy(nullptr), surroundingAnchor(-1), 
surroundingCursor(-1) {}
     FcitxQtICData(const FcitxQtICData& that) = delete;
     ~FcitxQtICData() {
         if (proxy) {
@@ -120,7 +120,7 @@
         }
     }
     QFlags<FcitxCapacityFlags> capacity;
-    QPointer<FcitxQtInputContextProxy> proxy;
+    FcitxQtInputContextProxy *proxy;
     QRect rect;
     QString surroundingText;
     int surroundingAnchor;
@@ -144,7 +144,7 @@
     virtual ~ProcessKeyWatcher() {
     }
 
-    const QKeyEvent& event() {
+    const QKeyEvent& keyEvent() {
         return m_event;
     }
 
@@ -213,7 +213,7 @@
 
 
 private:
-    void createInputContext(WId w);
+    void createInputContext(QWindow *w);
     bool processCompose(uint keyval, uint state, FcitxKeyEventType event);
     QKeyEvent* createKeyEvent(uint keyval, uint state, int type);
 
@@ -240,7 +240,6 @@
     void createICData(QWindow* w);
     FcitxQtInputContextProxy* validIC();
     FcitxQtInputContextProxy* validICByWindow(QWindow* window);
-    FcitxQtInputContextProxy* validICByWId(WId wid);
     bool filterEventFallback(uint keyval, uint keycode, uint state, bool 
press);
 
     FcitxQtConnection* m_connection;
@@ -254,9 +253,8 @@
     QString m_lastSurroundingText;
     int m_lastSurroundingAnchor;
     int m_lastSurroundingCursor;
-    std::unordered_map<WId, FcitxQtICData> m_icMap;
-    std::unordered_map<QObject*, WId> m_windowToWidMap;
-    WId m_lastWId;
+    std::unordered_map<QWindow*, FcitxQtICData> m_icMap;
+    QPointer<QWindow> m_lastWindow;
     bool m_destroy;
     QScopedPointer<struct xkb_context, XkbContextDeleter> m_xkbContext;
     QScopedPointer<struct xkb_compose_table, XkbComposeTableDeleter>  
m_xkbComposeTable;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fcitx-qt5-1.0.5/widgetsaddons/fcitxqtkeysequencewidget.cpp 
new/fcitx-qt5-1.0.6/widgetsaddons/fcitxqtkeysequencewidget.cpp
--- old/fcitx-qt5-1.0.5/widgetsaddons/fcitxqtkeysequencewidget.cpp      
2015-12-18 01:02:37.000000000 +0100
+++ new/fcitx-qt5-1.0.6/widgetsaddons/fcitxqtkeysequencewidget.cpp      
2016-10-13 01:26:34.000000000 +0200
@@ -116,9 +116,9 @@
 
 
FcitxQtKeySequenceWidgetPrivate::FcitxQtKeySequenceWidgetPrivate(FcitxQtKeySequenceWidget
 *q)
     : q(q)
-     ,layout(NULL)
-     ,keyButton(NULL)
-     ,clearButton(NULL)
+     ,layout(nullptr)
+     ,keyButton(nullptr)
+     ,clearButton(nullptr)
      ,allowModifierless(false)
      ,nKey(0)
      ,modifierKeys(0)
@@ -134,9 +134,11 @@
 {
     d->init();
     setFocusProxy( d->keyButton );
-    connect(d->keyButton, SIGNAL(clicked()), this, SLOT(captureKeySequence()));
-    connect(d->clearButton, SIGNAL(clicked()), this, SLOT(clearKeySequence()));
-    connect(&d->modifierlessTimeout, SIGNAL(timeout()), this, 
SLOT(doneRecording()));
+    connect(d->keyButton, &QPushButton::clicked, this, 
&FcitxQtKeySequenceWidget::captureKeySequence);
+    connect(d->clearButton, &QPushButton::clicked, this, 
&FcitxQtKeySequenceWidget::clearKeySequence);
+    connect(&d->modifierlessTimeout, &QTimer::timeout, this, [this] () {
+        d->doneRecording();
+    });
     //TODO: how to adopt style changes at runtime?
     /*QFont modFont = d->clearButton->font();
     modFont.setStyleHint(QFont::TypeWriter);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fcitx-qt5-1.0.5/widgetsaddons/fcitxqtkeysequencewidget.h 
new/fcitx-qt5-1.0.6/widgetsaddons/fcitxqtkeysequencewidget.h
--- old/fcitx-qt5-1.0.5/widgetsaddons/fcitxqtkeysequencewidget.h        
2015-12-18 01:02:37.000000000 +0100
+++ new/fcitx-qt5-1.0.6/widgetsaddons/fcitxqtkeysequencewidget.h        
2016-10-13 01:26:34.000000000 +0200
@@ -123,9 +123,6 @@
     void clearKeySequence();
 
 private:
-    Q_PRIVATE_SLOT(d, void doneRecording())
-
-private:
     friend class FcitxQtKeySequenceWidgetPrivate;
     FcitxQtKeySequenceWidgetPrivate *const d;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx-qt5-1.0.5/widgetsaddons/qtkeytrans.cpp 
new/fcitx-qt5-1.0.6/widgetsaddons/qtkeytrans.cpp
--- old/fcitx-qt5-1.0.5/widgetsaddons/qtkeytrans.cpp    2015-12-18 
01:02:37.000000000 +0100
+++ new/fcitx-qt5-1.0.6/widgetsaddons/qtkeytrans.cpp    2016-10-13 
01:26:34.000000000 +0200
@@ -51,29 +51,29 @@
         if (sym)
             break;
 
-        QtCode2Key* result = NULL;
+        QtCode2Key* result = nullptr;
         if (mod & Qt::KeypadModifier) {
             result = qBinaryFind(keyPadQtCodeToKey, 
_ARRAY_END(keyPadQtCodeToKey), key);
             if (result == _ARRAY_END(keyPadQtCodeToKey))
-                result = NULL;
+                result = nullptr;
         }
         else {
             if (text.isNull()) {
                 result = qBinaryFind(qtCodeToKeyBackup, 
_ARRAY_END(qtCodeToKeyBackup), key);
                 if (result == _ARRAY_END(qtCodeToKeyBackup))
-                    result = NULL;
+                    result = nullptr;
             }
             if (!result) {
                 result = qBinaryFind(qtCodeToKey, _ARRAY_END(qtCodeToKey), 
key);
 
                 if (result == _ARRAY_END(qtCodeToKey))
-                    result = NULL;
+                    result = nullptr;
             }
 
             if (!result) {
                 result = qBinaryFind(keyPadQtCodeToKey, 
_ARRAY_END(keyPadQtCodeToKey), key);
                 if (result == _ARRAY_END(keyPadQtCodeToKey))
-                    result = NULL;
+                    result = nullptr;
             }
         }
 


Reply via email to