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

How to incorporate usb devices in an application

Tags: None
(comma "," separated)
debfreak
Registered Member
Posts
7
Karma
0
OS
I want to show usb devices in my self witten kde programm and than do some action with this device like format, uname.... Is there a function to do that ? Should I use KAction ?

Another question: Is there a overview of all standard Icons which I can use with KIcon e.g a picture + name where I can search the suitable one für my need? An Link would help ;)

Thanks for help and be patient I'm an newbie in KDE programming ;)
User avatar
google01103
Manager
Posts
6668
Karma
25
does the command lsusb suffice?


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
KAction doesn't really seem related. Did you look at Solid?


I'm working on the KDevelop IDE.
debfreak
Registered Member
Posts
7
Karma
0
OS
I had a look at Solid but when I try the example at http://techbase.kde.org/Development/Tut ... _Discovery I get always errors like this : .../main.cpp:47: undefined reference to `Solid::DeviceNotifier::instance()' and the links to the example code are also broken...

Is there somewere an example/tutorial how to use Solid to show/interact USB devices ?
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Sounds like you don't link to the solid libs, do you?


I'm working on the KDevelop IDE.
debfreak
Registered Member
Posts
7
Karma
0
OS
This is my CmakeList but which solid lib should I link ?
Code: Select all
project(test)


find_package(KDE4 REQUIRED)
include_directories( ${KDE4_INCLUDES} )
 
set(test_SRCS
   main.cpp
   mainwindow.cpp

)
 
kde4_add_executable(test${test_SRCS})
target_link_libraries(test ${KDE4_KDEUI_LIBS})

install(TARGETS test DESTINATION ${BIN_INSTALL_DIR})
install( FILES testui.rc
         DESTINATION  ${DATA_INSTALL_DIR}/test )
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
In KF5 it's KF5::Solid, for 4 I don't know right now, sorry -- maybe someone else knows or if not, google will tell you ;)


I'm working on the KDevelop IDE.
debfreak
Registered Member
Posts
7
Karma
0
OS
Yea now the example works for me ;D . I have to link the ${KDE4_SOLID_LIBS} but I don't find this in the documentation...google helps :P
Code: Select all
target_link_libraries(test ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS})


I will continue...thanks for your help


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]