Refactor CMake files

This commit is contained in:
Jonas Kvinge
2024-10-03 22:32:51 +02:00
parent 525ebbb9b7
commit 0768298b95
43 changed files with 1494 additions and 1768 deletions

View File

@@ -21,7 +21,7 @@
#include "config.h"
#ifdef HAVE_LIBGPOD
#ifdef HAVE_GPOD
# include <gpod/itdb.h>
#endif
@@ -107,7 +107,7 @@ void DeviceLister::Exit() {
namespace {
#ifdef HAVE_LIBGPOD
#ifdef HAVE_GPOD
QString GetIpodColour(Itdb_IpodModel model) {
@@ -237,7 +237,7 @@ QVariantList DeviceLister::GuessIconForPath(const QString &path) {
QVariantList ret;
#ifdef HAVE_LIBGPOD
#ifdef HAVE_GPOD
if (IsIpod(path)) {
Itdb_Device *device = itdb_device_new();
itdb_device_set_mountpoint(device, path.toLocal8Bit().constData());

View File

@@ -69,18 +69,16 @@
# include "cddalister.h"
# include "cddadevice.h"
#endif
#ifdef HAVE_DBUS
# ifdef HAVE_UDISKS2
# include "udisks2lister.h"
# endif
#ifdef HAVE_UDISKS2
# include "udisks2lister.h"
#endif
#ifdef HAVE_LIBMTP
#ifdef HAVE_MTP
# include "mtpdevice.h"
#endif
#if defined(Q_OS_MACOS) and defined(HAVE_LIBMTP)
#ifdef Q_OS_MACOS
# include "macosdevicelister.h"
#endif
#ifdef HAVE_LIBGPOD
#ifdef HAVE_GPOD
# include "gpoddevice.h"
#endif
@@ -118,13 +116,13 @@ DeviceManager::DeviceManager(Application *app, QObject *parent)
#if defined(HAVE_AUDIOCD) && !defined(Q_OS_MACOS)
AddLister(new CddaLister);
#endif
#if defined(HAVE_DBUS) && defined(HAVE_UDISKS2)
#ifdef HAVE_UDISKS2
AddLister(new Udisks2Lister);
#endif
#ifdef HAVE_GIO
AddLister(new GioLister);
#endif
#if defined(Q_OS_MACOS) and defined(HAVE_LIBMTP)
#ifdef Q_OS_MACOS
AddLister(new MacOsDeviceLister);
#endif
@@ -134,11 +132,11 @@ DeviceManager::DeviceManager(Application *app, QObject *parent)
AddDeviceClass<FilesystemDevice>();
#ifdef HAVE_LIBGPOD
#ifdef HAVE_GPOD
AddDeviceClass<GPodDevice>();
#endif
#ifdef HAVE_LIBMTP
#ifdef HAVE_MTP
AddDeviceClass<MtpDevice>();
#endif

View File

@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.ObjectManager">
<method name="GetManagedObjects">
<arg name="objects" type="a{oa{sa{sv}}}" direction="out" />
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="ManagedObjectList" />
</method>
<signal name="InterfacesAdded">
<arg name="object" type="o" />
<arg name="interfaces" type="a{sa{sv}}" direction="out" />
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="InterfacesAndProperties" />
</signal>
<signal name="InterfacesRemoved">
<arg type="o" name="object_path" />
<arg type="as" name="interfaces" />
</signal>
</interface>
</node>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.UDisks2.Block">
<property type="o" name="Drive" access="read"/>
<property type="s" name="IdLabel" access="read"/>
<property type="s" name="IdUUID" access="read"/>
</interface>
</node>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.UDisks2.Drive">
<method name="Eject">
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
</method>
<property type="s" name="Vendor" access="read"/>
<property type="s" name="Model" access="read"/>
<property type="s" name="Revision" access="read"/>
<property type="s" name="Serial" access="read"/>
<property type="s" name="Id" access="read"/>
<property type="b" name="MediaRemovable" access="read"/>
<property type="t" name="Size" access="read"/>
</interface>
</node>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.UDisks2.Filesystem">
<method name="Mount">
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
<arg type="s" name="mount_path" direction="out"/>
</method>
<method name="Unmount">
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
</method>
<property type="aay" name="MountPoints" access="read">
<annotation name="org.qtproject.QtDBus.QtTypeName" value="QList&lt;QByteArray&gt;"/>
</property>
</interface>
</node>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
<interface name="org.freedesktop.UDisks2.Job">
<property name="Operation" type="s" access="read"/>
<property name="Objects" type="ao" access="read"/>
<signal name="Completed">
<arg name="success" type="b"/>
<arg name="message" type="s"/>
</signal>
</interface>
</node>

View File

@@ -40,8 +40,8 @@
#include "core/scoped_ptr.h"
#include "core/shared_ptr.h"
#include "core/dbus_metatypes.h"
#include "dbus/metatypes.h"
#include "devicelister.h"
class OrgFreedesktopDBusObjectManagerInterface;