Skip to content

Commit 75ff054

Browse files
committed
Dbus: adds 2nd argument to ffDBusGetMethodReply
1 parent c51cc8c commit 75ff054

File tree

7 files changed

+16
-9
lines changed

7 files changed

+16
-9
lines changed

src/common/dbus.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,19 @@ bool ffDBusGetUint(FFDBusData* dbus, DBusMessageIter* iter, uint32_t* result)
162162
return ffDBusGetUint(dbus, &subIter, result);
163163
}
164164

165-
DBusMessage* ffDBusGetMethodReply(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* method, const char* arg)
165+
DBusMessage* ffDBusGetMethodReply(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* method, const char* arg1, const char* arg2)
166166
{
167167
DBusMessage* message = dbus->lib->ffdbus_message_new_method_call(busName, objectPath, interface, method);
168168
if(message == NULL)
169169
return NULL;
170170

171-
if (arg)
172-
dbus->lib->ffdbus_message_append_args(message, DBUS_TYPE_STRING, &arg, DBUS_TYPE_INVALID);
171+
if (arg1)
172+
{
173+
if (arg2)
174+
dbus->lib->ffdbus_message_append_args(message, DBUS_TYPE_STRING, &arg1, DBUS_TYPE_STRING, &arg2, DBUS_TYPE_INVALID);
175+
else
176+
dbus->lib->ffdbus_message_append_args(message, DBUS_TYPE_STRING, &arg1, DBUS_TYPE_INVALID);
177+
}
173178

174179
DBusMessage* reply = dbus->lib->ffdbus_connection_send_with_reply_and_block(dbus->connection, message, instance.config.general.processingTimeout, NULL);
175180

src/common/dbus.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ const char* ffDBusLoadData(DBusBusType busType, FFDBusData* data); //Returns an
3131
bool ffDBusGetString(FFDBusData* dbus, DBusMessageIter* iter, FFstrbuf* result);
3232
bool ffDBusGetBool(FFDBusData* dbus, DBusMessageIter* iter, bool* result);
3333
bool ffDBusGetUint(FFDBusData* dbus, DBusMessageIter* iter, uint32_t* result);
34-
DBusMessage* ffDBusGetMethodReply(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* method, const char* arg);
34+
DBusMessage* ffDBusGetMethodReply(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* method, const char* arg1, const char* arg2);
3535
DBusMessage* ffDBusGetProperty(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property);
3636
bool ffDBusGetPropertyString(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, FFstrbuf* result);
3737
bool ffDBusGetPropertyUint(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface, const char* property, uint32_t* result);
3838

3939
static inline DBusMessage* ffDBusGetAllProperties(FFDBusData* dbus, const char* busName, const char* objectPath, const char* interface)
4040
{
41-
return ffDBusGetMethodReply(dbus, busName, objectPath, "org.freedesktop.DBus.Properties", "GetAll", interface);
41+
return ffDBusGetMethodReply(dbus, busName, objectPath, "org.freedesktop.DBus.Properties", "GetAll", interface, NULL);
4242
}
4343

4444
#endif // FF_HAVE_DBUS

src/detection/bluetooth/bluetooth_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static const char* detectBluetooth(FFlist* devices, int32_t connectedCount)
196196
if(error)
197197
return error;
198198

199-
DBusMessage* managedObjects = ffDBusGetMethodReply(&dbus, "org.bluez", "/", "org.freedesktop.DBus.ObjectManager", "GetManagedObjects", NULL);
199+
DBusMessage* managedObjects = ffDBusGetMethodReply(&dbus, "org.bluez", "/", "org.freedesktop.DBus.ObjectManager", "GetManagedObjects", NULL, NULL);
200200
if(!managedObjects)
201201
return "Failed to call GetManagedObjects";
202202

src/detection/bluetoothradio/bluetoothradio_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static const char* detectBluetoothRoot(FFBluetoothRadioResult* device, const cha
7777
char objPath[300];
7878
snprintf(objPath, sizeof(objPath), "/org/bluez/%s", hciName);
7979

80-
DBusMessage* properties = ffDBusGetMethodReply(dbus, "org.bluez", objPath, "org.freedesktop.DBus.Properties", "GetAll", "org.bluez.Adapter1");
80+
DBusMessage* properties = ffDBusGetMethodReply(dbus, "org.bluez", objPath, "org.freedesktop.DBus.Properties", "GetAll", "org.bluez.Adapter1", NULL);
8181
if(!properties)
8282
return "Failed to call org.freedesktop.DBus.Properties.GetAll";
8383

src/detection/gtk_qt/gtk.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ static void detectGTKFromSettings(FFGTKResult* result)
6565
wallpaper = ffSettingsGetXFConf("xfce4-desktop", "/backdrop/screen0/monitor0/workspace0/last-image", FF_VARIANT_TYPE_STRING).strValue;
6666
if (!wallpaper) // FIXME: find a way to enumerate possible properties
6767
wallpaper = ffSettingsGetXFConf("xfce4-desktop", "/backdrop/screen0/monitoreDP-1/workspace0/last-image", FF_VARIANT_TYPE_STRING).strValue;
68+
if (!wallpaper)
69+
wallpaper = ffSettingsGetXFConf("xfce4-desktop", "/backdrop/screen0/monitorbuiltin/workspace0/last-image", FF_VARIANT_TYPE_STRING).strValue;
6870
}
6971
else if(ffStrbufIgnCaseCompS(&wmde->dePrettyName, FF_DE_PRETTY_CINNAMON) == 0)
7072
{

src/detection/media/media_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static void getBestBus(FFDBusData* data, FFMediaResult* result)
191191
getBusProperties(data, FF_DBUS_MPRIS_PREFIX "plasma-browser-integration", result)
192192
) return;
193193

194-
DBusMessage* reply = ffDBusGetMethodReply(data, "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus", "ListNames", NULL);
194+
DBusMessage* reply = ffDBusGetMethodReply(data, "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus", "ListNames", NULL, NULL);
195195
if(reply == NULL)
196196
return;
197197

src/detection/wifi/wifi_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static const char* detectWifiWithNm(FFWifiResult* item, FFstrbuf* buffer)
5757

5858
{
5959
FF_DEBUG("Getting device by IP interface name");
60-
DBusMessage* device = ffDBusGetMethodReply(&dbus, "org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager", "org.freedesktop.NetworkManager", "GetDeviceByIpIface", item->inf.description.chars);
60+
DBusMessage* device = ffDBusGetMethodReply(&dbus, "org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager", "org.freedesktop.NetworkManager", "GetDeviceByIpIface", item->inf.description.chars, NULL);
6161
if(!device)
6262
{
6363
FF_DEBUG("GetDeviceByIpIface failed for interface %s", item->inf.description.chars);

0 commit comments

Comments
 (0)