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:
Roland Winklmeier
2013-11-27 23:17:42 +01:00
committed by Mathew Sutcliffe
parent 7410d6aeb2
commit f24d16019f
5 changed files with 41 additions and 24 deletions

View File

@@ -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