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

View File

@ -110,7 +110,7 @@ void settingsParseArgs(int argc, char *argv[]) {
memset_rand(&gInstance, sizeof(gInstance)); memset_rand(&gInstance, sizeof(gInstance));
gExeDir = psCurrentExeDirectory(argc, argv); gExeDir = psCurrentExeDirectory(argc, argv);
gExeName = psCurrentExeName(argc, argv); gExeName = psCurrentExeName(argc, argv);
for (int32 i = 0; i < argc; ++i) { for (int32 i = 0; i < argc; ++i) {
if (string("-release") == argv[i]) { if (string("-release") == argv[i]) {
gTestMode = false; gTestMode = false;
} else if (string("-debug") == argv[i]) { } else if (string("-debug") == argv[i]) {

View File

@ -65,6 +65,8 @@ TitleWidget::TitleWidget(Window *window)
{ {
setGeometry(0, 0, wnd->width(), st::titleHeight); setGeometry(0, 0, wnd->width(), st::titleHeight);
_update.hide(); _update.hide();
_cancel.hide();
_back.hide();
if (App::app()->updatingState() == Application::UpdatingReady) { if (App::app()->updatingState() == Application::UpdatingReady) {
showUpdateBtn(); showUpdateBtn();
} }