summaryrefslogtreecommitdiffstats
path: root/lib/kpilotdevicelink.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-01 00:37:32 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-01 00:37:32 +0000
commitf6f9c296c3f9d39a8c3d0ee64a542a47f450be28 (patch)
treed38fce8091ce66977004a5cb115768c7810aee30 /lib/kpilotdevicelink.cc
parente340db64991a06761aa6395ffe760b53e4c1dfbc (diff)
downloadkpilot-f6f9c296c3f9d39a8c3d0ee64a542a47f450be28.tar.gz
kpilot-f6f9c296c3f9d39a8c3d0ee64a542a47f450be28.zip
TQt4 port kpilot
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kpilot@1238903 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kpilotdevicelink.cc')
-rw-r--r--lib/kpilotdevicelink.cc66
1 files changed, 33 insertions, 33 deletions
diff --git a/lib/kpilotdevicelink.cc b/lib/kpilotdevicelink.cc
index 5fed796..e211eab 100644
--- a/lib/kpilotdevicelink.cc
+++ b/lib/kpilotdevicelink.cc
@@ -146,7 +146,7 @@ void DeviceCommThread::reset()
{
TQApplication::postEvent(link(), new DeviceCommEvent(EventLogMessage,
i18n("Could not open device: %1 (will retry)")
- .arg(link()->pilotPath() )));
+ .tqarg(link()->pilotPath() )));
}
link()->fMessages->reset();
@@ -155,7 +155,7 @@ void DeviceCommThread::reset()
// Timer already deleted by close() call.
startOpenTimer(this,fOpenTimer);
- link()->fLinkStatus = WaitingForDevice;
+ link()->fLinktqStatus = WaitingForDevice;
}
/**
@@ -176,16 +176,16 @@ void DeviceCommThread::openDevice()
// This transition (from Waiting to Found) can only be
// taken once.
//
- if (link()->fLinkStatus == WaitingForDevice)
+ if (link()->fLinktqStatus == WaitingForDevice)
{
- link()->fLinkStatus = FoundDevice;
+ link()->fLinktqStatus = FoundDevice;
}
if (link()->fMessages->shouldPrint(Messages::OpenMessage))
{
TQApplication::postEvent(link(), new DeviceCommEvent(EventLogMessage,
i18n("Trying to open device %1...")
- .arg(link()->fPilotPath)));
+ .tqarg(link()->fPilotPath)));
}
// if we're not supposed to be done, try to open the main pilot
@@ -244,7 +244,7 @@ bool DeviceCommThread::open(const TQString &device)
<< link()->fRealPilotPath << "] already connected." << endl;
WARNINGKPILOT << msg << endl;
- link()->fLinkStatus = PilotLinkError;
+ link()->fLinktqStatus = PilotLinkError;
TQApplication::postEvent(link(), new DeviceCommEvent(EventLogError, msg));
@@ -259,11 +259,11 @@ bool DeviceCommThread::open(const TQString &device)
{
e = errno;
msg = i18n("Cannot create socket for communicating "
- "with the Pilot (%1)").arg(errorMessage(e));
+ "with the Pilot (%1)").tqarg(errorMessage(e));
DEBUGKPILOT << msg << endl;
DEBUGKPILOT << "(" << strerror(e) << ")" << endl;
- link()->fLinkStatus = PilotLinkError;
+ link()->fLinktqStatus = PilotLinkError;
TQApplication::postEvent(link(), new DeviceCommEvent(EventLogError, msg));
@@ -272,7 +272,7 @@ bool DeviceCommThread::open(const TQString &device)
DEBUGKPILOT << fname << ": Got socket: [" << fTempSocket << "]" << endl;
- link()->fLinkStatus = CreatedSocket;
+ link()->fLinktqStatus = CreatedSocket;
DEBUGKPILOT << fname << ": Binding to path: ["
<< link()->fRealPilotPath << "]" << endl;
@@ -286,12 +286,12 @@ bool DeviceCommThread::open(const TQString &device)
<< strerror(errno) << "]" << endl;
e = errno;
- msg = i18n("Cannot open Pilot port \"%1\". ").arg(link()->fRealPilotPath);
+ msg = i18n("Cannot open Pilot port \"%1\". ").tqarg(link()->fRealPilotPath);
DEBUGKPILOT << msg << endl;
DEBUGKPILOT << "(" << strerror(e) << ")" << endl;
- link()->fLinkStatus = PilotLinkError;
+ link()->fLinktqStatus = PilotLinkError;
if (link()->fMessages->shouldPrint(Messages::OpenFailMessage))
{
@@ -301,7 +301,7 @@ bool DeviceCommThread::open(const TQString &device)
return false;
}
- link()->fLinkStatus = DeviceOpen;
+ link()->fLinktqStatus = DeviceOpen;
DeviceMap::self()->bindDevice(link()->fRealPilotPath);
fSocketNotifier = new TQSocketNotifier(fTempSocket,
@@ -394,7 +394,7 @@ void DeviceCommThread::acceptDevice()
return;
}
- TQApplication::postEvent(link(), new DeviceCommEvent(EventLogProgress, TQString::null, 10));
+ TQApplication::postEvent(link(), new DeviceCommEvent(EventLogProgress, TQString(), 10));
DEBUGKPILOT << fname <<
": Listening to pilot. Now trying accept..." << endl;
@@ -409,28 +409,28 @@ void DeviceCommThread::acceptDevice()
WARNINGKPILOT << "pi_accept returned: [" << s << "]" << endl;
TQApplication::postEvent(link(), new DeviceCommEvent(EventLogError, i18n("Cannot accept Pilot (%1)")
- .arg(TQString::fromLocal8Bit(s))));
+ .tqarg(TQString::fromLocal8Bit(s))));
- link()->fLinkStatus = PilotLinkError;
+ link()->fLinktqStatus = PilotLinkError;
reset();
return;
}
DEBUGKPILOT << fname << ": Link accept done." << endl;
- if ((link()->fLinkStatus != DeviceOpen) || (fPilotSocket == -1))
+ if ((link()->fLinktqStatus != DeviceOpen) || (fPilotSocket == -1))
{
- link()->fLinkStatus = PilotLinkError;
+ link()->fLinktqStatus = PilotLinkError;
WARNINGKPILOT << "Already connected or unable to connect!" << endl;
TQApplication::postEvent(link(), new DeviceCommEvent(EventLogError, i18n("Cannot accept Pilot (%1)")
- .arg(i18n("already connected"))));
+ .tqarg(i18n("already connected"))));
reset();
return;
}
- TQApplication::postEvent(link(), new DeviceCommEvent(EventLogProgress, TQString::null, 30));
+ TQApplication::postEvent(link(), new DeviceCommEvent(EventLogProgress, TQString(), 30));
DEBUGKPILOT << fname << ": doing dlp_ReadSysInfo..." << endl;
@@ -440,7 +440,7 @@ void DeviceCommThread::acceptDevice()
TQApplication::postEvent(link(), new DeviceCommEvent(EventLogError,
i18n("Unable to read system information from Pilot")));
- link()->fLinkStatus=PilotLinkError;
+ link()->fLinktqStatus=PilotLinkError;
reset();
return;
}
@@ -461,7 +461,7 @@ void DeviceCommThread::acceptDevice()
fWorkaroundUSBTimer->stop();
KPILOT_DELETE(fWorkaroundUSBTimer);
- TQApplication::postEvent(link(), new DeviceCommEvent(EventLogProgress, TQString::null, 60));
+ TQApplication::postEvent(link(), new DeviceCommEvent(EventLogProgress, TQString(), 60));
KPILOT_DELETE(link()->fPilotUser);
link()->fPilotUser = new KPilotUser;
@@ -488,9 +488,9 @@ void DeviceCommThread::acceptDevice()
"Perhaps you have a password set on the device?")));
}
- link()->fLinkStatus = AcceptedDevice;
+ link()->fLinktqStatus = AcceptedDevice;
- TQApplication::postEvent(link(), new DeviceCommEvent(EventLogProgress, TQString::null, 100));
+ TQApplication::postEvent(link(), new DeviceCommEvent(EventLogProgress, TQString(), 100));
DeviceCommEvent * ev = new DeviceCommEvent(EventDeviceReady);
ev->setCurrentSocket(fPilotSocket);
@@ -527,9 +527,9 @@ void DeviceCommThread::run()
DEBUGKPILOT << fname << ": comm thread now done..." << endl;
}
-KPilotDeviceLink::KPilotDeviceLink(TQObject * parent, const char *name,
+KPilotDeviceLink::KPilotDeviceLink(TQObject * tqparent, const char *name,
const TQString &tempDevice) :
- KPilotLink(parent, name), fLinkStatus(Init), fWorkaroundUSB(false),
+ KPilotLink(tqparent, name), fLinktqStatus(Init), fWorkaroundUSB(false),
fPilotSocket(-1), fTempDevice(tempDevice), fMessages(new Messages(this)), fDeviceCommThread(0L)
{
FUNCTIONSETUP;
@@ -550,7 +550,7 @@ KPilotDeviceLink::~KPilotDeviceLink()
/* virtual */bool KPilotDeviceLink::isConnected() const
{
- return fLinkStatus == AcceptedDevice;
+ return fLinktqStatus == AcceptedDevice;
}
/* virtual */bool KPilotDeviceLink::event(TQEvent *e)
@@ -640,12 +640,12 @@ void KPilotDeviceLink::reset(const TQString & dP)
{
FUNCTIONSETUP;
- fLinkStatus = Init;
+ fLinktqStatus = Init;
// Release all resources
//
close();
- fPilotPath = TQString::null;
+ fPilotPath = TQString();
fPilotPath = dP;
if (fPilotPath.isEmpty())
@@ -670,7 +670,7 @@ void KPilotDeviceLink::startCommThread()
TQString msg = i18n("The Pilot device is not configured yet.");
WARNINGKPILOT << msg << endl;
- fLinkStatus = PilotLinkError;
+ fLinktqStatus = PilotLinkError;
emit logError(msg);
return;
@@ -689,7 +689,7 @@ void KPilotDeviceLink::reset()
checkDevice();
- fLinkStatus = WaitingForDevice;
+ fLinktqStatus = WaitingForDevice;
startCommThread();
}
@@ -707,7 +707,7 @@ void KPilotDeviceLink::checkDevice()
if (!(fi.isReadable() && fi.isWritable()))
{
emit logError(i18n("Pilot device %1 is not read-write.")
- .arg(fPilotPath));
+ .tqarg(fPilotPath));
}
}
else
@@ -718,7 +718,7 @@ void KPilotDeviceLink::checkDevice()
emit
logError(i18n("Pilot device %1 does not exist. "
"Probably it is a USB device and will appear during a HotSync.")
- .arg(fPilotPath));
+ .tqarg(fPilotPath));
// Suppress all normal and error messages about opening the device.
fMessages->block(Messages::OpenMessage | Messages::OpenFailMessage,
true);
@@ -788,7 +788,7 @@ int KPilotDeviceLink::openConduit()
return dlp_OpenConduit(fPilotSocket);
}
-TQString KPilotDeviceLink::statusString(LinkStatus l)
+TQString KPilotDeviceLink::statusString(LinktqStatus l)
{
TQString s= CSL1("KPilotDeviceLink=");