Version: (using KDE KDE 3.4.0) Installed from: Gentoo Packages Compiler: gcc version 3.4.3 20050110 (Gentoo Linux 3.4.3.20050110, ssp-3.4.3.20050110-0, pie-8.7.7) OS: Linux For some reason kandy is munging the first four characters of the serial device name when attempting to open for reading: Error Message (Dialog box): Unable to open device '@ " /ttyUSB0'. Please check that you have sufficient permissions. Strace: close(10) = 0 open("@^B\/ttyUSB0", O_RDWR|O_NONBLOCK|O_NOCTTY|O_LARGEFILE) = -1 ENOENT (No su ch file or directory) uname({sys="Linux", node="xxxxx", ...}) = 0 ioctl(5, FIONREAD, [1]) = 0 ioctl(5, FIONREAD, [1]) = 0 ioctl(5, FIONREAD, [1]) = 0 ioctl(5, FIONREAD, [1]) = 0 ioctl(5, FIONREAD, [1]) = 0 ioctl(5, FIONREAD, [1]) = 0 Config: cat .kde/share/config/kandyrc [General] CurrentProfile=/usr/kde/3.4/share/apps/kandy/default.kandy [MainWindow] Height 1200=631 Width 1600=777 [Serial Port] Baud Rate=57600 Serial Device=/dev/ttyUSB0 StartupModem=true
The same here
I'm also experiencing this problem on Kubuntu's kandy package. Everything seems to work fine on my Fedora Core 2 installation.
Same here (Kubuntu 5.04 package)
See also: http://bugzilla.ubuntu.com/show_bug.cgi?id=13493
I looked into this and now I am confused... :) The bug is still present in the 3.5alpha1 release. The problem seems to be the following code in src/modem.cpp around line 194: const char *fdev = QFile::encodeName( (*prefs).serialDevice() ).data(); fdev contains the garbled string. I inserted the following code: printf("%s\n\n", fdev); printf("%s\n\n", (*prefs).serialDevice().latin1()); printf("%s\n\n", fdev); And this is the output (and kandy works with this): e/ircomm0 /dev/ircomm0 /dev/ircomm0 So... What am I missing here?
Can someone please have a look at the following code (modem.cpp l.194). I think its wrong because QFile::encodeName() returns a QCString and QCString::data() returns a (const char *) Ptr. to the internal C-Array. But the QCString instance is deleted again immediately (isn't it?) thus invalidating the returned ptr. Right? const char *fdev = QFile::encodeName( (*prefs).serialDevice() ).data(); I will create a patch and attach it here. Maybe it is of help for someone.
SVN commit 564537 by kling: Fixed the well-known problem with garbled device paths. Patch has been lying around on bugzilla for over a year. BUG: 39420 BUG: 45640 BUG: 47383 BUG: 96883 BUG: 104596 BUG: 101575 M +2 -1 modem.cpp --- branches/KDE/3.5/kdepim/kandy/src/modem.cpp #564536:564537 @@ -191,7 +191,8 @@ if ( !lockDevice() ) return false; - const char *fdev = QFile::encodeName( (*prefs).serialDevice() ).data(); + QCString dev = QFile::encodeName( (*prefs).serialDevice() ); + const char *fdev = dev.data(); if ( ( fd = ::open( fdev, O_RDWR | O_NOCTTY | O_NONBLOCK ) ) == -1 ) { emit errorMessage( i18n( "Unable to open device '%1'. " "Please check that you have sufficient permissions." )