Paste P309

Masterwork From Distant Lands
ActivePublic

Authored by sitter on Fri, Feb 8, 2:17 PM.
diff --git a/src/kcrash.cpp b/src/kcrash.cpp
index 0a37c55..c2dbd0d 100644
--- a/src/kcrash.cpp
+++ b/src/kcrash.cpp
@@ -220,6 +220,14 @@ void KCrash::setApplicationFilePath(const QString &filePath)
QStringList args = QCoreApplication::arguments();
if (!args.isEmpty()) { // edge case: tst_QX11Info::startupId does QApplication app(argc, nullptr)...
+ if (loadedByKdeinit) {
+ // When a KIO slave is loaded by kdeinit, drkonqi expects the
+ // appname to not actually be the exectuable but rather the name of
+ // the kdeinit'd exectuable. The easiest way to retrieve that is
+ // through argv.
+ s_appName = qstrdup(QFile::encodeName(QFileInfo(args[0]).completeBaseName()).constData()) ;
+ }
+
args[0] = filePath; // replace argv[0] with full path above
delete[] s_autoRestartCommandLine;
s_autoRestartArgc = args.count();
sitter edited the content of this paste. (Show Details)Fri, Feb 8, 2:17 PM
sitter changed the title of this paste from untitled to Masterwork From Distant Lands.