mirror of
https://github.com/monero-project/monero-gui
synced 2025-01-01 21:56:23 +01:00
generate default account name from env username
This commit is contained in:
parent
a3c6c40832
commit
b795c4b0d7
11
main.cpp
11
main.cpp
@ -120,6 +120,17 @@ int main(int argc, char *argv[])
|
|||||||
engine.rootContext()->setContextProperty("moneroAccountsDir", moneroAccountsDir);
|
engine.rootContext()->setContextProperty("moneroAccountsDir", moneroAccountsDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Get default account name
|
||||||
|
QString accountName = qgetenv("USER"); // mac/linux
|
||||||
|
if (accountName.isEmpty()){
|
||||||
|
accountName = qgetenv("USERNAME"); // Windows
|
||||||
|
}
|
||||||
|
if (accountName.isEmpty()) {
|
||||||
|
accountName = "My monero Account";
|
||||||
|
}
|
||||||
|
|
||||||
|
engine.rootContext()->setContextProperty("defaultAccountName", accountName);
|
||||||
engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath());
|
engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath());
|
||||||
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
|
||||||
QObject *rootObject = engine.rootObjects().first();
|
QObject *rootObject = engine.rootObjects().first();
|
||||||
|
Loading…
Reference in New Issue
Block a user