Skip to content

Commit

Permalink
fix: isValid not work in flatpak
Browse files Browse the repository at this point in the history
Change-Id: Ia1986838b932ef9748a66bdf35cf7be5b8a74a85
  • Loading branch information
Iceyer committed Apr 3, 2018
1 parent 2d15299 commit 88095fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
5 changes: 2 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ endif
%:
dh $@ --parallel

#override_dh_auto_configure:
# dh_auto_configure -- LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) VERSION=$(CONFIG_VERSION)

override_dh_auto_configure:
dh_auto_configure -- LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH)
override_dh_makeshlibs:
dh_makeshlibs -V
23 changes: 5 additions & 18 deletions src/widgets/dapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,27 +670,14 @@ void DApplication::handleHelpAction()
QDBusInterface manual("com.deepin.Manual.Open",
"/com/deepin/Manual/Open",
"com.deepin.Manual.Open");
if (manual.isValid()) {
manual.asyncCall("ShowManual", appid);
QDBusReply<void> reply = manual.call("ShowManual", appid);
if (reply.isValid()) {
qDebug() << "call com.deepin.Manual.Open success";
return;
}

qDebug() << "call com.deepin.Manual.Open failed" << reply.error();
// fallback to old interface
if (!qgetenv("FLATPAK_APPID").isEmpty()) {
appid = qgetenv("FLATPAK_APPID");
QDBusInterface legacydman("com.deepin.dman",
"/com/deepin/dman",
"com.deepin.dman");
if (legacydman.isValid()) {
// will block application
legacydman.call("ShowManual", appid);
return;
}

qWarning() << "can not call dman dbus interface";
} else {
QProcess::startDetached("dman", QStringList() << appid);
}
QProcess::startDetached("dman", QStringList() << appid);
#else
qWarning() << "not support dman now";
#endif
Expand Down

0 comments on commit 88095fd

Please sign in to comment.