diff --git kioexec/main.cpp kioexec/main.cpp
index 06cd8f3..699e94f 100644
|
|
|
21 | 21 | |
22 | 22 | #include "main.h" |
23 | 23 | |
| 24 | #ifdef Q_OS_MAC |
| 25 | // kioexec is declared NOGUI in its CMakeLists.txt file, which on OS X means |
| 26 | // it is *not* created as an AppBundle (which we don't want). It can however |
| 27 | // also mean the KApplication instance will be created with GUIenabled=false |
| 28 | // (depending on the patches installed), which is not appropriate for kioexec. |
| 29 | // Undefining KDE_WITHOUT_GUI restores the pre 4.14.1 default behaviour (GUIenabled=true) |
| 30 | // (when included before kapplication.h ...) |
| 31 | #undef KDE_WITHOUT_GUI |
| 32 | #include <CoreFoundation/CoreFoundation.h> |
| 33 | #endif |
| 34 | |
24 | 35 | #include <QtCore/QFile> |
25 | 36 | #include <QtCore/Q_PID> |
26 | 37 | |
… |
… |
void KIOExec::slotRunApp() |
250 | 261 | |
251 | 262 | int main( int argc, char **argv ) |
252 | 263 | { |
| 264 | #ifdef Q_OS_MAC |
| 265 | CFBundleRef mainBundle = CFBundleGetMainBundle(); |
| 266 | if (mainBundle) { |
| 267 | // get the application's Info Dictionary. For app bundles this would live in the bundle's Info.plist, |
| 268 | // for regular executables it is obtained in another way. |
| 269 | CFMutableDictionaryRef infoDict = (CFMutableDictionaryRef) CFBundleGetInfoDictionary(mainBundle); |
| 270 | if (infoDict) { |
| 271 | // Add or set the "LSUIElement" key with/to value "1". This can simply be a CFString. |
| 272 | CFDictionarySetValue(infoDict, CFSTR("LSUIElement"), CFSTR("1")); |
| 273 | // That's it. We're now considered as an "agent" by the window server, and thus will have |
| 274 | // neither menubar nor presence in the Dock or App Switcher. |
| 275 | } |
| 276 | } |
| 277 | #endif |
| 278 | |
253 | 279 | KAboutData aboutData( "kioexec", "kioexec", ki18n("KIOExec"), |
254 | 280 | KDE_VERSION_STRING, ki18n(description), KAboutData::License_GPL, |
255 | 281 | ki18n("(c) 1998-2000,2003 The KFM/Konqueror Developers")); |