Help with .cpp file [answered]
After changing the .cpp file to get translation for to my app I can't start from the "app-list". However I can start it from the terminal. When starting the app from the "app-list" the busy indication starts and after a while it disappears.
This is my .cpp file
//#ifdef QT_QML_DEBUG
#include <QtQuick>
//#endif
#include <sailfishapp.h>
#include <QTranslator>
#include <QTextCodec>
#include <QLocale>
#include <QtQml/QQmlEngine>
#include <QScopedPointer>
#include <QQuickView>
#include <QtGui/QGuiApplication>
#include <qqml.h>
int main(int argc, char *argv[])
{
// SailfishApp::main() will display "qml/template.qml", if you need more
// control over initialization, you can use:
//
// - SailfishApp::application(int, char *[]) to get the QGuiApplication *
// - SailfishApp::createView() to get a new QQuickView * instance
// - SailfishApp::pathTo(QString) to get a QUrl to a resource file
//
// To display the view, call "show()" (will show fullscreen on device).
QGuiApplication *app = (SailfishApp::application(argc, argv));
//Translations
QString translationPath(SailfishApp::pathTo("translations").toLocalFile());
qDebug() << "Translation Path:" << translationPath;
static QTranslator translator;
if(translator.load(QLocale(), "SLSailor", "_", translationPath)) {
app->installTranslator(&translator);
qDebug() << "Translation file loaded";
} else
qDebug() << "Translation file not loaded";
QScopedPointer <QQuickView> view(SailfishApp::createView());
app->setApplicationName("SLSailor");
app->setOrganizationDomain("SLSailor");
app->setOrganizationName("SLSailor");
view->setTitle("SLSailor");
QUrl pageSource = SailfishApp::pathTo("qml/SLSailor.qml");
view->setSource(pageSource);
view->showFullScreen();
return app->exec();
}
What is an app-list, and does your code work in Emulator wirh SailfishOS SDK?
foss4ever ( 2015-02-25 08:45:15 +0200 )edit