rebase udisks2 backend against KDE/4.10 branch

This commit is contained in:
Lukas Tinkl 2012-09-04 22:58:12 +02:00
parent 81ae9a9576
commit e0348dd554
4 changed files with 153 additions and 346 deletions

View File

@ -1,8 +1,8 @@
diff --git a/tier1/solid/src/solid/backends/udisks2/dbus/manager.cpp b/tier1/solid/src/solid/backends/udisks2/dbus/manager.cpp
diff --git a/solid/solid/backends/udisks2/dbus/manager.cpp b/solid/solid/backends/udisks2/dbus/manager.cpp
new file mode 100644
index 0000000..7ea4aa8
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/dbus/manager.cpp
+++ b/solid/solid/backends/udisks2/dbus/manager.cpp
@@ -0,0 +1,26 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.7
@ -30,11 +30,11 @@ index 0000000..7ea4aa8
+{
+}
+
diff --git a/tier1/solid/src/solid/backends/udisks2/dbus/manager.h b/tier1/solid/src/solid/backends/udisks2/dbus/manager.h
diff --git a/solid/solid/backends/udisks2/dbus/manager.h b/solid/solid/backends/udisks2/dbus/manager.h
new file mode 100644
index 0000000..11f0be8
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/dbus/manager.h
+++ b/solid/solid/backends/udisks2/dbus/manager.h
@@ -0,0 +1,59 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.7
@ -95,11 +95,11 @@ index 0000000..11f0be8
+ }
+}
+#endif
diff --git a/tier1/solid/src/solid/backends/udisks2/dbus/manager.xml b/tier1/solid/src/solid/backends/udisks2/dbus/manager.xml
diff --git a/solid/solid/backends/udisks2/dbus/manager.xml b/solid/solid/backends/udisks2/dbus/manager.xml
new file mode 100644
index 0000000..8f25cb6
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/dbus/manager.xml
+++ b/solid/solid/backends/udisks2/dbus/manager.xml
@@ -0,0 +1,21 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
@ -122,11 +122,11 @@ index 0000000..8f25cb6
+ </signal>
+ </interface>
+</node>
diff --git a/tier1/solid/src/solid/backends/udisks2/udisks2.h b/tier1/solid/src/solid/backends/udisks2/udisks2.h
diff --git a/solid/solid/backends/udisks2/udisks2.h b/solid/solid/backends/udisks2/udisks2.h
new file mode 100644
index 0000000..25a1dc0
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisks2.h
+++ b/solid/solid/backends/udisks2/udisks2.h
@@ -0,0 +1,77 @@
+/*
+ Copyright 2012 Lukáš Tinkl <ltinkl@redhat.com>
@ -205,11 +205,11 @@ index 0000000..25a1dc0
+#define UD2_ERROR_NOT_AUTHORIZED_DISMISSED "org.freedesktop.UDisks2.Error.NotAuthorizedDismissed"
+
+#endif // SOLID_BACKENDS_UDISKS2_H
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksblock.cpp b/tier1/solid/src/solid/backends/udisks2/udisksblock.cpp
diff --git a/solid/solid/backends/udisks2/udisksblock.cpp b/solid/solid/backends/udisks2/udisksblock.cpp
new file mode 100644
index 0000000..474f3d6
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksblock.cpp
+++ b/solid/solid/backends/udisks2/udisksblock.cpp
@@ -0,0 +1,84 @@
+/*
+ Copyright 2012 Lukáš Tinkl <ltinkl@redhat.com>
@ -295,11 +295,11 @@ index 0000000..474f3d6
+{
+ return MAJOR(m_devNum);
+}
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksblock.h b/tier1/solid/src/solid/backends/udisks2/udisksblock.h
diff --git a/solid/solid/backends/udisks2/udisksblock.h b/solid/solid/backends/udisks2/udisksblock.h
new file mode 100644
index 0000000..19cb70a
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksblock.h
+++ b/solid/solid/backends/udisks2/udisksblock.h
@@ -0,0 +1,56 @@
+/*
+ Copyright 2012 Lukáš Tinkl <ltinkl@redhat.com>
@ -357,11 +357,11 @@ index 0000000..19cb70a
+}
+
+#endif // UDISKS2BLOCK_H
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksdevice.cpp b/tier1/solid/src/solid/backends/udisks2/udisksdevice.cpp
diff --git a/solid/solid/backends/udisks2/udisksdevice.cpp b/solid/solid/backends/udisks2/udisksdevice.cpp
new file mode 100644
index 0000000..3076278
index 0000000..22b0c45
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksdevice.cpp
+++ b/solid/solid/backends/udisks2/udisksdevice.cpp
@@ -0,0 +1,910 @@
+/*
+ Copyright 2010 Michael Zanetti <mzanetti@kde.org>
@ -425,31 +425,31 @@ index 0000000..3076278
+ {
+ size /= 1073741824.0;
+ if ( size > 1024 ) // Tebi-byte
+ s = QObject::tr("%1 TiB").arg(QLocale().toString(size / 1024.0, 'f', 1));
+ s = QCoreApplication::translate("", "%1 TiB").arg(QLocale().toString(size / 1024.0, 'f', 1));
+ else
+ s = QObject::tr("%1 GiB").arg(QLocale().toString(size, 'f', 1));
+ s = QCoreApplication::translate("", "%1 GiB").arg(QLocale().toString(size, 'f', 1));
+ }
+ // Mebi-byte
+ else if ( size >= 1048576.0 )
+ {
+ size /= 1048576.0;
+ s = QObject::tr("%1 MiB").arg(QLocale().toString(size, 'f', 1));
+ s = QCoreApplication::translate("", "%1 MiB").arg(QLocale().toString(size, 'f', 1));
+ }
+ // Kibi-byte
+ else if ( size >= 1024.0 )
+ {
+ size /= 1024.0;
+ s = QObject::tr("%1 KiB").arg(QLocale().toString(size, 'f', 1));
+ s = QCoreApplication::translate("", "%1 KiB").arg(QLocale().toString(size, 'f', 1));
+ }
+ // Just byte
+ else if ( size > 0 )
+ {
+ s = QObject::tr("%1 B").arg(QLocale().toString(size, 'f', 1));
+ s = QCoreApplication::translate("", "%1 B").arg(QLocale().toString(size, 'f', 1));
+ }
+ // Nothing
+ else
+ {
+ s = QObject::tr("0 B");
+ s = QCoreApplication::translate("", "0 B");
+ }
+ return s;
+}
@ -592,24 +592,24 @@ index 0000000..3076278
+ QString first;
+ QString second;
+
+ first = QObject::tr("CD-ROM", "First item of %1%2 Drive sentence");
+ first = QCoreApplication::translate("", "CD-ROM", "First item of %1%2 Drive sentence");
+ if (mediumTypes & Solid::OpticalDrive::Cdr)
+ first = QObject::tr("CD-R", "First item of %1%2 Drive sentence");
+ first = QCoreApplication::translate("", "CD-R", "First item of %1%2 Drive sentence");
+ if (mediumTypes & Solid::OpticalDrive::Cdrw)
+ first = QObject::tr("CD-RW", "First item of %1%2 Drive sentence");
+ first = QCoreApplication::translate("", "CD-RW", "First item of %1%2 Drive sentence");
+
+ if (mediumTypes & Solid::OpticalDrive::Dvd)
+ second = QObject::tr("/DVD-ROM", "Second item of %1%2 Drive sentence");
+ second = QCoreApplication::translate("", "/DVD-ROM", "Second item of %1%2 Drive sentence");
+ if (mediumTypes & Solid::OpticalDrive::Dvdplusr)
+ second = QObject::tr("/DVD+R", "Second item of %1%2 Drive sentence");
+ second = QCoreApplication::translate("", "/DVD+R", "Second item of %1%2 Drive sentence");
+ if (mediumTypes & Solid::OpticalDrive::Dvdplusrw)
+ second = QObject::tr("/DVD+RW", "Second item of %1%2 Drive sentence");
+ second = QCoreApplication::translate("", "/DVD+RW", "Second item of %1%2 Drive sentence");
+ if (mediumTypes & Solid::OpticalDrive::Dvdr)
+ second = QObject::tr("/DVD-R", "Second item of %1%2 Drive sentence");
+ second = QCoreApplication::translate("", "/DVD-R", "Second item of %1%2 Drive sentence");
+ if (mediumTypes & Solid::OpticalDrive::Dvdrw)
+ second = QObject::tr("/DVD-RW", "Second item of %1%2 Drive sentence");
+ second = QCoreApplication::translate("", "/DVD-RW", "Second item of %1%2 Drive sentence");
+ if (mediumTypes & Solid::OpticalDrive::Dvdram)
+ second = QObject::tr("/DVD-RAM", "Second item of %1%2 Drive sentence");
+ second = QCoreApplication::translate("", "/DVD-RAM", "Second item of %1%2 Drive sentence");
+ if ((mediumTypes & Solid::OpticalDrive::Dvdr) && (mediumTypes & Solid::OpticalDrive::Dvdplusr))
+ {
+ if(mediumTypes & Solid::OpticalDrive::Dvdplusdl)
@ -625,22 +625,22 @@ index 0000000..3076278
+ second = QObject::trUtf8("/DVD±RW", "Second item of %1%2 Drive sentence");
+ }
+ if (mediumTypes & Solid::OpticalDrive::Bd)
+ second = QObject::tr("/BD-ROM", "Second item of %1%2 Drive sentence");
+ second = QCoreApplication::translate("", "/BD-ROM", "Second item of %1%2 Drive sentence");
+ if (mediumTypes & Solid::OpticalDrive::Bdr)
+ second = QObject::tr("/BD-R", "Second item of %1%2 Drive sentence");
+ second = QCoreApplication::translate("", "/BD-R", "Second item of %1%2 Drive sentence");
+ if (mediumTypes & Solid::OpticalDrive::Bdre)
+ second = QObject::tr("/BD-RE", "Second item of %1%2 Drive sentence");
+ second = QCoreApplication::translate("", "/BD-RE", "Second item of %1%2 Drive sentence");
+ if (mediumTypes & Solid::OpticalDrive::HdDvd)
+ second = QObject::tr("/HD DVD-ROM", "Second item of %1%2 Drive sentence");
+ second = QCoreApplication::translate("", "/HD DVD-ROM", "Second item of %1%2 Drive sentence");
+ if (mediumTypes & Solid::OpticalDrive::HdDvdr)
+ second = QObject::tr("/HD DVD-R", "Second item of %1%2 Drive sentence");
+ second = QCoreApplication::translate("", "/HD DVD-R", "Second item of %1%2 Drive sentence");
+ if (mediumTypes & Solid::OpticalDrive::HdDvdrw)
+ second = QObject::tr("/HD DVD-RW", "Second item of %1%2 Drive sentence");
+ second = QCoreApplication::translate("", "/HD DVD-RW", "Second item of %1%2 Drive sentence");
+
+ if (drive_is_hotpluggable)
+ description = QObject::tr("External %1%2 Drive", "%1 is CD-ROM/CD-R/etc; %2 is '/DVD-ROM'/'/DVD-R'/etc (with leading slash)").arg(first).arg(second);
+ description = QCoreApplication::translate("", "External %1%2 Drive", "%1 is CD-ROM/CD-R/etc; %2 is '/DVD-ROM'/'/DVD-R'/etc (with leading slash)").arg(first).arg(second);
+ else
+ description = QObject::tr("%1%2 Drive", "%1 is CD-ROM/CD-R/etc; %2 is '/DVD-ROM'/'/DVD-R'/etc (with leading slash)").arg(first).arg(second);
+ description = QCoreApplication::translate("", "%1%2 Drive", "%1 is CD-ROM/CD-R/etc; %2 is '/DVD-ROM'/'/DVD-R'/etc (with leading slash)").arg(first).arg(second);
+
+ return description;
+ }
@ -648,9 +648,9 @@ index 0000000..3076278
+ if (drive_type == Solid::StorageDrive::Floppy)
+ {
+ if (drive_is_hotpluggable)
+ description = QObject::tr("External Floppy Drive");
+ description = QCoreApplication::translate("", "External Floppy Drive");
+ else
+ description = QObject::tr("Floppy Drive");
+ description = QCoreApplication::translate("", "Floppy Drive");
+
+ return description;
+ }
@ -663,14 +663,14 @@ index 0000000..3076278
+ if (!size_str.isEmpty())
+ {
+ if (drive_is_hotpluggable)
+ description = QObject::tr("%1 External Hard Drive", "%1 is the size").arg(size_str);
+ description = QCoreApplication::translate("", "%1 External Hard Drive", "%1 is the size").arg(size_str);
+ else
+ description = QObject::tr("%1 Hard Drive", "%1 is the size").arg(size_str);
+ description = QCoreApplication::translate("", "%1 Hard Drive", "%1 is the size").arg(size_str);
+ } else {
+ if (drive_is_hotpluggable)
+ description = QObject::tr("External Hard Drive");
+ description = QCoreApplication::translate("", "External Hard Drive");
+ else
+ description = QObject::tr("Hard Drive");
+ description = QCoreApplication::translate("", "Hard Drive");
+ }
+
+ return description;
@ -698,13 +698,13 @@ index 0000000..3076278
+ }
+ else
+ {
+ vendormodel_str = QObject::tr("%1 %2", "%1 is the vendor, %2 is the model of the device").arg(vendor_str).arg(model);
+ vendormodel_str = QCoreApplication::translate("", "%1 %2", "%1 is the vendor, %2 is the model of the device").arg(vendor_str).arg(model);
+ }
+ }
+ }
+
+ if (vendormodel_str.isEmpty())
+ description = QObject::tr("Drive");
+ description = QCoreApplication::translate("", "Drive");
+ else
+ description = vendormodel_str;
+
@ -733,116 +733,116 @@ index 0000000..3076278
+ {
+ case Solid::OpticalDisc::UnknownDiscType:
+ case Solid::OpticalDisc::CdRom:
+ description = QObject::tr("CD-ROM");
+ description = QCoreApplication::translate("", "CD-ROM");
+ break;
+
+ case Solid::OpticalDisc::CdRecordable:
+ if (disc.isBlank())
+ description = QObject::tr("Blank CD-R");
+ description = QCoreApplication::translate("", "Blank CD-R");
+ else
+ description = QObject::tr("CD-R");
+ description = QCoreApplication::translate("", "CD-R");
+ break;
+
+ case Solid::OpticalDisc::CdRewritable:
+ if (disc.isBlank())
+ description = QObject::tr("Blank CD-RW");
+ description = QCoreApplication::translate("", "Blank CD-RW");
+ else
+ description = QObject::tr("CD-RW");
+ description = QCoreApplication::translate("", "CD-RW");
+ break;
+
+ case Solid::OpticalDisc::DvdRom:
+ description = QObject::tr("DVD-ROM");
+ description = QCoreApplication::translate("", "DVD-ROM");
+ break;
+
+ case Solid::OpticalDisc::DvdRam:
+ if (disc.isBlank())
+ description = QObject::tr("Blank DVD-RAM");
+ description = QCoreApplication::translate("", "Blank DVD-RAM");
+ else
+ description = QObject::tr("DVD-RAM");
+ description = QCoreApplication::translate("", "DVD-RAM");
+ break;
+
+ case Solid::OpticalDisc::DvdRecordable:
+ if (disc.isBlank())
+ description = QObject::tr("Blank DVD-R");
+ description = QCoreApplication::translate("", "Blank DVD-R");
+ else
+ description = QObject::tr("DVD-R");
+ description = QCoreApplication::translate("", "DVD-R");
+ break;
+
+ case Solid::OpticalDisc::DvdPlusRecordableDuallayer:
+ if (disc.isBlank())
+ description = QObject::tr("Blank DVD+R Dual-Layer");
+ description = QCoreApplication::translate("", "Blank DVD+R Dual-Layer");
+ else
+ description = QObject::tr("DVD+R Dual-Layer");
+ description = QCoreApplication::translate("", "DVD+R Dual-Layer");
+ break;
+
+ case Solid::OpticalDisc::DvdRewritable:
+ if (disc.isBlank())
+ description = QObject::tr("Blank DVD-RW");
+ description = QCoreApplication::translate("", "Blank DVD-RW");
+ else
+ description = QObject::tr("DVD-RW");
+ description = QCoreApplication::translate("", "DVD-RW");
+ break;
+
+ case Solid::OpticalDisc::DvdPlusRecordable:
+ if (disc.isBlank())
+ description = QObject::tr("Blank DVD+R");
+ description = QCoreApplication::translate("", "Blank DVD+R");
+ else
+ description = QObject::tr("DVD+R");
+ description = QCoreApplication::translate("", "DVD+R");
+ break;
+
+ case Solid::OpticalDisc::DvdPlusRewritable:
+ if (disc.isBlank())
+ description = QObject::tr("Blank DVD+RW");
+ description = QCoreApplication::translate("", "Blank DVD+RW");
+ else
+ description = QObject::tr("DVD+RW");
+ description = QCoreApplication::translate("", "DVD+RW");
+ break;
+
+ case Solid::OpticalDisc::DvdPlusRewritableDuallayer:
+ if (disc.isBlank())
+ description = QObject::tr("Blank DVD+RW Dual-Layer");
+ description = QCoreApplication::translate("", "Blank DVD+RW Dual-Layer");
+ else
+ description = QObject::tr("DVD+RW Dual-Layer");
+ description = QCoreApplication::translate("", "DVD+RW Dual-Layer");
+ break;
+
+ case Solid::OpticalDisc::BluRayRom:
+ description = QObject::tr("BD-ROM");
+ description = QCoreApplication::translate("", "BD-ROM");
+ break;
+
+ case Solid::OpticalDisc::BluRayRecordable:
+ if (disc.isBlank())
+ description = QObject::tr("Blank BD-R");
+ description = QCoreApplication::translate("", "Blank BD-R");
+ else
+ description = QObject::tr("BD-R");
+ description = QCoreApplication::translate("", "BD-R");
+ break;
+
+ case Solid::OpticalDisc::BluRayRewritable:
+ if (disc.isBlank())
+ description = QObject::tr("Blank BD-RE");
+ description = QCoreApplication::translate("", "Blank BD-RE");
+ else
+ description = QObject::tr("BD-RE");
+ description = QCoreApplication::translate("", "BD-RE");
+ break;
+
+ case Solid::OpticalDisc::HdDvdRom:
+ description = QObject::tr("HD DVD-ROM");
+ description = QCoreApplication::translate("", "HD DVD-ROM");
+ break;
+
+ case Solid::OpticalDisc::HdDvdRecordable:
+ if (disc.isBlank())
+ description = QObject::tr("Blank HD DVD-R");
+ description = QCoreApplication::translate("", "Blank HD DVD-R");
+ else
+ description = QObject::tr("HD DVD-R");
+ description = QCoreApplication::translate("", "HD DVD-R");
+ break;
+
+ case Solid::OpticalDisc::HdDvdRewritable:
+ if (disc.isBlank())
+ description = QObject::tr("Blank HD DVD-RW");
+ description = QCoreApplication::translate("", "Blank HD DVD-RW");
+ else
+ description = QObject::tr("HD DVD-RW");
+ description = QCoreApplication::translate("", "HD DVD-RW");
+ break;
+ }
+
+ // Special case for pure audio disc
+ if (disc.availableContent() == Solid::OpticalDisc::Audio)
+ description = QObject::tr("Audio CD");
+ description = QCoreApplication::translate("", "Audio CD");
+
+ return description;
+ }
@ -854,33 +854,33 @@ index 0000000..3076278
+ if (isEncryptedContainer())
+ {
+ if (!size_str.isEmpty())
+ description = QObject::tr("%1 Encrypted Container", "%1 is the size").arg(size_str);
+ description = QCoreApplication::translate("", "%1 Encrypted Container", "%1 is the size").arg(size_str);
+ else
+ description = QObject::tr("Encrypted Container");
+ description = QCoreApplication::translate("", "Encrypted Container");
+ }
+ else if (drive_type == Solid::StorageDrive::HardDisk && !drive_is_removable)
+ {
+ if (!size_str.isEmpty())
+ {
+ if (drive_is_hotpluggable)
+ description = QObject::tr("%1 External Hard Drive", "%1 is the size").arg(size_str);
+ description = QCoreApplication::translate("", "%1 External Hard Drive", "%1 is the size").arg(size_str);
+ else
+ description = QObject::tr("%1 Hard Drive", "%1 is the size").arg(size_str);
+ description = QCoreApplication::translate("", "%1 Hard Drive", "%1 is the size").arg(size_str);
+ }
+ else
+ {
+ if (drive_is_hotpluggable)
+ description = QObject::tr("External Hard Drive");
+ description = QCoreApplication::translate("", "External Hard Drive");
+ else
+ description = QObject::tr("Hard Drive");
+ description = QCoreApplication::translate("", "Hard Drive");
+ }
+ }
+ else
+ {
+ if (drive_is_removable)
+ description = QObject::tr("%1 Removable Media", "%1 is the size").arg(size_str);
+ description = QCoreApplication::translate("", "%1 Removable Media", "%1 is the size").arg(size_str);
+ else
+ description = QObject::tr("%1 Media", "%1 is the size").arg(size_str);
+ description = QCoreApplication::translate("", "%1 Media", "%1 is the size").arg(size_str);
+ }
+
+ return description;
@ -1145,33 +1145,33 @@ index 0000000..3076278
+QString Device::errorToString(const QString & error) const
+{
+ if (error == UD2_ERROR_UNAUTHORIZED || error == UD2_ERROR_NOT_AUTHORIZED)
+ return QObject::tr("You are not authorized to perform this operation");
+ return QCoreApplication::translate("", "You are not authorized to perform this operation");
+ else if (error == UD2_ERROR_BUSY)
+ return QObject::tr("The device is currently busy");
+ return QCoreApplication::translate("", "The device is currently busy");
+ else if (error == UD2_ERROR_FAILED)
+ return QObject::tr("The requested operation has failed");
+ return QCoreApplication::translate("", "The requested operation has failed");
+ else if (error == UD2_ERROR_CANCELED)
+ return QObject::tr("The requested operation has been canceled");
+ return QCoreApplication::translate("", "The requested operation has been canceled");
+ else if (error == UD2_ERROR_INVALID_OPTION)
+ return QObject::tr("An invalid or malformed option has been given");
+ return QCoreApplication::translate("", "An invalid or malformed option has been given");
+ else if (error == UD2_ERROR_MISSING_DRIVER)
+ return QObject::tr("The kernel driver for this filesystem type is not available");
+ return QCoreApplication::translate("", "The kernel driver for this filesystem type is not available");
+ else if (error == UD2_ERROR_ALREADY_MOUNTED)
+ return QObject::tr("The device is already mounted");
+ return QCoreApplication::translate("", "The device is already mounted");
+ else if (error == UD2_ERROR_NOT_MOUNTED)
+ return QObject::tr("The device is not mounted");
+ return QCoreApplication::translate("", "The device is not mounted");
+ else if (error == UD2_ERROR_MOUNTED_BY_OTHER_USER)
+ return QObject::tr("The device is mounted by another user");
+ return QCoreApplication::translate("", "The device is mounted by another user");
+ else if (error == UD2_ERROR_ALREADY_UNMOUNTING)
+ return QObject::tr("The device is already unmounting");
+ return QCoreApplication::translate("", "The device is already unmounting");
+ else if (error == UD2_ERROR_TIMED_OUT)
+ return QObject::tr("The operation timed out");
+ return QCoreApplication::translate("", "The operation timed out");
+ else if (error == UD2_ERROR_WOULD_WAKEUP)
+ return QObject::tr("The operation would wake up a disk that is in a deep-sleep state");
+ return QCoreApplication::translate("", "The operation would wake up a disk that is in a deep-sleep state");
+ else if (error == UD2_ERROR_ALREADY_CANCELLED)
+ return QObject::tr("The operation has already been canceled");
+ return QCoreApplication::translate("", "The operation has already been canceled");
+ else
+ return QObject::tr("An unspecified error has occurred");
+ return QCoreApplication::translate("", "An unspecified error has occurred");
+}
+
+Solid::ErrorType Device::errorToSolidError(const QString & error) const
@ -1273,11 +1273,11 @@ index 0000000..3076278
+{
+ return prop("Drive").value<QDBusObjectPath>().path();
+}
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksdevice.h b/tier1/solid/src/solid/backends/udisks2/udisksdevice.h
diff --git a/solid/solid/backends/udisks2/udisksdevice.h b/solid/solid/backends/udisks2/udisksdevice.h
new file mode 100644
index 0000000..cf8e2f5
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksdevice.h
+++ b/solid/solid/backends/udisks2/udisksdevice.h
@@ -0,0 +1,112 @@
+/*
+ Copyright 2010 Michael Zanetti <mzanetti@kde.org>
@ -1391,11 +1391,11 @@ index 0000000..cf8e2f5
+}
+
+#endif // UDISKS2DEVICE_H
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksdeviceinterface.cpp b/tier1/solid/src/solid/backends/udisks2/udisksdeviceinterface.cpp
diff --git a/solid/solid/backends/udisks2/udisksdeviceinterface.cpp b/solid/solid/backends/udisks2/udisksdeviceinterface.cpp
new file mode 100644
index 0000000..9fa60e5
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksdeviceinterface.cpp
+++ b/solid/solid/backends/udisks2/udisksdeviceinterface.cpp
@@ -0,0 +1,33 @@
+/*
+ Copyright 2010 Michael Zanetti <mzanetti@kde.org>
@ -1430,11 +1430,11 @@ index 0000000..9fa60e5
+DeviceInterface::~DeviceInterface()
+{
+}
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksdeviceinterface.h b/tier1/solid/src/solid/backends/udisks2/udisksdeviceinterface.h
diff --git a/solid/solid/backends/udisks2/udisksdeviceinterface.h b/solid/solid/backends/udisks2/udisksdeviceinterface.h
new file mode 100644
index 0000000..43a1b6f
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksdeviceinterface.h
+++ b/solid/solid/backends/udisks2/udisksdeviceinterface.h
@@ -0,0 +1,148 @@
+/*
+ Copyright 2010 Michael Zanetti <mzanetti@kde.org>
@ -1584,11 +1584,11 @@ index 0000000..43a1b6f
+}
+
+#endif // UDISKS2DEVICEINTERFACE_H
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksgenericinterface.cpp b/tier1/solid/src/solid/backends/udisks2/udisksgenericinterface.cpp
diff --git a/solid/solid/backends/udisks2/udisksgenericinterface.cpp b/solid/solid/backends/udisks2/udisksgenericinterface.cpp
new file mode 100644
index 0000000..2d8cea2
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksgenericinterface.cpp
+++ b/solid/solid/backends/udisks2/udisksgenericinterface.cpp
@@ -0,0 +1,53 @@
+/*
+ Copyright 2009 Pino Toscano <pino@kde.org>
@ -1643,11 +1643,11 @@ index 0000000..2d8cea2
+ return m_device->propertyExists(key);
+}
+
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksgenericinterface.h b/tier1/solid/src/solid/backends/udisks2/udisksgenericinterface.h
diff --git a/solid/solid/backends/udisks2/udisksgenericinterface.h b/solid/solid/backends/udisks2/udisksgenericinterface.h
new file mode 100644
index 0000000..d225f32
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksgenericinterface.h
+++ b/solid/solid/backends/udisks2/udisksgenericinterface.h
@@ -0,0 +1,57 @@
+/*
+ Copyright 2009 Pino Toscano <pino@kde.org>
@ -1706,12 +1706,12 @@ index 0000000..d225f32
+}
+
+#endif // SOLID_BACKENDS_UDISKS2_GENERICINTERFACE_H
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksmanager.cpp b/tier1/solid/src/solid/backends/udisks2/udisksmanager.cpp
diff --git a/solid/solid/backends/udisks2/udisksmanager.cpp b/solid/solid/backends/udisks2/udisksmanager.cpp
new file mode 100644
index 0000000..de7d564
index 0000000..46d934e
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksmanager.cpp
@@ -0,0 +1,231 @@
+++ b/solid/solid/backends/udisks2/udisksmanager.cpp
@@ -0,0 +1,228 @@
+/*
+ Copyright 2012 Lukáš Tinkl <ltinkl@redhat.com>
+
@ -1734,6 +1734,7 @@ index 0000000..de7d564
+
+#include "udisksmanager.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDebug>
+#include <QtDBus>
+
@ -1795,8 +1796,8 @@ index 0000000..de7d564
+ if (udi==udiPrefix()) {
+ RootDevice *root = new RootDevice(udi);
+
+ root->setProduct(tr("Storage"));
+ root->setDescription(tr("Storage devices"));
+ root->setProduct(QCoreApplication::translate("", "Storage"));
+ root->setDescription(QCoreApplication::translate("", "Storage devices"));
+ root->setIcon("server-database"); // Obviously wasn't meant for that, but maps nicely in oxygen icon set :-p
+
+ return root;
@ -1891,7 +1892,6 @@ index 0000000..de7d564
+
+ // new device, we don't know it yet
+ if (!m_deviceCache.contains(udi)) {
+ qDebug() << "ADDING NEW DEVICE" << udi;
+ m_deviceCache.append(udi);
+ Q_EMIT deviceAdded(udi);
+ }
@ -1906,7 +1906,6 @@ index 0000000..de7d564
+ Device device(udi);
+
+ if (!udi.isEmpty() && (interfaces.isEmpty() || device.interfaces().isEmpty() || device.interfaces().contains(UD2_DBUS_INTERFACE_FILESYSTEM))) {
+ qDebug() << "REMOVING DEVICE" << udi;
+ Q_EMIT deviceRemoved(udi);
+ m_deviceCache.removeAll(udi);
+ }
@ -1924,13 +1923,11 @@ index 0000000..de7d564
+ qDebug() << "MEDIA CHANGED in" << udi << "; size is:" << size;
+
+ if (!m_deviceCache.contains(udi) && size > 0) { // we don't know the optdisc, got inserted
+ qDebug() << "ADDING NEW OPTDISC" << udi;
+ m_deviceCache.append(udi);
+ Q_EMIT deviceAdded(udi);
+ }
+
+ if (m_deviceCache.contains(udi) && size == 0) { // we know the optdisc, got removed
+ qDebug() << "REMOVING OPTDISC" << udi;
+ Q_EMIT deviceRemoved(udi);
+ m_deviceCache.removeAll(udi);
+ }
@ -1943,11 +1940,11 @@ index 0000000..de7d564
+
+ return m_deviceCache;
+}
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksmanager.h b/tier1/solid/src/solid/backends/udisks2/udisksmanager.h
diff --git a/solid/solid/backends/udisks2/udisksmanager.h b/solid/solid/backends/udisks2/udisksmanager.h
new file mode 100644
index 0000000..7cf0a72
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksmanager.h
+++ b/solid/solid/backends/udisks2/udisksmanager.h
@@ -0,0 +1,69 @@
+/*
+ Copyright 2010 Michael Zanetti <mzanetti@kde.org>
@ -2018,11 +2015,11 @@ index 0000000..7cf0a72
+}
+}
+#endif // UDISKS2MANAGER_H
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksopticaldisc.cpp b/tier1/solid/src/solid/backends/udisks2/udisksopticaldisc.cpp
diff --git a/solid/solid/backends/udisks2/udisksopticaldisc.cpp b/solid/solid/backends/udisks2/udisksopticaldisc.cpp
new file mode 100644
index 0000000..478c930
index 0000000..650f0f7
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksopticaldisc.cpp
+++ b/solid/solid/backends/udisks2/udisksopticaldisc.cpp
@@ -0,0 +1,277 @@
+/*
+ Copyright 2010 Michael Zanetti <mzanetti@kde.org>
@ -2053,7 +2050,7 @@ index 0000000..478c930
+#include <QtCore/QFile>
+#include <QtDBus/QDBusConnection>
+
+#include "../shared/udevqtclient.h"
+#include "../shared/udevqt.h"
+
+#include "udisks2.h"
+#include "udisksopticaldisc.h"
@ -2301,11 +2298,11 @@ index 0000000..478c930
+{
+ return m_drive->prop("Media").toString();
+}
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksopticaldisc.h b/tier1/solid/src/solid/backends/udisks2/udisksopticaldisc.h
diff --git a/solid/solid/backends/udisks2/udisksopticaldisc.h b/solid/solid/backends/udisks2/udisksopticaldisc.h
new file mode 100644
index 0000000..5b80995
index 0000000..0cdcc66
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksopticaldisc.h
+++ b/solid/solid/backends/udisks2/udisksopticaldisc.h
@@ -0,0 +1,69 @@
+/*
+ Copyright 2010 Michael Zanetti <mzanetti@kde.org>
@ -2333,7 +2330,7 @@ index 0000000..5b80995
+
+#include <solid/ifaces/opticaldisc.h>
+
+#include "../shared/udevqtdevice.h"
+#include "../shared/udevqt.h"
+
+#include "udisksstoragevolume.h"
+#include "udisksdevice.h"
@ -2376,11 +2373,11 @@ index 0000000..5b80995
+}
+}
+#endif // UDISKS2OPTICALDISC_H
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksopticaldrive.cpp b/tier1/solid/src/solid/backends/udisks2/udisksopticaldrive.cpp
diff --git a/solid/solid/backends/udisks2/udisksopticaldrive.cpp b/solid/solid/backends/udisks2/udisksopticaldrive.cpp
new file mode 100644
index 0000000..f4351a7
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksopticaldrive.cpp
+++ b/solid/solid/backends/udisks2/udisksopticaldrive.cpp
@@ -0,0 +1,222 @@
+/*
+ Copyright 2010 Michael Zanetti <mzanetti@kde.org>
@ -2604,11 +2601,11 @@ index 0000000..f4351a7
+{
+ m_speedsInit = false; // reset the read/write speeds, changes eg. with an inserted media
+}
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksopticaldrive.h b/tier1/solid/src/solid/backends/udisks2/udisksopticaldrive.h
diff --git a/solid/solid/backends/udisks2/udisksopticaldrive.h b/solid/solid/backends/udisks2/udisksopticaldrive.h
new file mode 100644
index 0000000..4c98ef5
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksopticaldrive.h
+++ b/solid/solid/backends/udisks2/udisksopticaldrive.h
@@ -0,0 +1,81 @@
+/*
+ Copyright 2010 Michael Zanetti <mzanetti@kde.org>
@ -2691,11 +2688,11 @@ index 0000000..4c98ef5
+}
+
+#endif // UDISKS2OPTICALDRIVE_H
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksstorageaccess.cpp b/tier1/solid/src/solid/backends/udisks2/udisksstorageaccess.cpp
diff --git a/solid/solid/backends/udisks2/udisksstorageaccess.cpp b/solid/solid/backends/udisks2/udisksstorageaccess.cpp
new file mode 100644
index 0000000..ec18369
index 0000000..f28540b
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksstorageaccess.cpp
+++ b/solid/solid/backends/udisks2/udisksstorageaccess.cpp
@@ -0,0 +1,362 @@
+/*
+ Copyright 2009 Pino Toscano <pino@kde.org>
@ -3006,7 +3003,7 @@ index 0000000..ec18369
+
+ QString appId = QCoreApplication::applicationName();
+
+ QDBusInterface soliduiserver("org.kde.kded5", "/modules/soliduiserver", "org.kde.SolidUiServer");
+ QDBusInterface soliduiserver("org.kde.kded", "/modules/soliduiserver", "org.kde.SolidUiServer");
+ QDBusReply<void> reply = soliduiserver.call("showPassphraseDialog", udi, returnService,
+ m_lastReturnObject, wId, appId);
+ m_passphraseRequested = reply.isValid();
@ -3059,11 +3056,11 @@ index 0000000..ec18369
+ SLOT(slotDBusReply(const QDBusMessage &)),
+ SLOT(slotDBusError(const QDBusError &)));
+}
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksstorageaccess.h b/tier1/solid/src/solid/backends/udisks2/udisksstorageaccess.h
diff --git a/solid/solid/backends/udisks2/udisksstorageaccess.h b/solid/solid/backends/udisks2/udisksstorageaccess.h
new file mode 100644
index 0000000..2901067
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksstorageaccess.h
+++ b/solid/solid/backends/udisks2/udisksstorageaccess.h
@@ -0,0 +1,104 @@
+/*
+ Copyright 2009 Pino Toscano <pino@kde.org>
@ -3169,11 +3166,11 @@ index 0000000..2901067
+}
+
+#endif // UDISKS2STORAGEACCESS_H
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksstoragedrive.cpp b/tier1/solid/src/solid/backends/udisks2/udisksstoragedrive.cpp
diff --git a/solid/solid/backends/udisks2/udisksstoragedrive.cpp b/solid/solid/backends/udisks2/udisksstoragedrive.cpp
new file mode 100644
index 0000000..c79ac20
index 0000000..e382154
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksstoragedrive.cpp
+++ b/solid/solid/backends/udisks2/udisksstoragedrive.cpp
@@ -0,0 +1,147 @@
+/*
+ Copyright 2010 Michael Zanetti <mzanetti@kde.org>
@ -3198,7 +3195,7 @@ index 0000000..c79ac20
+
+#include "udisksstoragedrive.h"
+
+#include "../shared/udevqtclient.h"
+#include "../shared/udevqt.h"
+
+#include <QtCore/QDebug>
+#include <QtCore/QFile>
@ -3322,11 +3319,11 @@ index 0000000..c79ac20
+ else
+ return Solid::StorageDrive::Platform;
+}
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksstoragedrive.h b/tier1/solid/src/solid/backends/udisks2/udisksstoragedrive.h
diff --git a/solid/solid/backends/udisks2/udisksstoragedrive.h b/solid/solid/backends/udisks2/udisksstoragedrive.h
new file mode 100644
index 0000000..9c87a23
index 0000000..d8c1046
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksstoragedrive.h
+++ b/solid/solid/backends/udisks2/udisksstoragedrive.h
@@ -0,0 +1,61 @@
+/*
+ Copyright 2010 Michael Zanetti <mzanetti@kde.org>
@ -3354,7 +3351,7 @@ index 0000000..9c87a23
+
+#include <ifaces/storagedrive.h>
+
+#include "../shared/udevqtdevice.h"
+#include "../shared/udevqt.h"
+
+#include "udisksblock.h"
+
@ -3389,11 +3386,11 @@ index 0000000..9c87a23
+}
+
+#endif // UDISK2SSTORAGEDRIVE_H
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksstoragevolume.cpp b/tier1/solid/src/solid/backends/udisks2/udisksstoragevolume.cpp
diff --git a/solid/solid/backends/udisks2/udisksstoragevolume.cpp b/solid/solid/backends/udisks2/udisksstoragevolume.cpp
new file mode 100644
index 0000000..a7d8fad
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksstoragevolume.cpp
+++ b/solid/solid/backends/udisks2/udisksstoragevolume.cpp
@@ -0,0 +1,105 @@
+/*
+ Copyright 2010 Michael Zanetti <mzanetti@kde.org>
@ -3500,11 +3497,11 @@ index 0000000..a7d8fad
+ return m_device->prop("HintIgnore").toBool() || m_device->isSwap() ||
+ ((usg == Solid::StorageVolume::Unused || usg == Solid::StorageVolume::Other || usg == Solid::StorageVolume::PartitionTable) && !m_device->isOpticalDisc());
+}
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksstoragevolume.h b/tier1/solid/src/solid/backends/udisks2/udisksstoragevolume.h
diff --git a/solid/solid/backends/udisks2/udisksstoragevolume.h b/solid/solid/backends/udisks2/udisksstoragevolume.h
new file mode 100644
index 0000000..2ca04d2
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksstoragevolume.h
+++ b/solid/solid/backends/udisks2/udisksstoragevolume.h
@@ -0,0 +1,57 @@
+/*
+ Copyright 2010 Michael Zanetti <mzanetti@kde.org>

View File

@ -1,115 +0,0 @@
diff --git a/tier1/solid/src/solid/CMakeLists.txt b/tier1/solid/src/solid/CMakeLists.txt
index 0fabd2c..75bb642 100644
--- a/tier1/solid/src/solid/CMakeLists.txt
+++ b/tier1/solid/src/solid/CMakeLists.txt
@@ -29,7 +29,6 @@ configure_file(config-processor.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-proce
file(MAKE_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/backends/fakehw
- ${CMAKE_CURRENT_BINARY_DIR}/backends/hal
${CMAKE_CURRENT_BINARY_DIR}/backends/udev
${CMAKE_CURRENT_BINARY_DIR}/backends/wmi
)
@@ -205,33 +204,6 @@ if(NOT WIN32 AND NOT APPLE)
endif( UDEV_FOUND )
- message(STATUS "Building Solid HAL backend." )
- set(solid_LIB_SRCS ${solid_LIB_SRCS}
- backends/hal/halacadapter.cpp
- backends/hal/halaudiointerface.cpp
- backends/hal/halbattery.cpp
- backends/hal/halblock.cpp
- backends/hal/halbutton.cpp
- backends/hal/halcamera.cpp
- backends/hal/halcdrom.cpp
- backends/hal/haldeviceinterface.cpp
- backends/hal/haldvbinterface.cpp
- backends/hal/halfstabhandling.cpp
- backends/hal/halgenericinterface.cpp
- backends/hal/haldevice.cpp
- backends/hal/halmanager.cpp
- backends/hal/halnetworkinterface.cpp
- backends/hal/halserialinterface.cpp
- backends/hal/halopticaldisc.cpp
- backends/hal/halportablemediaplayer.cpp
- backends/hal/halprocessor.cpp
- backends/hal/halstorageaccess.cpp
- backends/hal/halstorage.cpp
- backends/hal/halvideo.cpp
- backends/hal/halvolume.cpp
- backends/hal/halsmartcardreader.cpp
- )
-
message(STATUS "Building Solid UPower backend." )
set(solid_LIB_SRCS ${solid_LIB_SRCS}
backends/upower/upowermanager.cpp
@@ -244,18 +216,19 @@ if(NOT WIN32 AND NOT APPLE)
# FIXME: this should work on more Unix systems
if (CMAKE_SYSTEM_NAME MATCHES Linux)
- message(STATUS "Building Solid UDisks backend." )
+ message(STATUS "Building Solid UDisks2 backend." )
set(solid_LIB_SRCS ${solid_LIB_SRCS}
- backends/udisks/udisksmanager.cpp
- backends/udisks/udisksdevice.cpp
- backends/udisks/udisksblock.cpp
- backends/udisks/udisksstoragevolume.cpp
- backends/udisks/udisksdeviceinterface.cpp
- backends/udisks/udisksopticaldisc.cpp
- backends/udisks/udisksopticaldrive.cpp
- backends/udisks/udisksstoragedrive.cpp
- backends/udisks/udisksstorageaccess.cpp
- backends/udisks/udisksgenericinterface.cpp
+ backends/udisks2/udisksmanager.cpp
+ backends/udisks2/udisksdevice.cpp
+ backends/udisks2/udisksblock.cpp
+ backends/udisks2/udisksstoragevolume.cpp
+ backends/udisks2/udisksdeviceinterface.cpp
+ backends/udisks2/udisksopticaldisc.cpp
+ backends/udisks2/udisksopticaldrive.cpp
+ backends/udisks2/udisksstoragedrive.cpp
+ backends/udisks2/udisksstorageaccess.cpp
+ backends/udisks2/udisksgenericinterface.cpp
+ backends/udisks2/dbus/manager.cpp
)
endif (CMAKE_SYSTEM_NAME MATCHES Linux)
diff --git a/tier1/solid/src/solid/managerbase.cpp b/tier1/solid/src/solid/managerbase.cpp
index e228b48..7a7cc7d 100644
--- a/tier1/solid/src/solid/managerbase.cpp
+++ b/tier1/solid/src/solid/managerbase.cpp
@@ -30,8 +30,7 @@
#if defined (Q_OS_MAC)
#include "backends/iokit/iokitmanager.h"
#elif defined (Q_OS_UNIX)
-#include "backends/hal/halmanager.h"
-#include "backends/udisks/udisksmanager.h"
+#include "backends/udisks2/udisksmanager.h"
#include "backends/upower/upowermanager.h"
#if defined (HUPNP_FOUND)
@@ -71,22 +70,13 @@ void Solid::ManagerBasePrivate::loadBackends()
# elif defined(Q_OS_WIN) && defined(HAVE_WBEM) && !defined(_WIN32_WCE)
m_backends << new Solid::Backends::Wmi::WmiManager(0);
-# elif defined(Q_OS_UNIX) && !defined(Q_OS_LINUX)
- m_backends << new Solid::Backends::Hal::HalManager(0);
-
# elif defined(Q_OS_LINUX)
- bool solidHalLegacyEnabled
- = QString::fromLocal8Bit(qgetenv("SOLID_HAL_LEGACY")).toInt()==1;
- if (solidHalLegacyEnabled) {
- m_backends << new Solid::Backends::Hal::HalManager(0);
- } else {
# if defined(UDEV_FOUND)
m_backends << new Solid::Backends::UDev::UDevManager(0);
# endif
- m_backends << new Solid::Backends::UDisks::UDisksManager(0)
+ m_backends << new Solid::Backends::UDisks2::Manager(0)
<< new Solid::Backends::UPower::UPowerManager(0)
<< new Solid::Backends::Fstab::FstabManager(0);
- }
# endif
# if defined (HUPNP_FOUND)

View File

@ -1,65 +0,0 @@
diff -up kdelibs-4.8.2/solid/solid/CMakeLists.txt.udisks2_prep kdelibs-4.8.2/solid/solid/CMakeLists.txt
--- kdelibs-4.8.2/solid/solid/CMakeLists.txt.udisks2_prep 2011-07-27 13:34:38.000000000 -0500
+++ kdelibs-4.8.2/solid/solid/CMakeLists.txt 2012-04-17 16:02:06.153985974 -0500
@@ -1,6 +1,7 @@
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
add_subdirectory( ifaces )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
+include_directories( ${QT_QTDBUS_INCLUDE_DIR} )
if(WIN32)
include_directories( ${KDEWIN_INCLUDES} )
diff -up kdelibs-4.8.2/solid/solid/managerbase.cpp.udisks2_prep kdelibs-4.8.2/solid/solid/managerbase.cpp
--- kdelibs-4.8.2/solid/solid/managerbase.cpp.udisks2_prep 2011-07-27 13:34:39.000000000 -0500
+++ kdelibs-4.8.2/solid/solid/managerbase.cpp 2012-04-17 16:02:06.154985961 -0500
@@ -21,7 +21,7 @@
#include "managerbase_p.h"
#include <stdlib.h>
-#if !defined (Q_WS_WIN) && !defined (Q_OS_MAC)
+#if !defined (Q_OS_WIN) && !defined (Q_OS_MAC)
#include <config-solid.h>
#endif
@@ -44,7 +44,7 @@
#include "backends/fstab/fstabmanager.h"
-#elif defined (Q_WS_WIN) && defined(HAVE_WBEM) && !defined(_WIN32_WCE)
+#elif defined (Q_OS_WIN) && defined(HAVE_WBEM) && !defined(_WIN32_WCE)
#include "backends/wmi/wmimanager.h"
#endif
@@ -68,7 +68,7 @@ void Solid::ManagerBasePrivate::loadBack
# if defined(Q_OS_MAC)
m_backends << new Solid::Backends::IOKit::IOKitManager(0);
-# elif defined(Q_WS_WIN) && defined(HAVE_WBEM) && !defined(_WIN32_WCE)
+# elif defined(Q_OS_WIN) && defined(HAVE_WBEM) && !defined(_WIN32_WCE)
m_backends << new Solid::Backends::Wmi::WmiManager(0);
# elif defined(Q_OS_UNIX) && !defined(Q_OS_LINUX)
diff -up kdelibs-4.8.2/solid/tests/CMakeLists.txt.udisks2_prep kdelibs-4.8.2/solid/tests/CMakeLists.txt
--- kdelibs-4.8.2/solid/tests/CMakeLists.txt.udisks2_prep 2011-10-20 15:52:04.000000000 -0500
+++ kdelibs-4.8.2/solid/tests/CMakeLists.txt 2012-04-17 16:02:44.584505527 -0500
@@ -16,20 +16,6 @@ target_link_libraries(fakehardwaretest s
add_definitions(-DTEST_DATA="\\"${CMAKE_CURRENT_SOURCE_DIR}/../solid/backends/fakehw/fakecomputer.xml\\"")
-########### halbasictest ###############
-
-if(NOT WIN32 AND NOT APPLE)
-set(halbasictest_SRCS halbasictest.cpp )
-
-kde4_add_executable(halbasictest ${halbasictest_SRCS})
-
-if(WIN32)
- set_target_properties(halbasictest PROPERTIES COMPILE_FLAGS -DSOLID_EXPORT=)
-endif(WIN32)
-
-target_link_libraries(halbasictest solid_static ${KDEWIN_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTTEST_LIBRARY} )
-endif(NOT WIN32 AND NOT APPLE)
-
########### solidhwtest ###############
set(solidhwtest_SRCS

View File

@ -25,7 +25,7 @@
Summary: KDE Libraries
Version: 4.9.1
Release: 1%{?dist}
Release: 2%{?dist}
Name: kdelibs
Epoch: 6
@ -122,9 +122,7 @@ Patch42: 0003-Implement-automatic-scanning-of-source-code-for-requ.patch
Patch45: kdelibs-4.7.3-halectomy.patch
# udisks2 Solid backend, halectomy
Patch46: kdelibs-udisks2_prep.patch
Patch47: kdelibs-udisks2-backend.patch
Patch48: kdelibs-udisks2_post.patch
## upstreamable
# knewstuff2 variant of:
@ -304,18 +302,7 @@ sed -i -e "s|@@VERSION_RELEASE@@|%{version}-%{release}|" kio/kio/kprotocolmanage
%endif
%if "%{?udisks}" == "udisks2"
pushd solid
%patch46 -p2 -b .udisks2_prep
%patch47 -p4 -b .udisks2backend
sed -i.udisks2_sed \
-e 's|#include "../shared/udevqtdevice.h"|#include "../shared/udevqt.h"|g' \
-e 's|#include "../shared/udevqtclient.h"|#include "../shared/udevqt.h"|g' \
solid/backends/udisks2/udisksopticaldisc.h \
solid/backends/udisks2/udisksstoragedrive.h \
solid/backends/udisks2/udisksopticaldisc.cpp \
solid/backends/udisks2/udisksstoragedrive.cpp
%patch48 -p4 -b .udisks2_post
popd
%patch47 -p1 -b .udisks2backend
%else
%patch45 -p1 -b .halectomy
%endif
@ -584,6 +571,9 @@ rm -rf %{buildroot}
%changelog
* Tue Sep 04 2012 Lukas Tinkl <ltinkl@redhat.com> - 6:4.9.1-2
- rebase udisks2 backend against KDE/4.10 branch
* Mon Sep 03 2012 Than Ngo <than@redhat.com> - 6:4.9.1-1
- 4.9.1