2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

fixed title for first run, fixed linux exec-by-link

This commit is contained in:
John Preston
2014-12-16 09:05:18 -08:00
parent 929d1e2ad9
commit 96e72af509
3 changed files with 10 additions and 2 deletions

View File

@@ -803,6 +803,9 @@ QString psCurrentExeDirectory(int argc, char *argv[]) {
QString first = argc ? QString::fromLocal8Bit(argv[0]) : QString();
if (!first.isEmpty()) {
QFileInfo info(first);
if (info.isSymLink()) {
info = info.symLinkTarget();
}
if (info.exists()) {
return QDir(info.absolutePath()).absolutePath() + '/';
}
@@ -814,7 +817,10 @@ QString psCurrentExeName(int argc, char *argv[]) {
QString first = argc ? QString::fromLocal8Bit(argv[0]) : QString();
if (!first.isEmpty()) {
QFileInfo info(first);
if (info.exists()) {
if (info.isSymLink()) {
info = info.symLinkTarget();
}
if (info.exists()) {
return info.fileName();
}
}