You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.0 KiB
61 lines
2.0 KiB
app executable
|
|
man pages
|
|
known/found config files (eg kde rc files, /etc/, /usr/local/etc)
|
|
folders in home dir?
|
|
|
|
later:
|
|
if app is running, known network connections?
|
|
files referenced in man pages
|
|
|
|
use desktop files where possible
|
|
create and cache desktop files?
|
|
|
|
for kde apps:
|
|
|
|
apps - Applications menu (.desktop files).
|
|
config - Configuration files.
|
|
data - Where applications store data.
|
|
exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.
|
|
mime - Mime types.
|
|
tmp - Temporary files (specific for both current host and current user)
|
|
socket - UNIX Sockets (specific for both current host and current user)
|
|
|
|
use
|
|
|
|
#include <kservice.h>
|
|
#include <kservicegroup.h>
|
|
|
|
KService::Ptr service = KService::serviceByDesktopName( url.fileName() );
|
|
if (service && service->isValid()) {
|
|
// KURL newUrl;
|
|
// newUrl.setPath(locate("apps", service->desktopEntryPath()));
|
|
// createFileEntry(entry, service->name(), newUrl, "application/x-desktop", service->icon());
|
|
|
|
createFileEntry(entry, service->name(), url.url(1)+service->desktopEntryName(),
|
|
"application/x-desktop", service->icon(), locate("apps", service->desktopEntryPath()) );
|
|
|
|
|
|
|
|
overlay:
|
|
|
|
// Not using KIconEffect::overlay as that requires the same size
|
|
// for the icon and the overlay, also the overlay definately doesn't
|
|
// have a more that one-bit alpha channel here
|
|
QPixmap overlay( locate ( "icon", KMimeType::favIconForURL( m_filterData->uri() ) + ".png" ) );
|
|
if ( !overlay.isNull() )
|
|
{
|
|
int x = icon.width() - overlay.width();
|
|
int y = icon.height() - overlay.height();
|
|
if ( icon.mask() )
|
|
{
|
|
QBitmap mask = *icon.mask();
|
|
bitBlt( &mask, x, y,
|
|
overlay.mask() ? const_cast<QBitmap *>(overlay.mask()) : &overlay,
|
|
0, 0, overlay.width(), overlay.height(),
|
|
overlay.mask() ? OrROP : SetROP );
|
|
icon.setMask(mask);
|
|
}
|
|
bitBlt( &icon, x, y, &overlay );
|
|
}
|
|
|