From d30bca0277c12282128cc0dba4a14fb96f824eba Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 10 May 2014 03:00:25 -0500 Subject: Provide a more descriptive program name to any inquiring processes --- src/qt_qt_wrapper.cpp | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'src/qt_qt_wrapper.cpp') 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"), "kb9vqf@pearsoncomputing.net", 0); - aboutData.addAuthor("David Sansome", I18N_NOOP("Original Author"), "me@davidsansome.com", 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"), "kb9vqf@pearsoncomputing.net", 0); + aboutData.addAuthor("David Sansome", I18N_NOOP("Original Author"), "me@davidsansome.com", 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")) -- cgit v1.2.1