global locale and language variables

useful for locale depending things, like setting up kimpanel
wilder-5.14
Marco Martin 11 years ago
parent b9cc9106db
commit 3ecffbfcb0
  1. 10
      shell/scripting/appinterface.cpp
  2. 5
      shell/scripting/appinterface.h

@ -120,6 +120,16 @@ void AppInterface::setTheme(const QString &name)
m_theme->setThemeName(name);
}
QString AppInterface::locale() const
{
return QLocale::system().name();
}
QString AppInterface::language() const
{
return QLocale::system().languageToString(QLocale::system().language());
}
bool AppInterface::multihead() const
{
#ifdef Q_OS_WIN

@ -53,6 +53,8 @@ class AppInterface : public QObject
Q_PROPERTY(int scriptingVersion READ scriptingVersion)
Q_PROPERTY(bool multihead READ multihead)
Q_PROPERTY(bool multiheadScreen READ multihead)
Q_PROPERTY(QString locale READ locale)
Q_PROPERTY(QString language READ language)
public:
AppInterface(ScriptEngine *env);
@ -74,6 +76,9 @@ public:
QString theme() const;
void setTheme(const QString &name);
QString locale() const;
QString language() const;
bool multihead() const;
int multiheadScreen() const;

Loading…
Cancel
Save