/*
* Copyright (C) 2024 UBports Foundation
*
* This file is part of OnlineAccountsPlugin.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This softwareis distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with OnlineAccountsClient. If not, see
* .
*/
#ifndef __CONFIG_HPP__
#define __CONFIG_HPP__
#include
#include
static QString SNAP_ENV = qgetenv("SNAP");
static QString APP_DIR = qgetenv("APP_DIR");
inline QString i18nDirectory (void)
{
if (!SNAP_ENV.isEmpty()) {
return SNAP_ENV + QStringLiteral("@CMAKE_INSTALL_FULL_LOCALEDIR@");
} else if (!APP_DIR.isEmpty()) {
return APP_DIR + QStringLiteral("@CMAKE_INSTALL_FULL_LOCALEDIR@");
} else {
return QStringLiteral("@CMAKE_INSTALL_FULL_LOCALEDIR@");
}
}
#endif // __CONFIG_HPP__