Set the application name

This commit is contained in:
Andrea Scarpino 2015-06-26 16:59:29 +02:00
parent 00b363c0b0
commit ae3c9fb55d

View file

@ -27,6 +27,8 @@ int main(int argc, char *argv[])
QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv)); QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));
QScopedPointer<QQuickView> view(SailfishApp::createView()); QScopedPointer<QQuickView> view(SailfishApp::createView());
QCoreApplication::setApplicationName(QStringLiteral("Papocchio"));
// Otherwise the Canvas is cleaned when the application is not // Otherwise the Canvas is cleaned when the application is not
// marked as active. See for more: // marked as active. See for more:
// https://lists.sailfishos.org/pipermail/devel/2014-October/005065.html // https://lists.sailfishos.org/pipermail/devel/2014-October/005065.html
@ -49,10 +51,12 @@ int main(int argc, char *argv[])
QString papocchioDir() QString papocchioDir()
{ {
const QDir papocchioDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) const QDir papocchioDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)
+ QDir::separator() + "Papocchio"); + QDir::separator() + QCoreApplication::applicationName());
if (!papocchioDir.exists()) { if (!papocchioDir.exists()) {
papocchioDir.mkpath(papocchioDir.absolutePath()); if (!papocchioDir.mkpath(papocchioDir.absolutePath())) {
qCritical() << "Cannot create dir!";
}
} }
return QString(papocchioDir.absolutePath() + QDir::separator()); return QString(papocchioDir.absolutePath() + QDir::separator());