Hello community, here is the log from the commit of package fcitx for openSUSE:Factory checked in at 2012-10-03 07:11:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fcitx (Old) and /work/SRC/openSUSE:Factory/.fcitx.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fcitx", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/fcitx/fcitx.changes 2012-09-17 01:29:20.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.fcitx.new/fcitx.changes 2012-10-03 07:11:21.000000000 +0200 @@ -1,0 +2,7 @@ +Sun Sep 23 13:32:25 UTC 2012 - [email protected] + +- fix openSUSE 12.1 and below build + * 4.2.6 uses a Qt 4.8+ only function (QDBusConnection) so it fails on 12.1 and below. + * weng fix it. + +------------------------------------------------------------------- New: ---- fcitx-4.2.6-openSUSE-12.1-QDBusConnection.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fcitx.spec ++++++ --- /var/tmp/diff_new_pack.GEac0Q/_old 2012-10-03 07:11:23.000000000 +0200 +++ /var/tmp/diff_new_pack.GEac0Q/_new 2012-10-03 07:11:23.000000000 +0200 @@ -38,6 +38,8 @@ Source8: openSUSE-default.tar.gz #FIX-FOR-UPSTREAM [email protected] - dont download online #Patch1: fix_fcitx_googlecode_resolv_error.patch +#FIX-FOR-OPENSUSE [email protected] - fix QDBusConnection in Qt 4.7 +Patch2: fcitx-4.2.6-openSUSE-12.1-QDBusConnection.patch BuildRequires: cairo-devel %if 0%{?suse_version} BuildRequires: dbus-1-devel @@ -358,6 +360,9 @@ %prep %setup -q -n %{name}-%{version} #%patch1 -p1 +%if 0%{?suse_version} <= 1210 +%patch2 -p1 +%endif %build mkdir build ++++++ fcitx-4.2.6-openSUSE-12.1-QDBusConnection.patch ++++++ diff --git a/src/frontend/qt/fcitx-input-context.cpp b/src/frontend/qt/fcitx-input-context.cpp index 5ba941b..6e5a9d9 100644 --- a/src/frontend/qt/fcitx-input-context.cpp +++ b/src/frontend/qt/fcitx-input-context.cpp @@ -113,11 +113,37 @@ typedef QInputMethodEvent::Attribute QAttribute; static bool key_filtered = false; +QByteArray QFcitxInputContext::localMachineId() +{ +#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0) + return QDBusConnection::localMachineId(); +#else + QFile file1("/var/lib/dbus/machine-id"); + QFile file2("/etc/machine-id"); + QFile* fileToRead = NULL; + if (file1.open(QIODevice::ReadOnly)) { + fileToRead = &file1; + } + else if (file2.open(QIODevice::ReadOnly)) { + fileToRead = &file2; + } + if (fileToRead) { + QByteArray result = fileToRead->readLine(1024); + fileToRead->close(); + result = result.trimmed(); + if (!result.isEmpty()) + return result; + } + return "machine-id"; +#endif +} + QString QFcitxInputContext::socketFile() { char* addressFile = NULL; - asprintf(&addressFile, "%s-%d", QDBusConnection::localMachineId().data(), fcitx_utils_get_display_number()); + + asprintf(&addressFile, "%s-%d", localMachineId().data(), fcitx_utils_get_display_number()); char* file = NULL; diff --git a/src/frontend/qt/fcitx-input-context.h b/src/frontend/qt/fcitx-input-context.h index 6c7ecf4..ed7d2db 100644 --- a/src/frontend/qt/fcitx-input-context.h +++ b/src/frontend/qt/fcitx-input-context.h @@ -102,6 +102,7 @@ private Q_SLOTS: void updateCursor(); #endif private: + static QByteArray localMachineId(); static QString socketFile(); static QString address(); void cleanUp(); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
