summaryrefslogtreecommitdiffstats
path: root/src/qt_qt_wrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt_qt_wrapper.cpp')
-rw-r--r--src/qt_qt_wrapper.cpp32
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"))