summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehw
diff options
context:
space:
mode:
Diffstat (limited to 'tdecore/tdehw')
-rw-r--r--tdecore/tdehw/networkbackends/network-manager/network-manager.cpp44
-rw-r--r--tdecore/tdehw/networkbackends/network-manager/network-manager.h2
-rw-r--r--tdecore/tdehw/networkbackends/network-manager/network-manager_p.h4
-rw-r--r--tdecore/tdehw/tdecryptographiccarddevice.cpp6
-rw-r--r--tdecore/tdehw/tdecryptographiccarddevice.h2
-rw-r--r--tdecore/tdehw/tdeeventdevice.cpp8
-rw-r--r--tdecore/tdehw/tdeeventdevice.h2
-rw-r--r--tdecore/tdehw/tdegenericdevice.h2
-rw-r--r--tdecore/tdehw/tdehardwaredevices.cpp91
-rw-r--r--tdecore/tdehw/tdehardwaredevices.h2
-rw-r--r--tdecore/tdehw/tdenetworkconnections.cpp10
-rw-r--r--tdecore/tdehw/tdenetworkconnections.h4
-rw-r--r--tdecore/tdehw/tdestoragedevice.cpp6
-rw-r--r--tdecore/tdehw/tdestoragedevice.h3
14 files changed, 78 insertions, 108 deletions
diff --git a/tdecore/tdehw/networkbackends/network-manager/network-manager.cpp b/tdecore/tdehw/networkbackends/network-manager/network-manager.cpp
index 3e8ef6daa..754fd31b8 100644
--- a/tdecore/tdehw/networkbackends/network-manager/network-manager.cpp
+++ b/tdecore/tdehw/networkbackends/network-manager/network-manager.cpp
@@ -1259,23 +1259,23 @@ TDENetworkConnectionManager_BackendNM::TDENetworkConnectionManager_BackendNM(TDE
}
// Connect global signals
- connect(d->m_networkManagerProxy, SIGNAL(StateChanged(TQ_UINT32)), d, SLOT(internalProcessGlobalStateChanged(TQ_UINT32)));
+ connect(d->m_networkManagerProxy, TQ_SIGNAL(StateChanged(TQ_UINT32)), d, TQ_SLOT(internalProcessGlobalStateChanged(TQ_UINT32)));
// Connect VPN signals
if (d->m_vpnProxy) {
- connect(d->m_vpnProxy, SIGNAL(StateChanged(TQ_UINT32)), d, SLOT(internalProcessVPNStateChanged(TQ_UINT32)));
- connect(d->m_vpnProxy, SIGNAL(LoginBanner(const TQString&)), d, SLOT(internalProcessVPNLoginBanner(const TQString&)));
- connect(d->m_vpnProxy, SIGNAL(Failure(TQ_UINT32)), d, SLOT(internalProcessVPNFailure(TQ_UINT32)));
+ connect(d->m_vpnProxy, TQ_SIGNAL(StateChanged(TQ_UINT32)), d, TQ_SLOT(internalProcessVPNStateChanged(TQ_UINT32)));
+ connect(d->m_vpnProxy, TQ_SIGNAL(LoginBanner(const TQString&)), d, TQ_SLOT(internalProcessVPNLoginBanner(const TQString&)));
+ connect(d->m_vpnProxy, TQ_SIGNAL(Failure(TQ_UINT32)), d, TQ_SLOT(internalProcessVPNFailure(TQ_UINT32)));
}
// Connect local signals
if (d->m_networkDeviceProxy) {
- connect(d->m_networkDeviceProxy, SIGNAL(StateChanged(TQ_UINT32, TQ_UINT32, TQ_UINT32)), d, SLOT(internalProcessDeviceStateChanged(TQ_UINT32, TQ_UINT32, TQ_UINT32)));
+ connect(d->m_networkDeviceProxy, TQ_SIGNAL(StateChanged(TQ_UINT32, TQ_UINT32, TQ_UINT32)), d, TQ_SLOT(internalProcessDeviceStateChanged(TQ_UINT32, TQ_UINT32, TQ_UINT32)));
}
if (d->m_wiFiDeviceProxy) {
- connect(d->m_wiFiDeviceProxy, SIGNAL(AccessPointAdded(const TQT_DBusObjectPath&)), d, SLOT(internalProcessWiFiAccessPointAdded(const TQT_DBusObjectPath&)));
- connect(d->m_wiFiDeviceProxy, SIGNAL(AccessPointRemoved(const TQT_DBusObjectPath&)), d, SLOT(internalProcessWiFiAccessPointRemoved(const TQT_DBusObjectPath&)));
- connect(d->m_wiFiDeviceProxy, SIGNAL(PropertiesChanged(const TQMap<TQString, TQT_DBusVariant>&)), d, SLOT(internalProcessWiFiPropertiesChanged(const TQMap<TQString, TQT_DBusVariant>&)));
+ connect(d->m_wiFiDeviceProxy, TQ_SIGNAL(AccessPointAdded(const TQT_DBusObjectPath&)), d, TQ_SLOT(internalProcessWiFiAccessPointAdded(const TQT_DBusObjectPath&)));
+ connect(d->m_wiFiDeviceProxy, TQ_SIGNAL(AccessPointRemoved(const TQT_DBusObjectPath&)), d, TQ_SLOT(internalProcessWiFiAccessPointRemoved(const TQT_DBusObjectPath&)));
+ connect(d->m_wiFiDeviceProxy, TQ_SIGNAL(PropertiesChanged(const TQMap<TQString, TQT_DBusVariant>&)), d, TQ_SLOT(internalProcessWiFiPropertiesChanged(const TQMap<TQString, TQT_DBusVariant>&)));
}
// Create public lists
@@ -1510,7 +1510,7 @@ void TDENetworkConnectionManager_BackendNMPrivate::internalProcessWiFiAccessPoin
// Set up monitoring object
DBus::AccessPointProxy* apProxy = new DBus::AccessPointProxy(NM_DBUS_SERVICE, dbuspath);
apProxy->setConnection(TQT_DBusConnection::systemBus());
- connect(apProxy, SIGNAL(PropertiesChanged(const TQMap<TQString, TQT_DBusVariant>&)), this, SLOT(internalProcessAPPropertiesChanged(const TQMap<TQString, TQT_DBusVariant>&)));
+ connect(apProxy, TQ_SIGNAL(PropertiesChanged(const TQMap<TQString, TQT_DBusVariant>&)), this, TQ_SLOT(internalProcessAPPropertiesChanged(const TQMap<TQString, TQT_DBusVariant>&)));
m_accessPointProxyList[dbuspath] = (apProxy);
// Notify client applications
@@ -1599,7 +1599,7 @@ TDENetworkConnectionType::TDENetworkConnectionType TDENetworkConnectionManager_B
// Obtain connection settings from the path specified
DBus::ConnectionSettingsInterface connectionSettings(NM_DBUS_SERVICE, dbusPath);
connectionSettings.setConnection(TQT_DBusConnection::systemBus());
- connect(&connectionSettings, SIGNAL(GetSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)), d, SLOT(processConnectionSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)));
+ connect(&connectionSettings, TQ_SIGNAL(GetSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)), d, TQ_SLOT(processConnectionSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)));
int asyncCallID;
ret = connectionSettings.GetSettingsAsync(asyncCallID, error);
if (ret && error.isValid()) {
@@ -1928,8 +1928,8 @@ void TDENetworkConnectionManager_BackendNM::loadConnectionInformation() {
// Obtain connection settings from the path specified
DBus::ConnectionSettingsInterface connectionSettings(NM_DBUS_SERVICE, (*it));
connectionSettings.setConnection(TQT_DBusConnection::systemBus());
- connect(&connectionSettings, SIGNAL(GetSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)), d, SLOT(processConnectionSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)));
- connect(&connectionSettings, SIGNAL(AsyncErrorResponseDetected(int, const TQT_DBusError)), d, SLOT(processConnectionSettingsAsyncError(int, const TQT_DBusError)));
+ connect(&connectionSettings, TQ_SIGNAL(GetSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)), d, TQ_SLOT(processConnectionSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)));
+ connect(&connectionSettings, TQ_SIGNAL(AsyncErrorResponseDetected(int, const TQT_DBusError)), d, TQ_SLOT(processConnectionSettingsAsyncError(int, const TQT_DBusError)));
int asyncCallID;
ret = connectionSettings.GetSettingsAsync(asyncCallID, error);
if (ret && error.isValid()) {
@@ -3055,7 +3055,7 @@ bool TDENetworkConnectionManager_BackendNM::loadConnectionSecretsForGroup(TQStri
// Obtain connection secrets from the path specified
DBus::ConnectionSettingsInterface connectionSettings(NM_DBUS_SERVICE, existingConnection);
connectionSettings.setConnection(TQT_DBusConnection::systemBus());
- connect(&connectionSettings, SIGNAL(GetSecretsAsyncReply(int, const TQT_DBusDataMap<TQString>&)), d, SLOT(processConnectionSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)));
+ connect(&connectionSettings, TQ_SIGNAL(GetSecretsAsyncReply(int, const TQT_DBusDataMap<TQString>&)), d, TQ_SLOT(processConnectionSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)));
int asyncCallID;
ret = connectionSettings.GetSecretsAsync(asyncCallID, group, error);
if (ret && error.isValid()) {
@@ -3260,7 +3260,7 @@ bool TDENetworkConnectionManager_BackendNM::saveConnection(TDENetworkConnection*
// Obtain connection settings from the path specified
DBus::ConnectionSettingsInterface connectionSettings(NM_DBUS_SERVICE, existingConnection);
connectionSettings.setConnection(TQT_DBusConnection::systemBus());
- connect(&connectionSettings, SIGNAL(GetSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)), d, SLOT(processConnectionSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)));
+ connect(&connectionSettings, TQ_SIGNAL(GetSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)), d, TQ_SLOT(processConnectionSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&)));
int asyncCallID;
ret = connectionSettings.GetSettingsAsync(asyncCallID, error);
if (ret && error.isValid()) {
@@ -4492,7 +4492,7 @@ bool TDENetworkConnectionManager_BackendNM::saveConnection(TDENetworkConnection*
// Save connection settings to the path specified
DBus::ConnectionSettingsInterface connectionSettings(NM_DBUS_SERVICE, existingConnection);
connectionSettings.setConnection(TQT_DBusConnection::systemBus());
- connect(&connectionSettings, SIGNAL(UpdateAsyncReply(int)), d, SLOT(processConnectionSettingsUpdateAsyncReply(int)));
+ connect(&connectionSettings, TQ_SIGNAL(UpdateAsyncReply(int)), d, TQ_SLOT(processConnectionSettingsUpdateAsyncReply(int)));
int asyncCallID;
ret = connectionSettings.UpdateAsync(asyncCallID, connectionSettingsMap, error);
if (ret && error.isValid()) {
@@ -4526,8 +4526,8 @@ bool TDENetworkConnectionManager_BackendNM::saveConnection(TDENetworkConnection*
printf("[network-manager comm debug] Creating new connection\n"); fflush(stdout);
#endif // DEBUG_NETWORK_MANAGER_COMMUNICATIONS
// Create new connection
- connect(d->m_networkManagerSettings, SIGNAL(AddConnectionAsyncReply(int, const TQT_DBusObjectPath&)), d, SLOT(processAddConnectionAsyncReply(int, const TQT_DBusObjectPath&)));
- connect(d->m_networkManagerSettings, SIGNAL(AsyncErrorResponseDetected(int, const TQT_DBusError)), d, SLOT(processAddConnectionAsyncError(int, const TQT_DBusError)));
+ connect(d->m_networkManagerSettings, TQ_SIGNAL(AddConnectionAsyncReply(int, const TQT_DBusObjectPath&)), d, TQ_SLOT(processAddConnectionAsyncReply(int, const TQT_DBusObjectPath&)));
+ connect(d->m_networkManagerSettings, TQ_SIGNAL(AsyncErrorResponseDetected(int, const TQT_DBusError)), d, TQ_SLOT(processAddConnectionAsyncError(int, const TQT_DBusError)));
int asyncCallID;
ret = d->m_networkManagerSettings->AddConnectionAsync(asyncCallID, connectionSettingsMap, error);
if (ret && error.isValid()) {
@@ -4580,7 +4580,7 @@ bool TDENetworkConnectionManager_BackendNM::deleteConnection(TQString uuid) {
// Obtain connection secrets from the path specified
DBus::ConnectionSettingsInterface connectionSettings(NM_DBUS_SERVICE, existingConnection);
connectionSettings.setConnection(TQT_DBusConnection::systemBus());
- connect(&connectionSettings, SIGNAL(DeleteAsyncReply(int)), d, SLOT(processConnectionSettingsUpdateAsyncReply(int)));
+ connect(&connectionSettings, TQ_SIGNAL(DeleteAsyncReply(int)), d, TQ_SLOT(processConnectionSettingsUpdateAsyncReply(int)));
int asyncCallID;
ret = connectionSettings.DeleteAsync(asyncCallID, error);
if (ret && error.isValid()) {
@@ -4804,8 +4804,8 @@ TDENetworkConnectionStatus::TDENetworkConnectionStatus TDENetworkConnectionManag
return checkConnectionStatus(uuid);
#else // USE_ASYNC_DBUS_CONNECTION_COMMAND_CALLS
#ifdef WAIT_FOR_OPERATION_BEFORE_RETURNING
- connect(d->m_networkManagerProxy, SIGNAL(ActivateConnectionAsyncReply(int, const TQT_DBusObjectPath&)), d, SLOT(processAddConnectionAsyncReply(int, const TQT_DBusObjectPath&)));
- connect(d->m_networkManagerProxy, SIGNAL(AsyncErrorResponseDetected(int, const TQT_DBusError)), d, SLOT(processAddConnectionAsyncError(int, const TQT_DBusError)));
+ connect(d->m_networkManagerProxy, TQ_SIGNAL(ActivateConnectionAsyncReply(int, const TQT_DBusObjectPath&)), d, TQ_SLOT(processAddConnectionAsyncReply(int, const TQT_DBusObjectPath&)));
+ connect(d->m_networkManagerProxy, TQ_SIGNAL(AsyncErrorResponseDetected(int, const TQT_DBusError)), d, TQ_SLOT(processAddConnectionAsyncError(int, const TQT_DBusError)));
#endif // WAIT_FOR_OPERATION_BEFORE_RETURNING
int asyncCallID;
ret = d->m_networkManagerProxy->ActivateConnectionAsync(asyncCallID, existingConnection, TQT_DBusObjectPath(d->m_dbusDeviceString.ascii()), TQT_DBusObjectPath("/"), error);
@@ -5000,7 +5000,7 @@ TDENetworkConnectionStatus::TDENetworkConnectionStatus TDENetworkConnectionManag
return checkConnectionStatus(uuid);
#else // USE_ASYNC_DBUS_CONNECTION_COMMAND_CALLS
#ifdef WAIT_FOR_OPERATION_BEFORE_RETURNING
- connect(d->m_networkManagerProxy, SIGNAL(DeactivateConnectionAsyncReply(int)), d, SLOT(processConnectionSettingsUpdateAsyncReply(int)));
+ connect(d->m_networkManagerProxy, TQ_SIGNAL(DeactivateConnectionAsyncReply(int)), d, TQ_SLOT(processConnectionSettingsUpdateAsyncReply(int)));
#endif // WAIT_FOR_OPERATION_BEFORE_RETURNING
int asyncCallID;
ret = d->m_networkManagerProxy->DeactivateConnectionAsync(asyncCallID, existingConnection, error);
@@ -5441,7 +5441,7 @@ TDENetworkConnectionManager_BackendNMPrivate::TDENetworkConnectionManager_Backen
// Set up global signal handler
m_dbusSignalConnection = new TQT_DBusConnection(TQT_DBusConnection::systemBus());
m_dbusSignalReceiver = new TDENetworkConnectionManager_BackendNM_DBusSignalReceiver(this);
- m_dbusSignalConnection->connect(m_dbusSignalReceiver, TQT_SLOT(dbusSignal(const TQT_DBusMessage&)));
+ m_dbusSignalConnection->connect(m_dbusSignalReceiver, TQ_SLOT(dbusSignal(const TQT_DBusMessage&)));
}
TDENetworkConnectionManager_BackendNMPrivate::~TDENetworkConnectionManager_BackendNMPrivate() {
diff --git a/tdecore/tdehw/networkbackends/network-manager/network-manager.h b/tdecore/tdehw/networkbackends/network-manager/network-manager.h
index f14e4992e..8af99e846 100644
--- a/tdecore/tdehw/networkbackends/network-manager/network-manager.h
+++ b/tdecore/tdehw/networkbackends/network-manager/network-manager.h
@@ -211,7 +211,7 @@ class TDENetworkConnectionManager_BackendNMPrivate;
class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkConnectionManager
{
- Q_OBJECT
+ TQ_OBJECT
public:
TDENetworkConnectionManager_BackendNM(TDENetworkDevice* networkDevice);
diff --git a/tdecore/tdehw/networkbackends/network-manager/network-manager_p.h b/tdecore/tdehw/networkbackends/network-manager/network-manager_p.h
index 61ce31329..43cafda25 100644
--- a/tdecore/tdehw/networkbackends/network-manager/network-manager_p.h
+++ b/tdecore/tdehw/networkbackends/network-manager/network-manager_p.h
@@ -71,7 +71,7 @@ class TDENetworkConnectionManager_BackendNMPrivate;
class TDENetworkConnectionManager_BackendNM_DBusSignalReceiver : public TQObject
{
- Q_OBJECT
+ TQ_OBJECT
public:
TDENetworkConnectionManager_BackendNM_DBusSignalReceiver(TDENetworkConnectionManager_BackendNMPrivate*);
@@ -86,7 +86,7 @@ class TDENetworkConnectionManager_BackendNM_DBusSignalReceiver : public TQObject
class TDENetworkConnectionManager_BackendNMPrivate : public TQObject
{
- Q_OBJECT
+ TQ_OBJECT
public:
TDENetworkConnectionManager_BackendNMPrivate(TDENetworkConnectionManager_BackendNM*);
diff --git a/tdecore/tdehw/tdecryptographiccarddevice.cpp b/tdecore/tdehw/tdecryptographiccarddevice.cpp
index c593d2ab6..4d9eeaab3 100644
--- a/tdecore/tdehw/tdecryptographiccarddevice.cpp
+++ b/tdecore/tdehw/tdecryptographiccarddevice.cpp
@@ -509,9 +509,9 @@ void TDECryptographicCardDevice::enableCardMonitoring(bool enable) {
m_watcherObject->cardDevice = this;
m_watcherObject->moveToThread(m_watcherThread);
- TQObject::connect(m_watcherObject, SIGNAL(statusChanged(TQString,TQString)), this, SLOT(cardStatusChanged(TQString,TQString)));
- TQObject::connect(m_watcherObject, SIGNAL(pinRequested(TQString)), this, SLOT(workerRequestedPin(TQString)));
- TQTimer::singleShot(0, m_watcherObject, SLOT(run()));
+ TQObject::connect(m_watcherObject, TQ_SIGNAL(statusChanged(TQString,TQString)), this, TQ_SLOT(cardStatusChanged(TQString,TQString)));
+ TQObject::connect(m_watcherObject, TQ_SIGNAL(pinRequested(TQString)), this, TQ_SLOT(workerRequestedPin(TQString)));
+ TQTimer::singleShot(0, m_watcherObject, TQ_SLOT(run()));
m_watcherThread->start();
}
diff --git a/tdecore/tdehw/tdecryptographiccarddevice.h b/tdecore/tdehw/tdecryptographiccarddevice.h
index 0907322d7..8b3bd211a 100644
--- a/tdecore/tdehw/tdecryptographiccarddevice.h
+++ b/tdecore/tdehw/tdecryptographiccarddevice.h
@@ -38,7 +38,7 @@ typedef TQValueListIterator<X509*> X509CertificatePtrListIterator;
class TDECORE_EXPORT TDECryptographicCardDevice : public TDEGenericDevice
{
- Q_OBJECT
+ TQ_OBJECT
public:
/**
diff --git a/tdecore/tdehw/tdeeventdevice.cpp b/tdecore/tdehw/tdeeventdevice.cpp
index c528a42db..3223e80e7 100644
--- a/tdecore/tdehw/tdeeventdevice.cpp
+++ b/tdecore/tdehw/tdeeventdevice.cpp
@@ -349,7 +349,7 @@ void TDEEventDevice::internalStartMonitoring(TDEHardwareDevices* hwmanager) {
if (eventType() != TDEEventDeviceType::Unknown) {
if (m_fd >= 0) {
m_eventNotifier = new TQSocketNotifier(m_fd, TQSocketNotifier::Read, this);
- connect( m_eventNotifier, TQT_SIGNAL(activated(int)), this, TQT_SLOT(eventReceived()) );
+ connect( m_eventNotifier, TQ_SIGNAL(activated(int)), this, TQ_SLOT(eventReceived()) );
m_monitorActive = true;
}
}
@@ -357,7 +357,7 @@ void TDEEventDevice::internalStartMonitoring(TDEHardwareDevices* hwmanager) {
// get initial state of switches
internalReadProvidedSwitches();
internalReadActiveSwitches();
- connect( this, TQT_SIGNAL(keyPressed(unsigned int, TDEEventDevice*)), hwmanager, TQT_SLOT(processEventDeviceKeyPressed(unsigned int, TDEEventDevice*)) );
+ connect( this, TQ_SIGNAL(keyPressed(unsigned int, TDEEventDevice*)), hwmanager, TQ_SLOT(processEventDeviceKeyPressed(unsigned int, TDEEventDevice*)) );
}
}
}
@@ -387,9 +387,9 @@ void TDEEventDevice::processActiveSwitches() {
}
void TDEEventDevice::connectNotify( const char* signal ) {
- if( !m_monitorActive && qstrcmp( signal, TQT_SIGNAL(switchChanged())) == 0 ) {
+ if( !m_monitorActive && qstrcmp( signal, TQ_SIGNAL(switchChanged())) == 0 ) {
m_watchTimer = new TQTimer(this);
- connect( m_watchTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(processActiveSwitches()) );
+ connect( m_watchTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(processActiveSwitches()) );
m_watchTimer->start( 2500, false );
m_monitorActive = true;
diff --git a/tdecore/tdehw/tdeeventdevice.h b/tdecore/tdehw/tdeeventdevice.h
index 64130508c..a1f1af6a6 100644
--- a/tdecore/tdehw/tdeeventdevice.h
+++ b/tdecore/tdehw/tdeeventdevice.h
@@ -79,7 +79,7 @@ class TQSocketNotifier;
class TDECORE_EXPORT TDEEventDevice : public TDEGenericDevice
{
- Q_OBJECT
+ TQ_OBJECT
public:
/**
diff --git a/tdecore/tdehw/tdegenericdevice.h b/tdecore/tdehw/tdegenericdevice.h
index 91e9ac79e..53804cf96 100644
--- a/tdecore/tdehw/tdegenericdevice.h
+++ b/tdecore/tdehw/tdegenericdevice.h
@@ -30,7 +30,7 @@
class TDECORE_EXPORT TDEGenericDevice : public TQObject
{
- Q_OBJECT
+ TQ_OBJECT
public:
/**
diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp
index 0da216a87..59db6d0ae 100644
--- a/tdecore/tdehw/tdehardwaredevices.cpp
+++ b/tdecore/tdehw/tdehardwaredevices.cpp
@@ -89,22 +89,13 @@ timespec diff(timespec start, timespec end)
return temp;
}
-// BEGIN BLOCK
-// Copied from include/linux/genhd.h
-#define GENHD_FL_REMOVABLE 1
-#define GENHD_FL_MEDIA_CHANGE_NOTIFY 4
-#define GENHD_FL_CD 8
-#define GENHD_FL_UP 16
-#define GENHD_FL_SUPPRESS_PARTITION_INFO 32
-#define GENHD_FL_EXT_DEVT 64
-#define GENHD_FL_NATIVE_CAPACITY 128
-#define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE 256
-// END BLOCK
-
// NOTE TO DEVELOPERS
// This command will greatly help when attempting to find properties to distinguish one device from another
// udevadm info --query=all --path=/sys/....
+// Some local utility functions and constants
+namespace {
+
// This routine is courtsey of an answer on "Stack Overflow"
// It takes an LSB-first int and makes it an MSB-first int (or vice versa)
unsigned int reverse_bits(unsigned int x)
@@ -116,11 +107,24 @@ unsigned int reverse_bits(unsigned int x)
return((x >> 16) | (x << 16));
}
+// Read the content of a file that supposed to contain a single line
+TQString readLineFile(TQString fname) {
+ TQFile file( fname );
+ if ( file.open( IO_ReadOnly ) ) {
+ TQTextStream stream( &file );
+ return stream.readLine();
+ } else {
+ return TQString::null;
+ }
+}
+
+} // namespace
+
// Helper function implemented in tdestoragedevice.cpp
TQString decodeHexEncoding(TQString str);
extern "C" {
- KDE_EXPORT TDEHardwareDevices* create_tdeHardwareDevices()
+ TDE_EXPORT TDEHardwareDevices* create_tdeHardwareDevices()
{
return new TDEHardwareDevices();
}
@@ -151,7 +155,7 @@ TDEHardwareDevices::TDEHardwareDevices() {
int udevmonitorfd = udev_monitor_get_fd(m_udevMonitorStruct);
if (udevmonitorfd >= 0) {
m_devScanNotifier = new TQSocketNotifier(udevmonitorfd, TQSocketNotifier::Read, this);
- connect( m_devScanNotifier, TQT_SIGNAL(activated(int)), this, TQT_SLOT(processHotPluggedHardware()) );
+ connect( m_devScanNotifier, TQ_SIGNAL(activated(int)), this, TQ_SLOT(processHotPluggedHardware()) );
}
// Read in the current mount table
@@ -173,7 +177,7 @@ TDEHardwareDevices::TDEHardwareDevices() {
m_procMountsFd = open("/proc/mounts", O_RDONLY, 0);
if (m_procMountsFd >= 0) {
m_mountScanNotifier = new TQSocketNotifier(m_procMountsFd, TQSocketNotifier::Exception, this);
- connect( m_mountScanNotifier, TQT_SIGNAL(activated(int)), this, TQT_SLOT(processModifiedMounts()) );
+ connect( m_mountScanNotifier, TQ_SIGNAL(activated(int)), this, TQ_SLOT(processModifiedMounts()) );
}
// Read in the current cpu information
@@ -195,20 +199,20 @@ TDEHardwareDevices::TDEHardwareDevices() {
// Monitor for changed cpu information
// Watched directories are set up during the initial CPU scan
m_cpuWatch = new KSimpleDirWatch(this);
- connect( m_cpuWatch, TQT_SIGNAL(dirty(const TQString &)), this, TQT_SLOT(processModifiedCPUs()) );
+ connect( m_cpuWatch, TQ_SIGNAL(dirty(const TQString &)), this, TQ_SLOT(processModifiedCPUs()) );
#else
m_cpuWatchTimer = new TQTimer(this);
- connect( m_cpuWatchTimer, SIGNAL(timeout()), this, SLOT(processModifiedCPUs()) );
+ connect( m_cpuWatchTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(processModifiedCPUs()) );
#endif
// Some devices do not receive update signals from udev
// These devices must be polled, and a good polling interval is 1 second
m_deviceWatchTimer = new TQTimer(this);
- connect( m_deviceWatchTimer, SIGNAL(timeout()), this, SLOT(processStatelessDevices()) );
+ connect( m_deviceWatchTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(processStatelessDevices()) );
// Special case for battery and power supply polling (longer delay, 5 seconds)
m_batteryWatchTimer = new TQTimer(this);
- connect( m_batteryWatchTimer, SIGNAL(timeout()), this, SLOT(processBatteryDevices()) );
+ connect( m_batteryWatchTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(processBatteryDevices()) );
// Update internal device information.
queryHardwareInformation();
@@ -2511,36 +2515,6 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
sdevice->internalSetFileSystemName("pictbridge");
}
else {
- bool removable = false;
- bool hotpluggable = false;
-
- // We can get the removable flag, but we have no idea if the device has the ability to notify on media insertion/removal
- // If there is no such notification possible, then we should not set the removable flag
- // udev can be such an amazing pain at times
- // It exports a /capabilities node with no info on what the bits actually mean
- // This information is very poorly documented as a set of #defines in include/linux/genhd.h
- // We are specifically interested in GENHD_FL_REMOVABLE and GENHD_FL_MEDIA_CHANGE_NOTIFY
- // The "removable" flag should also really be renamed to "hotpluggable", as that is far more precise...
- TQString capabilitynodename = systempath;
- capabilitynodename.append("/capability");
- TQFile capabilityfile( capabilitynodename );
- unsigned int capabilities = 0;
- if ( capabilityfile.open( IO_ReadOnly ) ) {
- TQTextStream stream( &capabilityfile );
- TQString capabilitystring;
- capabilitystring = stream.readLine();
- capabilities = capabilitystring.toUInt();
- capabilityfile.close();
- }
- if (capabilities & GENHD_FL_REMOVABLE) {
- // FIXME
- // For added fun this is not always true; i.e. GENHD_FL_REMOVABLE can be set when the device cannot be hotplugged (floppy drives).
- hotpluggable = true;
- }
- if (capabilities & GENHD_FL_MEDIA_CHANGE_NOTIFY) {
- removable = true;
- }
-
// See if any other devices are exclusively using this device, such as the Device Mapper
TQStringList holdingDeviceNodes;
TQString holdersnodename = udev_device_get_syspath(dev);
@@ -2733,21 +2707,16 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
}
}
- if (removable) {
+ if (readLineFile( systempath + "/removable" ).toUInt()) {
diskstatus = diskstatus | TDEDiskDeviceStatus::Removable;
}
- if (hotpluggable) {
- diskstatus = diskstatus | TDEDiskDeviceStatus::Hotpluggable;
- }
// Force removable flag for flash disks
// udev reports disks as non-removable for card readers on PCI controllers
- if (((disktype & TDEDiskDeviceType::CompactFlash)
+ else if ((disktype & TDEDiskDeviceType::CompactFlash)
|| (disktype & TDEDiskDeviceType::MemoryStick)
|| (disktype & TDEDiskDeviceType::SmartMedia)
- || (disktype & TDEDiskDeviceType::SDMMC))
- && !(diskstatus & TDEDiskDeviceStatus::Removable)
- && !(diskstatus & TDEDiskDeviceStatus::Hotpluggable)) {
- diskstatus = diskstatus | TDEDiskDeviceStatus::Hotpluggable;
+ || (disktype & TDEDiskDeviceType::SDMMC)) {
+ diskstatus = diskstatus | TDEDiskDeviceStatus::Removable;
}
if ((!filesystemtype.isEmpty()) && (filesystemtype.upper() != "CRYPTO_LUKS") &&
@@ -2765,7 +2734,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
// type string too. For example for LUKS disk, ID_TYPE is null and DEVTYPE is "disk"
diskstatus = diskstatus & ~TDEDiskDeviceStatus::Mountable;
}
- if (removable) {
+ if ( diskstatus & TDEDiskDeviceStatus::Removable ) {
if (sdevice->mediaInserted()) {
diskstatus = diskstatus | TDEDiskDeviceStatus::Inserted;
}
@@ -2955,7 +2924,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
ndevice->internalSetIpV6Netmask(address);
}
}
- s = getnameinfo(ifa->ifa_ifu.ifu_broadaddr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
+ s = ifa->ifa_ifu.ifu_broadaddr ? getnameinfo(ifa->ifa_ifu.ifu_broadaddr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST) : EAI_NONAME;
if (s == 0) {
TQString address(host);
if (family == AF_INET) {
@@ -2966,7 +2935,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
ndevice->internalSetIpV6Broadcast(address);
}
}
- s = getnameinfo(ifa->ifa_ifu.ifu_dstaddr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
+ s = ifa->ifa_ifu.ifu_dstaddr ? getnameinfo(ifa->ifa_ifu.ifu_dstaddr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST) : EAI_NONAME;
if (s == 0) {
TQString address(host);
if (family == AF_INET) {
diff --git a/tdecore/tdehw/tdehardwaredevices.h b/tdecore/tdehw/tdehardwaredevices.h
index db63e9d34..4e4259dfc 100644
--- a/tdecore/tdehw/tdehardwaredevices.h
+++ b/tdecore/tdehw/tdehardwaredevices.h
@@ -81,7 +81,7 @@ typedef TQDict<TDECPUDevice> TDECPUDeviceCache;
class TDECORE_EXPORT TDEHardwareDevices : public TQObject
{
- Q_OBJECT
+ TQ_OBJECT
public:
/**
diff --git a/tdecore/tdehw/tdenetworkconnections.cpp b/tdecore/tdehw/tdenetworkconnections.cpp
index 0b6405ea3..9a273cebb 100644
--- a/tdecore/tdehw/tdenetworkconnections.cpp
+++ b/tdecore/tdehw/tdenetworkconnections.cpp
@@ -41,7 +41,7 @@
/*================================================================================================*/
extern "C" {
- KDE_EXPORT TDEGlobalNetworkManager* create_tdeGlobalNetworkManager()
+ TDE_EXPORT TDEGlobalNetworkManager* create_tdeGlobalNetworkManager()
{
return new TDEGlobalNetworkManager();
}
@@ -707,7 +707,7 @@ TDEWiFiConnection::~TDEWiFiConnection() {
TDENetworkConnectionManager::TDENetworkConnectionManager(TDENetworkDevice *networkDevice) : TQObject(), m_connectionList(NULL), m_hwNeighborList(NULL), m_networkDevice(networkDevice), m_prevConnectionStatus(TDENetworkGlobalManagerFlags::Unknown) {
m_emissionTimer = new TQTimer();
- connect(m_emissionTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(emitQueuedSignals()));
+ connect(m_emissionTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(emitQueuedSignals()));
if (!m_emissionTimer->isActive()) m_emissionTimer->start(0, true);
}
@@ -962,9 +962,9 @@ TDEGlobalNetworkManager::TDEGlobalNetworkManager() : m_internalConnectionManager
m_internalConnectionManager = new TDENetworkConnectionManager_BackendNM(NULL);
#endif // WITH_NETWORK_MANAGER_BACKEND
if (m_internalConnectionManager) {
- connect(m_internalConnectionManager, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)), this, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)));
- connect(m_internalConnectionManager, SIGNAL(vpnEvent(TDENetworkVPNEventType::TDENetworkVPNEventType, TQString)), this, SIGNAL(vpnEvent(TDENetworkVPNEventType::TDENetworkVPNEventType, TQString)));
- connect(m_internalConnectionManager, SIGNAL(networkManagementEvent(TDENetworkGlobalEventType::TDENetworkGlobalEventType)), this, SIGNAL(networkManagementEvent(TDENetworkGlobalEventType::TDENetworkGlobalEventType)));
+ connect(m_internalConnectionManager, TQ_SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)), this, TQ_SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)));
+ connect(m_internalConnectionManager, TQ_SIGNAL(vpnEvent(TDENetworkVPNEventType::TDENetworkVPNEventType, TQString)), this, TQ_SIGNAL(vpnEvent(TDENetworkVPNEventType::TDENetworkVPNEventType, TQString)));
+ connect(m_internalConnectionManager, TQ_SIGNAL(networkManagementEvent(TDENetworkGlobalEventType::TDENetworkGlobalEventType)), this, TQ_SIGNAL(networkManagementEvent(TDENetworkGlobalEventType::TDENetworkGlobalEventType)));
}
}
diff --git a/tdecore/tdehw/tdenetworkconnections.h b/tdecore/tdehw/tdenetworkconnections.h
index 806c162a8..aa44e8edb 100644
--- a/tdecore/tdehw/tdenetworkconnections.h
+++ b/tdecore/tdehw/tdenetworkconnections.h
@@ -1015,7 +1015,7 @@ class TQTimer;
class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject
{
- Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -1364,7 +1364,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject
class TDECORE_EXPORT TDEGlobalNetworkManager : public TQObject
{
- Q_OBJECT
+ TQ_OBJECT
public:
/**
diff --git a/tdecore/tdehw/tdestoragedevice.cpp b/tdecore/tdehw/tdestoragedevice.cpp
index 08fb246e1..df5f90ab7 100644
--- a/tdecore/tdehw/tdestoragedevice.cpp
+++ b/tdecore/tdehw/tdestoragedevice.cpp
@@ -504,7 +504,7 @@ TQString TDEStorageDevice::friendlyName() {
TQString label = diskLabel();
if (label.isNull()) {
if (deviceSize() > 0) {
- if (checkDiskStatus(TDEDiskDeviceStatus::Hotpluggable)) {
+ if (checkDiskStatus(TDEDiskDeviceStatus::Removable)) {
label = i18n("%1 Removable Device").arg(deviceFriendlySize());
}
else {
@@ -561,7 +561,7 @@ TQString TDEStorageDevice::friendlyDeviceType() {
if (isDiskOfType(TDEDiskDeviceType::HDD)) {
ret = i18n("Hard Disk Drive");
- if (checkDiskStatus(TDEDiskDeviceStatus::Hotpluggable)) {
+ if (checkDiskStatus(TDEDiskDeviceStatus::Removable)) {
ret = i18n("Removable Storage");
}
if (isDiskOfType(TDEDiskDeviceType::CompactFlash)) {
@@ -632,7 +632,7 @@ TQPixmap TDEStorageDevice::icon(TDEIcon::StdSizes size) {
if (isDiskOfType(TDEDiskDeviceType::HDD)) {
ret = DesktopIcon("drive-harddisk" + mountString, size);
- if (checkDiskStatus(TDEDiskDeviceStatus::Hotpluggable)) {
+ if (checkDiskStatus(TDEDiskDeviceStatus::Removable)) {
ret = DesktopIcon("media-flash-usb" + mountString, size);
}
if (isDiskOfType(TDEDiskDeviceType::CompactFlash)) {
diff --git a/tdecore/tdehw/tdestoragedevice.h b/tdecore/tdehw/tdestoragedevice.h
index c279586f8..891b31573 100644
--- a/tdecore/tdehw/tdestoragedevice.h
+++ b/tdecore/tdehw/tdestoragedevice.h
@@ -22,6 +22,7 @@
#include "tdegenericdevice.h"
#include "tqvariant.h"
+#include "kdemacros.h"
struct crypt_device;
@@ -107,7 +108,7 @@ enum TDEDiskDeviceStatus {
UsedByDevice = 0x00000010,
UsesDevice = 0x00000020,
ContainsFilesystem = 0x00000040,
- Hotpluggable = 0x00000080,
+ // Do not use 0x00000080, it was `Hotpluggable` up to the R14.1.x series
Hidden = 0x00000100,
Other = 0x80000000
};