Navigation Menu

Skip to content

Commit

Permalink
[usb-moded] Use dbus_gmain instead of dbus-glib. JB#51115
Browse files Browse the repository at this point in the history
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
  • Loading branch information
Thaodan committed Sep 23, 2020
1 parent 34a9726 commit 384f992
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "dbus-gmain"]
path = dbus-gmain
url = https://github.com/sailfishos-mirror/dbus-glib.git
2 changes: 1 addition & 1 deletion Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS = src
SUBDIRS = dbus-gmain src

EXTRA_DIST = \
autogen.sh \
Expand Down
5 changes: 3 additions & 2 deletions configure.ac
@@ -1,5 +1,6 @@
AC_INIT([usb_moded], [0.86.0+mer47])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AM_EXTRA_RECURSIVE_TARGETS([dbus-gmain])

AM_CONFIG_HEADER([config.h])

Expand Down Expand Up @@ -102,7 +103,6 @@ PKG_CHECK_MODULES([DBUS], dbus-1 >= 1.8)
PKG_CHECK_MODULES([GLIB], glib-2.0 >= 2.24.0)
PKG_CHECK_MODULES([USB_MODED], [
glib-2.0 >= 2.24.0
dbus-glib-1 >= 0.78
gobject-2.0 >= 2.16.6
gio-2.0
libudev
Expand Down Expand Up @@ -138,6 +138,7 @@ AC_SUBST(USB_MODED_CFLAGS)

AC_CONFIG_FILES([
Makefile
dbus-gmain/Makefile
src/Makefile
usb_moded.pc
docs/usb_moded-doxygen.conf
Expand Down
1 change: 1 addition & 0 deletions dbus-gmain
Submodule dbus-gmain added at d42176
1 change: 0 additions & 1 deletion rpm/usb-moded.spec
Expand Up @@ -8,7 +8,6 @@ Source0: %{name}-%{version}.tar.bz2
Source1: usb_moded.conf

BuildRequires: pkgconfig(dbus-1) >= 1.8
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(libkmod)
Expand Down
4 changes: 3 additions & 1 deletion src/Makefile.am
Expand Up @@ -12,7 +12,9 @@ usb_moded_LDFLAGS = \
-Wl,--as-needed

usb_moded_LDADD = \
$(USB_MODED_LIBS)
$(USB_MODED_LIBS) \
$(DBUS_LIBS) \
$(top_srcdir)/dbus-gmain/libdbus-gmain.la

usb_moded_SOURCES = \
usb_moded.c \
Expand Down
5 changes: 3 additions & 2 deletions src/usb_moded-dbus.c
Expand Up @@ -15,6 +15,7 @@
* @author Simo Piiroinen <simo.piiroinen@jollamobile.com>
* @author Andrew den Exter <andrew.den.exter@jolla.com>
* @author Andrew den Exter <andrew.den.exter@jollamobile.com>
* @author Björn Bidar <bjorn.bidar@jolla.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Lesser GNU General Public License
Expand Down Expand Up @@ -44,7 +45,7 @@
#include <string.h>
#include <sys/stat.h>

#include <dbus/dbus-glib-lowlevel.h>
#include <dbus-gmain/dbus-gmain.h>

#ifdef SAILFISH_ACCESS_CONTROL
# include <sailfishaccesscontrol.h>
Expand Down Expand Up @@ -1366,7 +1367,7 @@ gboolean umdbus_init_connection(void)
usbmoded_probe_init_done();

/* Connect D-Bus to the mainloop */
dbus_connection_setup_with_g_main(umdbus_connection, NULL);
dbus_gmain_set_up_connection(umdbus_connection, NULL);

/* everything went fine */
status = TRUE;
Expand Down

0 comments on commit 384f992

Please sign in to comment.