Share

KInk, a KDE printer ink level monitor

Tracker: Patches

5 Compile error at line 159 SOLVED! - ID: 1225953
Last Update: Tracker Item Submitted ( gatuus )

I've just compiled Kink 0.2.1 in KDE 3.4.1 in SuSE
linux 9.2,
Great program, but there's an error in "kink.cpp" at
line 159:

The line is written as:

cmbDevices->insertItem(QString::fromAscii((const char
*)model, strlen(model)) + " on " + (type==PARPORT ?
"/dev/lp" : "/dev/usb/lp") + QString::number(port));

An error arraise with the message:

kink.cpp: In member function `void
KInk::add_device_to_list(int, int, unsigned char*)':
kink.cpp:159: error: invalid conversion from `unsigned
char*' to `const char*'

And the problem is that an extra cast is necessary to
make strlen from QString works as this:

strlen((const char *)model)

The correct line would look like this;

cmbDevices->insertItem(QString::fromAscii((const char
*)model, strlen((const char *)model)) + " on " +
(type==PARPORT ? "/dev/lp" : "/dev/usb/lp") +
QString::number(port));

and finally it would compile correctly, thanks =)

gatuus


gatuus ( gatuus ) - 2005-06-23 00:48

5

Open

None

Nobody/Anonymous

None

None

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.