Commit 7a391b7b authored by Patrick José Pereira's avatar Patrick José Pereira

Remove unneeded memory allocations due temporary QStrings

Signed-off-by: 's avatarPatrick José Pereira <patrickelectric@gmail.com>
parent 38a2246e
...@@ -187,13 +187,13 @@ QGCMapEngine::_wipeOldCaches() ...@@ -187,13 +187,13 @@ QGCMapEngine::_wipeOldCaches()
#ifdef __mobile__ #ifdef __mobile__
oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1String("/QGCMapCache55"); oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1String("/QGCMapCache55");
#else #else
oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1String("/QGCMapCache55"); oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/QGCMapCache55");
#endif #endif
_checkWipeDirectory(oldCacheDir); _checkWipeDirectory(oldCacheDir);
#ifdef __mobile__ #ifdef __mobile__
oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1String("/QGCMapCache100"); oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1String("/QGCMapCache100");
#else #else
oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1String("/QGCMapCache100"); oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/QGCMapCache100");
#endif #endif
_checkWipeDirectory(oldCacheDir); _checkWipeDirectory(oldCacheDir);
} }
...@@ -208,11 +208,11 @@ QGCMapEngine::init() ...@@ -208,11 +208,11 @@ QGCMapEngine::init()
#ifdef __mobile__ #ifdef __mobile__
QString cacheDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1String("/QGCMapCache" CACHE_PATH_VERSION); QString cacheDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1String("/QGCMapCache" CACHE_PATH_VERSION);
#else #else
QString cacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1String("/QGCMapCache" CACHE_PATH_VERSION); QString cacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/QGCMapCache" CACHE_PATH_VERSION);
#endif #endif
if(!QDir::root().mkpath(cacheDir)) { if(!QDir::root().mkpath(cacheDir)) {
qWarning() << "Could not create mapping disk cache directory: " << cacheDir; qWarning() << "Could not create mapping disk cache directory: " << cacheDir;
cacheDir = QDir::homePath() + QLatin1String("/.qgcmapscache/"); cacheDir = QDir::homePath() + QStringLiteral("/.qgcmapscache/");
if(!QDir::root().mkpath(cacheDir)) { if(!QDir::root().mkpath(cacheDir)) {
qWarning() << "Could not create mapping disk cache directory: " << cacheDir; qWarning() << "Could not create mapping disk cache directory: " << cacheDir;
cacheDir.clear(); cacheDir.clear();
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#include "time.h" #include "time.h"
const char* kDefaultSet = "Default Tile Set"; const char* kDefaultSet = "Default Tile Set";
const QString kSession = QLatin1String("QGeoTileWorkerSession"); const QString kSession = QStringLiteral("QGeoTileWorkerSession");
const QString kExportSession = QLatin1String("QGeoTileExportSession"); const QString kExportSession = QStringLiteral("QGeoTileExportSession");
QGC_LOGGING_CATEGORY(QGCTileCacheLog, "QGCTileCacheLog") QGC_LOGGING_CATEGORY(QGCTileCacheLog, "QGCTileCacheLog")
......
...@@ -216,7 +216,7 @@ QGeoTiledMappingManagerEngineQGC::_setCache(const QVariantMap &parameters) ...@@ -216,7 +216,7 @@ QGeoTiledMappingManagerEngineQGC::_setCache(const QVariantMap &parameters)
if(!QFileInfo(cacheDir).exists()) { if(!QFileInfo(cacheDir).exists()) {
if(!QDir::root().mkpath(cacheDir)) { if(!QDir::root().mkpath(cacheDir)) {
qWarning() << "Could not create mapping disk cache directory: " << cacheDir; qWarning() << "Could not create mapping disk cache directory: " << cacheDir;
cacheDir = QDir::homePath() + QLatin1String("/.qgcmapscache/"); cacheDir = QDir::homePath() + QStringLiteral("/.qgcmapscache/");
} }
} }
} }
......
...@@ -159,7 +159,7 @@ void initializeVideoStreaming(int &argc, char* argv[], char* logpath, char* debu ...@@ -159,7 +159,7 @@ void initializeVideoStreaming(int &argc, char* argv[], char* logpath, char* debu
Q_UNUSED(debuglevel); Q_UNUSED(debuglevel);
#endif #endif
qmlRegisterType<VideoItem> ("QGroundControl.QgcQtGStreamer", 1, 0, "VideoItem"); qmlRegisterType<VideoItem> ("QGroundControl.QgcQtGStreamer", 1, 0, "VideoItem");
qmlRegisterUncreatableType<VideoSurface>("QGroundControl.QgcQtGStreamer", 1, 0, "VideoSurface", QLatin1String("VideoSurface from QML is not supported")); qmlRegisterUncreatableType<VideoSurface>("QGroundControl.QgcQtGStreamer", 1, 0, "VideoSurface", QStringLiteral("VideoSurface from QML is not supported"));
} }
void shutdownVideoStreaming() void shutdownVideoStreaming()
......
...@@ -60,7 +60,7 @@ OpenGLSurfacePainter::OpenGLSurfacePainter() ...@@ -60,7 +60,7 @@ OpenGLSurfacePainter::OpenGLSurfacePainter()
, m_videoColorMatrix(GST_VIDEO_COLOR_MATRIX_UNKNOWN) , m_videoColorMatrix(GST_VIDEO_COLOR_MATRIX_UNKNOWN)
{ {
#ifndef QT_OPENGL_ES #ifndef QT_OPENGL_ES
glActiveTexture = (_glActiveTexture) QGLContext::currentContext()->getProcAddress(QLatin1String("glActiveTexture")); glActiveTexture = (_glActiveTexture) QGLContext::currentContext()->getProcAddress(QStringLiteral("glActiveTexture"));
#endif #endif
} }
...@@ -397,11 +397,11 @@ ArbFpSurfacePainter::ArbFpSurfacePainter() ...@@ -397,11 +397,11 @@ ArbFpSurfacePainter::ArbFpSurfacePainter()
, m_programId(0) , m_programId(0)
{ {
const QGLContext *context = QGLContext::currentContext(); const QGLContext *context = QGLContext::currentContext();
glProgramStringARB = (_glProgramStringARB) context->getProcAddress(QLatin1String("glProgramStringARB")); glProgramStringARB = (_glProgramStringARB) context->getProcAddress(QStringLiteral("glProgramStringARB"));
glBindProgramARB = (_glBindProgramARB) context->getProcAddress(QLatin1String("glBindProgramARB")); glBindProgramARB = (_glBindProgramARB) context->getProcAddress(QStringLiteral("glBindProgramARB"));
glDeleteProgramsARB = (_glDeleteProgramsARB) context->getProcAddress(QLatin1String("glDeleteProgramsARB")); glDeleteProgramsARB = (_glDeleteProgramsARB) context->getProcAddress(QStringLiteral("glDeleteProgramsARB"));
glGenProgramsARB = (_glGenProgramsARB) context->getProcAddress(QLatin1String("glGenProgramsARB")); glGenProgramsARB = (_glGenProgramsARB) context->getProcAddress(QStringLiteral("glGenProgramsARB"));
glProgramLocalParameter4fARB = (_glProgramLocalParameter4fARB) context->getProcAddress(QLatin1String("glProgramLocalParameter4fARB")); glProgramLocalParameter4fARB = (_glProgramLocalParameter4fARB) context->getProcAddress(QStringLiteral("glProgramLocalParameter4fARB"));
} }
void ArbFpSurfacePainter::init(const BufferFormat &format) void ArbFpSurfacePainter::init(const BufferFormat &format)
......
...@@ -152,7 +152,7 @@ MainWindow::MainWindow() ...@@ -152,7 +152,7 @@ MainWindow::MainWindow()
// Image provider // Image provider
QQuickImageProvider* pImgProvider = dynamic_cast<QQuickImageProvider*>(qgcApp()->toolbox()->imageProvider()); QQuickImageProvider* pImgProvider = dynamic_cast<QQuickImageProvider*>(qgcApp()->toolbox()->imageProvider());
_mainQmlWidgetHolder->getEngine()->addImageProvider(QLatin1String("QGCImages"), pImgProvider); _mainQmlWidgetHolder->getEngine()->addImageProvider(QStringLiteral("QGCImages"), pImgProvider);
// Set dock options // Set dock options
setDockOptions(0); setDockOptions(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment