aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/trk/trkutils.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <[email protected]>2009-10-21 16:48:46 +0200
committerFriedemann Kleint <[email protected]>2009-10-21 16:48:46 +0200
commit20edb02093f9f30e3a94c25bd237532c02eb08e2 (patch)
tree97024f090a634f8b3e68b275089d52d404b3457a /src/shared/trk/trkutils.cpp
parent338f945ca183435aef81243daf14e27d26328220 (diff)
S60: Use a DetailsWidget for the run configuration widgets, add info
- Move the s60devicerunconfigurationwidget into a separate file, add an info button that connects to the device and displays CPU/Trk version for testing the connection. - give TrkLauncher a parent object and an acessor for the device description in formatted form. - Break deadlock when trying to terminate the Windows Trk writer thread with bytes pending by using a wait with timeout and termination flag.
Diffstat (limited to 'src/shared/trk/trkutils.cpp')
-rw-r--r--src/shared/trk/trkutils.cpp69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/shared/trk/trkutils.cpp b/src/shared/trk/trkutils.cpp
index 463415e7c21..93df3937994 100644
--- a/src/shared/trk/trkutils.cpp
+++ b/src/shared/trk/trkutils.cpp
@@ -36,6 +36,75 @@
namespace trk {
+TrkAppVersion::TrkAppVersion()
+{
+ reset();
+}
+
+void TrkAppVersion::reset()
+{
+ trkMajor = trkMinor= protocolMajor = protocolMinor = 0;
+}
+
+Session::Session()
+{
+ reset();
+}
+
+void Session::reset()
+{
+ cpuMajor = 0;
+ cpuMinor = 0;
+ bigEndian = 0;
+ defaultTypeSize = 0;
+ fpTypeSize = 0;
+ extended1TypeSize = 0;
+ extended2TypeSize = 0;
+ pid = 0;
+ tid = 0;
+ codeseg = 0;
+ dataseg = 0;
+
+ currentThread = 0;
+ libraries.clear();
+ trkAppVersion.reset();
+}
+
+inline void formatCpu(QTextStream &str,int major, int minor)
+{
+ str << "CPU: v" << major << '.' << minor;
+ switch (major) {
+ case 0x04:
+ str << " ARM";
+ break;
+ }
+ switch (minor) {
+ case 0x00:
+ str << " 920T";
+ break;
+ }
+ }
+
+QString Session::deviceDescription(unsigned verbose) const
+{
+ QString msg;
+ if (cpuMajor) {
+ QTextStream str(&msg);
+ formatCpu(str, cpuMajor, cpuMinor);
+ str << ", " << (bigEndian ? "big endian" : "little endian");
+ if (verbose) {
+ if (defaultTypeSize)
+ str << ", type size: " << defaultTypeSize;
+ if (fpTypeSize)
+ str << ", float size: " << fpTypeSize;
+ }
+ str << ", Trk: v" << trkAppVersion.trkMajor << '.' << trkAppVersion.trkMinor
+ << " Protocol: v" << trkAppVersion.protocolMajor << '.' << trkAppVersion.protocolMinor;
+ }
+ return msg;
+}
+
+
// FIXME: Use the QByteArray based version below?
QString stringFromByte(byte c)
{