#include <solid/genericinterface.h>
#include <solid/storageaccess.h>
#include <solid/opticaldrive.h>
+#include <solid/devicenotifier.h>
#include <iostream>
-#include <solid/devicenotifier.h>
-using namespace std;
static const char appName[] = "solid-hardware";
static const char programName[] = I18N_NOOP("solid-hardware");
{
KCmdLineArgs::enable_i18n();
- cout << endl << i18n("Syntax:") << endl << endl;
+ std::cout << endl << i18n("Syntax:") << endl << endl;
- cout << " solid-hardware list [details|nonportableinfo]" << endl;
- cout << i18n(" # List the hardware available in the system.\n"
+ std::cout << " solid-hardware list [details|nonportableinfo]" << endl;
+ std::cout << i18n(" # List the hardware available in the system.\n"
" # - If the 'nonportableinfo' option is specified, the device\n"
" # properties are listed (be careful, in this case property names\n"
" # are backend dependent),\n"
" # neutral fashion,\n"
" # - Otherwise only device UDIs are listed.\n") << endl;
- cout << " solid-hardware details 'udi'" << endl;
- cout << i18n(" # Display all the interfaces and properties of the device\n"
+ std::cout << " solid-hardware details 'udi'" << endl;
+ std::cout << i18n(" # Display all the interfaces and properties of the device\n"
" # corresponding to 'udi' in a platform neutral fashion.\n") << endl;
- cout << " solid-hardware nonportableinfo 'udi'" << endl;
- cout << i18n(" # Display all the properties of the device corresponding to 'udi'\n"
+ std::cout << " solid-hardware nonportableinfo 'udi'" << endl;
+ std::cout << i18n(" # Display all the properties of the device corresponding to 'udi'\n"
" # (be careful, in this case property names are backend dependent).\n") << endl;
- cout << " solid-hardware query 'predicate' ['parentUdi']" << endl;
- cout << i18n(" # List the UDI of devices corresponding to 'predicate'.\n"
+ std::cout << " solid-hardware query 'predicate' ['parentUdi']" << endl;
+ std::cout << i18n(" # List the UDI of devices corresponding to 'predicate'.\n"
" # - If 'parentUdi' is specified, the search is restricted to the\n"
" # branch of the corresponding device,\n"
" # - Otherwise the search is done on all the devices.\n") << endl;
- cout << " solid-hardware mount 'udi'" << endl;
- cout << i18n(" # If applicable, mount the device corresponding to 'udi'.\n") << endl;
+ std::cout << " solid-hardware mount 'udi'" << endl;
+ std::cout << i18n(" # If applicable, mount the device corresponding to 'udi'.\n") << endl;
- cout << " solid-hardware unmount 'udi'" << endl;
- cout << i18n(" # If applicable, unmount the device corresponding to 'udi'.\n") << endl;
+ std::cout << " solid-hardware unmount 'udi'" << endl;
+ std::cout << i18n(" # If applicable, unmount the device corresponding to 'udi'.\n") << endl;
- cout << " solid-hardware eject 'udi'" << endl;
- cout << i18n(" # If applicable, eject the device corresponding to 'udi'.\n") << endl;
+ std::cout << " solid-hardware eject 'udi'" << endl;
+ std::cout << i18n(" # If applicable, eject the device corresponding to 'udi'.\n") << endl;
- cout << " solid-hardware listen" << endl;
- cout << i18n(" # Listen to all add/remove events on supported hardware.") << endl;
+ std::cout << " solid-hardware listen" << endl;
+ std::cout << i18n(" # Listen to all add/remove events on supported hardware.") << endl;
return 0;
}
}
else
{
- cerr << i18n("Syntax Error: Unknown command '%1'" ,command) << endl;
+ std::cerr << i18n("Syntax Error: Unknown command '%1'" ,command) << endl;
}
return false;
foreach (const Solid::Device &device, all)
{
- cout << "udi = '" << device.udi() << "'" << endl;
+ std::cout << "udi = '" << device.udi() << "'" << endl;
if (interfaces)
{
- cout << device << endl;
+ std::cout << device << endl;
}
else if (system && device.is<Solid::GenericInterface>())
{
QMap<QString,QVariant> properties = device.as<Solid::GenericInterface>()->allProperties();
- cout << properties << endl;
+ std::cout << properties << endl;
}
}
{
const Solid::Device device(udi);
- cout << "udi = '" << device.udi() << "'" << endl;
- cout << device << endl;
+ std::cout << "udi = '" << device.udi() << "'" << endl;
+ std::cout << device << endl;
return true;
}
{
const Solid::Device device(udi);
- cout << "udi = '" << device.udi() << "'" << endl;
+ std::cout << "udi = '" << device.udi() << "'" << endl;
if (device.is<Solid::GenericInterface>()) {
QMap<QString,QVariant> properties = device.as<Solid::GenericInterface>()->allProperties();
- cout << properties << endl;
+ std::cout << properties << endl;
}
return true;
foreach (const Solid::Device &device, devices)
{
- cout << "udi = '" << device.udi() << "'" << endl;
+ std::cout << "udi = '" << device.udi() << "'" << endl;
}
return true;
if (!device.is<Solid::StorageAccess>() && type!=Eject)
{
- cerr << i18n("Error: %1 does not have the interface StorageAccess." , udi) << endl;
+ std::cerr << i18n("Error: %1 does not have the interface StorageAccess." , udi) << endl;
return false;
}
else if (!device.is<Solid::OpticalDrive>() && type==Eject)
{
- cerr << i18n("Error: %1 does not have the interface OpticalDrive." , udi) << endl;
+ std::cerr << i18n("Error: %1 does not have the interface OpticalDrive." , udi) << endl;
return false;
}
if (m_error)
{
- cerr << i18n("Error: %1" , m_errorString) << endl;
+ std::cerr << i18n("Error: %1" , m_errorString) << endl;
return false;
}
return false;
}
- cout << "Listening to add/remove events: " << endl;
+ std::cout << "Listening to add/remove events: " << endl;
m_loop.exec();
return true;
}
void SolidHardware::slotPercent(KJob *job, unsigned long percent)
{
Q_UNUSED(job)
- cout << i18n("Progress: %1%" , percent) << endl;
+ std::cout << i18n("Progress: %1%" , percent) << endl;
}
void SolidHardware::slotInfoMessage(KJob *job, const QString &message)
{
Q_UNUSED(job)
- cout << i18n("Info: %1" , message) << endl;
+ std::cout << i18n("Info: %1" , message) << endl;
}
void SolidHardware::deviceAdded(const QString &udi)
{
- cout << "Device Added:" << endl;
- cout << "udi = '" << udi << "'" << endl;
+ std::cout << "Device Added:" << endl;
+ std::cout << "udi = '" << udi << "'" << endl;
}
void SolidHardware::deviceRemoved(const QString &udi)
{
- cout << "Device Removed:" << endl;
- cout << "udi = '" << udi << "'" << endl;
+ std::cout << "Device Removed:" << endl;
+ std::cout << "udi = '" << udi << "'" << endl;
}