mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
solid: use QString instead of QVariant for the Solid::StorageAccess signals arguments
to avoid needless conversion to and from QVariant Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
2e682648c9
commit
5cb62b9388
12 changed files with 41 additions and 38 deletions
|
@ -75,8 +75,8 @@ public:
|
||||||
void _k_contentChanged(const QString &udi, const bool hascontent);
|
void _k_contentChanged(const QString &udi, const bool hascontent);
|
||||||
void _k_itemChanged(const QString &udi);
|
void _k_itemChanged(const QString &udi);
|
||||||
void _k_reloadBookmarks();
|
void _k_reloadBookmarks();
|
||||||
void _k_storageSetupDone(Solid::ErrorType error, QVariant errorData);
|
void _k_storageSetupDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
|
||||||
void _k_storageTeardownDone(Solid::ErrorType error, QVariant errorData);
|
void _k_storageTeardownDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
|
||||||
};
|
};
|
||||||
|
|
||||||
KFilePlacesModel::KFilePlacesModel(QObject *parent)
|
KFilePlacesModel::KFilePlacesModel(QObject *parent)
|
||||||
|
@ -765,8 +765,8 @@ void KFilePlacesModel::requestTeardown(const QModelIndex &index)
|
||||||
Solid::StorageAccess *access = device.as<Solid::StorageAccess>();
|
Solid::StorageAccess *access = device.as<Solid::StorageAccess>();
|
||||||
|
|
||||||
if (access!=0) {
|
if (access!=0) {
|
||||||
connect(access, SIGNAL(teardownDone(Solid::ErrorType,QVariant,QString)),
|
connect(access, SIGNAL(teardownDone(Solid::ErrorType,QString,QString)),
|
||||||
this, SLOT(_k_storageTeardownDone(Solid::ErrorType,QVariant)));
|
this, SLOT(_k_storageTeardownDone(Solid::ErrorType,QString,QString)));
|
||||||
|
|
||||||
access->teardown();
|
access->teardown();
|
||||||
}
|
}
|
||||||
|
@ -779,8 +779,8 @@ void KFilePlacesModel::requestEject(const QModelIndex &index)
|
||||||
Solid::OpticalDrive *drive = device.as<Solid::OpticalDrive>();
|
Solid::OpticalDrive *drive = device.as<Solid::OpticalDrive>();
|
||||||
|
|
||||||
if (drive!=0) {
|
if (drive!=0) {
|
||||||
connect(drive, SIGNAL(ejectDone(Solid::ErrorType,QVariant,QString)),
|
connect(drive, SIGNAL(ejectDone(Solid::ErrorType,QString,QString)),
|
||||||
this, SLOT(_k_storageTeardownDone(Solid::ErrorType,QVariant)));
|
this, SLOT(_k_storageTeardownDone(Solid::ErrorType,QString,QString)));
|
||||||
|
|
||||||
drive->eject();
|
drive->eject();
|
||||||
} else {
|
} else {
|
||||||
|
@ -802,15 +802,17 @@ void KFilePlacesModel::requestSetup(const QModelIndex &index)
|
||||||
|
|
||||||
d->setupInProgress[access] = index;
|
d->setupInProgress[access] = index;
|
||||||
|
|
||||||
connect(access, SIGNAL(setupDone(Solid::ErrorType,QVariant,QString)),
|
connect(access, SIGNAL(setupDone(Solid::ErrorType,QString,QString)),
|
||||||
this, SLOT(_k_storageSetupDone(Solid::ErrorType,QVariant)));
|
this, SLOT(_k_storageSetupDone(Solid::ErrorType,QString,QString)));
|
||||||
|
|
||||||
access->setup();
|
access->setup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KFilePlacesModel::Private::_k_storageSetupDone(Solid::ErrorType error, QVariant errorData)
|
void KFilePlacesModel::Private::_k_storageSetupDone(Solid::ErrorType error, const QString &errorData, const QString &udi)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(udi);
|
||||||
|
|
||||||
QPersistentModelIndex index = setupInProgress.take(q->sender());
|
QPersistentModelIndex index = setupInProgress.take(q->sender());
|
||||||
|
|
||||||
if (!index.isValid()) {
|
if (!index.isValid()) {
|
||||||
|
@ -820,10 +822,10 @@ void KFilePlacesModel::Private::_k_storageSetupDone(Solid::ErrorType error, QVar
|
||||||
if (!error) {
|
if (!error) {
|
||||||
emit q->setupDone(index, true);
|
emit q->setupDone(index, true);
|
||||||
} else {
|
} else {
|
||||||
if (errorData.isValid()) {
|
if (!errorData.isEmpty()) {
|
||||||
emit q->errorMessage(i18n("An error occurred while accessing '%1', the system responded: %2",
|
emit q->errorMessage(i18n("An error occurred while accessing '%1', the system responded: %2",
|
||||||
q->text(index),
|
q->text(index),
|
||||||
errorData.toString()));
|
errorData));
|
||||||
} else {
|
} else {
|
||||||
emit q->errorMessage(i18n("An error occurred while accessing '%1'",
|
emit q->errorMessage(i18n("An error occurred while accessing '%1'",
|
||||||
q->text(index)));
|
q->text(index)));
|
||||||
|
@ -833,10 +835,11 @@ void KFilePlacesModel::Private::_k_storageSetupDone(Solid::ErrorType error, QVar
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KFilePlacesModel::Private::_k_storageTeardownDone(Solid::ErrorType error, QVariant errorData)
|
void KFilePlacesModel::Private::_k_storageTeardownDone(Solid::ErrorType error, const QString &errorData, const QString &udi)
|
||||||
{
|
{
|
||||||
if (error && errorData.isValid()) {
|
Q_UNUSED(udi);
|
||||||
emit q->errorMessage(errorData.toString());
|
if (error && !errorData.isEmpty()) {
|
||||||
|
emit q->errorMessage(errorData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,8 +141,8 @@ private:
|
||||||
Q_PRIVATE_SLOT(d, void _k_contentChanged(const QString&, const bool))
|
Q_PRIVATE_SLOT(d, void _k_contentChanged(const QString&, const bool))
|
||||||
Q_PRIVATE_SLOT(d, void _k_itemChanged(const QString&))
|
Q_PRIVATE_SLOT(d, void _k_itemChanged(const QString&))
|
||||||
Q_PRIVATE_SLOT(d, void _k_reloadBookmarks())
|
Q_PRIVATE_SLOT(d, void _k_reloadBookmarks())
|
||||||
Q_PRIVATE_SLOT(d, void _k_storageSetupDone(Solid::ErrorType, QVariant))
|
Q_PRIVATE_SLOT(d, void _k_storageSetupDone(Solid::ErrorType, const QString &, const QString &))
|
||||||
Q_PRIVATE_SLOT(d, void _k_storageTeardownDone(Solid::ErrorType, QVariant))
|
Q_PRIVATE_SLOT(d, void _k_storageTeardownDone(Solid::ErrorType, const QString &, const QString &))
|
||||||
|
|
||||||
class Private;
|
class Private;
|
||||||
Private * const d;
|
Private * const d;
|
||||||
|
|
|
@ -48,7 +48,7 @@ public Q_SLOTS:
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void ejectPressed(const QString &udi);
|
void ejectPressed(const QString &udi);
|
||||||
void ejectDone(Solid::ErrorType error, QVariant errorData, const QString &udi);
|
void ejectDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,8 @@ public Q_SLOTS:
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void accessibilityChanged(bool accessible, const QString &udi);
|
void accessibilityChanged(bool accessible, const QString &udi);
|
||||||
void setupDone(Solid::ErrorType error, QVariant errorData, const QString &udi);
|
void setupDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
|
||||||
void teardownDone(Solid::ErrorType error, QVariant errorData, const QString &udi);
|
void teardownDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
|
||||||
void setupRequested(const QString &udi);
|
void setupRequested(const QString &udi);
|
||||||
void teardownRequested(const QString &udi);
|
void teardownRequested(const QString &udi);
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void ejectPressed(const QString &udi);
|
void ejectPressed(const QString &udi);
|
||||||
void ejectDone(Solid::ErrorType error, QVariant errorData, const QString &udi);
|
void ejectDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
|
||||||
void ejectRequested(const QString &udi);
|
void ejectRequested(const QString &udi);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -49,8 +49,8 @@ public:
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void accessibilityChanged(bool accessible, const QString &udi);
|
void accessibilityChanged(bool accessible, const QString &udi);
|
||||||
void setupDone(Solid::ErrorType error, QVariant data, const QString &udi);
|
void setupDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
|
||||||
void teardownDone(Solid::ErrorType error, QVariant data, const QString &udi);
|
void teardownDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
|
||||||
void setupRequested(const QString &udi);
|
void setupRequested(const QString &udi);
|
||||||
void teardownRequested(const QString &udi);
|
void teardownRequested(const QString &udi);
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ namespace Ifaces
|
||||||
*/
|
*/
|
||||||
virtual void ejectPressed(const QString &udi) = 0;
|
virtual void ejectPressed(const QString &udi) = 0;
|
||||||
|
|
||||||
virtual void ejectDone(Solid::ErrorType error, QVariant errorData, const QString &udi) = 0;
|
virtual void ejectDone(Solid::ErrorType error, const QString &errorData, const QString &udi) = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ namespace Ifaces
|
||||||
* @param newState true if the volume is mounted, false otherwise
|
* @param newState true if the volume is mounted, false otherwise
|
||||||
* @param udi the UDI of the volume
|
* @param udi the UDI of the volume
|
||||||
*/
|
*/
|
||||||
virtual void setupDone(Solid::ErrorType error, QVariant resultData, const QString &udi) = 0;
|
virtual void setupDone(Solid::ErrorType error, const QString &errorData, const QString &udi) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This signal is emitted when the mount state of this device
|
* This signal is emitted when the mount state of this device
|
||||||
|
@ -110,7 +110,7 @@ namespace Ifaces
|
||||||
* @param newState true if the volume is mounted, false otherwise
|
* @param newState true if the volume is mounted, false otherwise
|
||||||
* @param udi the UDI of the volume
|
* @param udi the UDI of the volume
|
||||||
*/
|
*/
|
||||||
virtual void teardownDone(Solid::ErrorType error, QVariant resultData, const QString &udi) = 0;
|
virtual void teardownDone(Solid::ErrorType error, const QString &errorData, const QString &udi) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This signal is emitted when a setup of this device is requested.
|
* This signal is emitted when a setup of this device is requested.
|
||||||
|
|
|
@ -29,8 +29,8 @@ Solid::OpticalDrive::OpticalDrive(QObject *backendObject)
|
||||||
{
|
{
|
||||||
connect(backendObject, SIGNAL(ejectPressed(QString)),
|
connect(backendObject, SIGNAL(ejectPressed(QString)),
|
||||||
this, SIGNAL(ejectPressed(QString)));
|
this, SIGNAL(ejectPressed(QString)));
|
||||||
connect(backendObject, SIGNAL(ejectDone(Solid::ErrorType,QVariant,QString)),
|
connect(backendObject, SIGNAL(ejectDone(Solid::ErrorType,QString,QString)),
|
||||||
this, SIGNAL(ejectDone(Solid::ErrorType,QVariant,QString)));
|
this, SIGNAL(ejectDone(Solid::ErrorType,QString,QString)));
|
||||||
connect(backendObject, SIGNAL(ejectRequested(QString)),
|
connect(backendObject, SIGNAL(ejectRequested(QString)),
|
||||||
this, SIGNAL(ejectRequested(QString)));
|
this, SIGNAL(ejectRequested(QString)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ namespace Solid
|
||||||
* @param errorData more information about the error, if any
|
* @param errorData more information about the error, if any
|
||||||
* @param udi the UDI of the volume
|
* @param udi the UDI of the volume
|
||||||
*/
|
*/
|
||||||
void ejectDone(Solid::ErrorType error, QVariant errorData, const QString &udi);
|
void ejectDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This signal is emitted when eject on this drive is
|
* This signal is emitted when eject on this drive is
|
||||||
|
|
|
@ -27,10 +27,10 @@
|
||||||
Solid::StorageAccess::StorageAccess(QObject *backendObject)
|
Solid::StorageAccess::StorageAccess(QObject *backendObject)
|
||||||
: DeviceInterface(*new StorageAccessPrivate(), backendObject)
|
: DeviceInterface(*new StorageAccessPrivate(), backendObject)
|
||||||
{
|
{
|
||||||
connect(backendObject, SIGNAL(setupDone(Solid::ErrorType,QVariant,QString)),
|
connect(backendObject, SIGNAL(setupDone(Solid::ErrorType,QString,QString)),
|
||||||
this, SIGNAL(setupDone(Solid::ErrorType,QVariant,QString)));
|
this, SIGNAL(setupDone(Solid::ErrorType,QString,QString)));
|
||||||
connect(backendObject, SIGNAL(teardownDone(Solid::ErrorType,QVariant,QString)),
|
connect(backendObject, SIGNAL(teardownDone(Solid::ErrorType,QString,QString)),
|
||||||
this, SIGNAL(teardownDone(Solid::ErrorType,QVariant,QString)));
|
this, SIGNAL(teardownDone(Solid::ErrorType,QString,QString)));
|
||||||
connect(backendObject, SIGNAL(setupRequested(QString)),
|
connect(backendObject, SIGNAL(setupRequested(QString)),
|
||||||
this, SIGNAL(setupRequested(QString)));
|
this, SIGNAL(setupRequested(QString)));
|
||||||
connect(backendObject, SIGNAL(teardownRequested(QString)),
|
connect(backendObject, SIGNAL(teardownRequested(QString)),
|
||||||
|
@ -43,10 +43,10 @@ Solid::StorageAccess::StorageAccess(QObject *backendObject)
|
||||||
Solid::StorageAccess::StorageAccess(StorageAccessPrivate &dd, QObject *backendObject)
|
Solid::StorageAccess::StorageAccess(StorageAccessPrivate &dd, QObject *backendObject)
|
||||||
: DeviceInterface(dd, backendObject)
|
: DeviceInterface(dd, backendObject)
|
||||||
{
|
{
|
||||||
connect(backendObject, SIGNAL(setupDone(Solid::StorageAccess::SetupResult,QVariant,QString)),
|
connect(backendObject, SIGNAL(setupDone(Solid::StorageAccess::SetupResult,QString,QString)),
|
||||||
this, SIGNAL(setupDone(Solid::StorageAccess::SetupResult,QVariant,QString)));
|
this, SIGNAL(setupDone(Solid::StorageAccess::SetupResult,QString,QString)));
|
||||||
connect(backendObject, SIGNAL(teardownDone(Solid::StorageAccess::TeardownResult,QVariant,QString)),
|
connect(backendObject, SIGNAL(teardownDone(Solid::StorageAccess::TeardownResult,QString,QString)),
|
||||||
this, SIGNAL(teardownDone(Solid::StorageAccess::TeardownResult,QVariant,QString)));
|
this, SIGNAL(teardownDone(Solid::StorageAccess::TeardownResult,QString,QString)));
|
||||||
connect(backendObject, SIGNAL(setupRequested(QString)),
|
connect(backendObject, SIGNAL(setupRequested(QString)),
|
||||||
this, SIGNAL(setupRequested(QString)));
|
this, SIGNAL(setupRequested(QString)));
|
||||||
connect(backendObject, SIGNAL(teardownRequested(QString)),
|
connect(backendObject, SIGNAL(teardownRequested(QString)),
|
||||||
|
|
|
@ -136,7 +136,7 @@ namespace Solid
|
||||||
* @param errorData more information about the error, if any
|
* @param errorData more information about the error, if any
|
||||||
* @param udi the UDI of the volume
|
* @param udi the UDI of the volume
|
||||||
*/
|
*/
|
||||||
void setupDone(Solid::ErrorType error, QVariant errorData, const QString &udi);
|
void setupDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This signal is emitted when the attempted tearing down of this
|
* This signal is emitted when the attempted tearing down of this
|
||||||
|
@ -147,7 +147,7 @@ namespace Solid
|
||||||
* @param errorData more information about the error, if any
|
* @param errorData more information about the error, if any
|
||||||
* @param udi the UDI of the volume
|
* @param udi the UDI of the volume
|
||||||
*/
|
*/
|
||||||
void teardownDone(Solid::ErrorType error, QVariant errorData, const QString &udi);
|
void teardownDone(Solid::ErrorType error, const QString &errorData, const QString &udi);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This signal is emitted when a setup of this device is requested.
|
* This signal is emitted when a setup of this device is requested.
|
||||||
|
|
Loading…
Add table
Reference in a new issue