This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Is it possible to convert const char* to KAuth::Action type?

Tags: None
(comma "," separated)
IntriguingWorld
Registered Member
Posts
2
Karma
0
I was following the tutorial here: http://techbase.kde.org/Development/Tut ... th_Actions

But the very first line of code:
Code: Select all
KAuth::Action readAction = "org.kde.auth.example.read";


is giving me an error. The error is:
Code: Select all
conversion from 'const char [26]' to non-scalar type 'KAuth::Action' requested


I've been hours on this and can't find anything to make it work. :'( That's the first line of the code, it can't be possible for it to be wrong (but it is). Does anyone know how to make the conversion or do you think there is something else wrong?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
It seems the example is wrong unfortunately.
Both of the following should work though:
Code: Select all
KAuth::Action *action = new KAuth::Action("org.kde.auth.example.read");
KAuth::Action action("org.kde.auth.example.read");


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
IntriguingWorld
Registered Member
Posts
2
Karma
0
bcooksley wrote:It seems the example is wrong unfortunately.
Both of the following should work though:
Code: Select all
KAuth::Action *action = new KAuth::Action("org.kde.auth.example.read");
KAuth::Action action("org.kde.auth.example.read");

Don't worry I figured it out. Thanks.

Now I am having another problem that maybe here someone has experienced. To make KAuth work I have to link against kdecore library. I've already linked against it in the CMake file with:
Code: Select all
target_link_libraries(QSimulate kdecore ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}  ${KDE4_KDECORE_LIBS} ${KDE4_AUTH_BACKEND_NAME})


but then I get undefined reference to all of the QT components in my code. If I eliminate "kdecore" then I get undefined reference only to KAuth::Action. And if I eliminate all the KAuth code then it compiles fine all the QT components.

Have this happened to anyone before? Could this mean KAuth cannot work along QT Applications?


Fixed it, I had something wrong on the "install" arguments of cmake.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Good to see you got it sorted - marked as solved.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient