mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-09 19:32:03 +02:00
consistency in if/else statements and MACROS
This commit is contained in:
parent
74233bf459
commit
59a4afef3c
16
main.cpp
16
main.cpp
@ -248,7 +248,8 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
|
||||
if (!moneroAccountsRootDir.empty()) {
|
||||
if (!moneroAccountsRootDir.empty())
|
||||
{
|
||||
QString moneroAccountsDir = moneroAccountsRootDir.at(0) + "/Monero/wallets";
|
||||
engine.rootContext()->setContextProperty("moneroAccountsDir", moneroAccountsDir);
|
||||
}
|
||||
@ -256,12 +257,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Get default account name
|
||||
QString accountName = qgetenv("USER"); // mac/linux
|
||||
if (accountName.isEmpty()){
|
||||
if (accountName.isEmpty())
|
||||
accountName = qgetenv("USERNAME"); // Windows
|
||||
}
|
||||
if (accountName.isEmpty()) {
|
||||
if (accountName.isEmpty())
|
||||
accountName = "My monero Account";
|
||||
}
|
||||
|
||||
engine.rootContext()->setContextProperty("defaultAccountName", accountName);
|
||||
engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath());
|
||||
@ -288,14 +287,15 @@ int main(int argc, char *argv[])
|
||||
|
||||
#ifdef WITH_SCANNER
|
||||
QObject *qmlCamera = rootObject->findChild<QObject*>("qrCameraQML");
|
||||
if( qmlCamera ){
|
||||
if (qmlCamera)
|
||||
{
|
||||
qDebug() << "QrCodeScanner : object found";
|
||||
QCamera *camera_ = qvariant_cast<QCamera*>(qmlCamera->property("mediaObject"));
|
||||
QObject *qmlFinder = rootObject->findChild<QObject*>("QrFinder");
|
||||
qobject_cast<QrCodeScanner*>(qmlFinder)->setSource(camera_);
|
||||
} else {
|
||||
qDebug() << "QrCodeScanner : something went wrong !";
|
||||
}
|
||||
else
|
||||
qDebug() << "QrCodeScanner : something went wrong !";
|
||||
#endif
|
||||
|
||||
QObject::connect(eventFilter, SIGNAL(sequencePressed(QVariant,QVariant)), rootObject, SLOT(sequencePressed(QVariant,QVariant)));
|
||||
|
Loading…
Reference in New Issue
Block a user