diff options
author | Timothy Pearson <[email protected]> | 2014-05-10 03:00:25 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2014-05-10 03:00:25 -0500 |
commit | d30bca0277c12282128cc0dba4a14fb96f824eba (patch) | |
tree | 8ab6b73b1300463681a7f21f4caaa387cf78d7bb /src/qt_qt_wrapper.cpp | |
parent | 0dc3b7ae4120b8a7ef052dfa8118672c9434b0dc (diff) | |
download | gtk-qt-engine-d30bca0277c12282128cc0dba4a14fb96f824eba.tar.gz gtk-qt-engine-d30bca0277c12282128cc0dba4a14fb96f824eba.zip |
Provide a more descriptive program name to any inquiring processes
Diffstat (limited to 'src/qt_qt_wrapper.cpp')
-rw-r--r-- | src/qt_qt_wrapper.cpp | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/qt_qt_wrapper.cpp b/src/qt_qt_wrapper.cpp index c2b674f..f9c9fe0 100644 --- a/src/qt_qt_wrapper.cpp +++ b/src/qt_qt_wrapper.cpp @@ -174,17 +174,6 @@ static int dummy_xio_errhandler( Display * ) void createTQApp() { - // Supply it with fake data to keep TDEApplication happy - argv_fake = (char**) malloc(sizeof(char*)); - argv_fake[0] = (char*) malloc(sizeof(char) * 19); - strncpy(argv_fake[0], "gtk-qt-application", 19); - - aboutData.addAuthor("Timothy Pearson", I18N_NOOP("Maintainer"), "[email protected]", 0); - aboutData.addAuthor("David Sansome", I18N_NOOP("Original Author"), "[email protected]", 0); - TDECmdLineArgs::init(argc_fake, argv_fake, &aboutData); - - TDEApplication::disableAutoDcopRegistration(); - TQString cmdLine; #ifdef USE_FREEBSD @@ -344,6 +333,27 @@ void createTQApp() #endif // USE_FREEBSD #endif // USE_SOLARIS + TQString cmdlineAppName = "unknown-gtk-tqt-application"; + TQStringList cmdlineArgs = TQStringList::split(" ", cmdLine, false); + if (cmdlineArgs.count() > 0) { + cmdlineAppName = cmdlineArgs[0]; + cmdlineAppName.append("-gtk-tqt-application"); + } + int cmdlineAppNameLength = cmdlineAppName.length() + 1; + + // Create a new TDEApplication and supply it with fake data to keep its constructor happy + argv_fake = (char**) malloc(sizeof(char*)); + argv_fake[0] = (char*) malloc(sizeof(char) * cmdlineAppNameLength); + strncpy(argv_fake[0], cmdlineAppName.ascii(), cmdlineAppNameLength); + aboutData.setAppName(cmdlineAppName.ascii()); + + aboutData.addAuthor("Timothy Pearson", I18N_NOOP("Maintainer"), "[email protected]", 0); + aboutData.addAuthor("David Sansome", I18N_NOOP("Original Author"), "[email protected]", 0); + TDECmdLineArgs::init(argc_fake, argv_fake, &aboutData); + + TDEApplication::disableAutoDcopRegistration(); + + // Process hacks mozillaFix = (cmdLine.contains("mozilla") || cmdLine.contains("firefox") || cmdLine.contains("iceweasel") || cmdLine.contains("thunderbird") || cmdLine.contains("icedove")); openOfficeFix = (cmdLine.endsWith("soffice.bin")) |