mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
Minor fixes for linux build
refs #36 - Fixed compiler error in context.cpp (is not used anymore, but was still annoying) - GCC was complaining about the template definitons in blackgui. Removing typename fixed it. - Fixed a bug in qmake. Unfortunately qmake mkspec was just linux-g++ (not linux-g++-64), so added this case. - Fixed a PRE_TARGETDEPS bug - QMake has strange behaviour with DBUS_ADAPTORS: include the header somewhere, otherwise it won't be generated. refs #81
This commit is contained in:
committed by
Mathew Sutcliffe
parent
7410d6aeb2
commit
f24d16019f
@@ -6,6 +6,9 @@
|
||||
#include "blackmisc/debug.h"
|
||||
#include "blackmisc/context.h"
|
||||
#include <QFileInfo>
|
||||
#include <QCoreApplication>
|
||||
#include <stdexcept>
|
||||
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <Windows.h>
|
||||
@@ -57,23 +60,9 @@ namespace BlackMisc
|
||||
|
||||
void CApplicationContext::setDefaultApplicationName()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
//! By default, we use the executables name.
|
||||
if (getApplicationName().isEmpty())
|
||||
{
|
||||
WCHAR name[1024];
|
||||
int size = GetModuleFileName(NULL, name, 1023);
|
||||
QString applicationPath = QString::fromWCharArray(name, size);
|
||||
setApplicationName(QFileInfo(applicationPath).fileName());
|
||||
}
|
||||
#else
|
||||
//! Todo: Check if there a corresponding API in Linux and Mac
|
||||
//! For the time being, set it to unknown.
|
||||
if (m_context.getApplicationName().isEmpty())
|
||||
{
|
||||
m_context.setApplicationName("<Unknown>");
|
||||
}
|
||||
#endif
|
||||
// This part was not working before on linux.
|
||||
// This class is depricated, but as long as it is not removed, if fixed it anyway.
|
||||
setApplicationName(QFileInfo(QCoreApplication::applicationFilePath()).fileName());
|
||||
}
|
||||
|
||||
} // namespace BlackMisc
|
||||
|
||||
Reference in New Issue
Block a user