KDE 4 Integration
← Threaded Image Conversion | ● | KDE4 Drop Icon →
With OpenSuse 12.1 the KDE4 desktop is the default desktop manager. For programs to show up in the start menu we need to register them. To do so, we provide basic information in a .desktop file.
To register our image conversion app, we create the file “DropPNG.desktop” in the /usr/share/applications/ folder:
[Desktop Entry] Type=Application Exec=DropPNG %U Icon=utilities-terminal Terminal=false Name=DropPNG Categories=Application;Graphics;
Putting a .desktop file in the ~/.local/share/applications folder registers the app for a single user. Putting it in the /usr/share/autostart folder will start it automatically when a user logs in.
For an automatic installation, we add the above .desktop file to our source directory. Next, we modify the CMakelists.txt file to contain an install target that copies the .desktop file to the appropriate directory. The Qt executable is also copied to the appropriate binary directory:
IF (UNIX AND NOT APPLE) INSTALL(FILES DropPNG.desktop DESTINATION /usr/share/applications) ENDIF (UNIX AND NOT APPLE) INSTALL( TARGETS DropPNG RUNTIME DESTINATION bin )
Now after running “make install”, we can right click at the DropPNG entry in the start menu and add it as a shortcut to the desktop.
← Threaded Image Conversion | ● | KDE4 Drop Icon →