diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-02-08 23:02:10 +0100 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-02-08 23:32:22 +0100 |
commit | 82ee9e4e415c60410980c1adb0bfb74dd1571fc2 (patch) | |
tree | b3d3cfdc00cda51ebda34bd63079da4287e7a5b0 /gui | |
parent | 7af4d63ea872609a9d7c2f9d954a211bded1b5bb (diff) |
[style] formatting
we should try to use qmlfmt, indeed
Diffstat (limited to 'gui')
-rw-r--r-- | gui/qjsonmodel.cpp | 16 | ||||
-rw-r--r-- | gui/qml/main.qml | 50 |
2 files changed, 33 insertions, 33 deletions
diff --git a/gui/qjsonmodel.cpp b/gui/qjsonmodel.cpp index 43260a0..030a2d4 100644 --- a/gui/qjsonmodel.cpp +++ b/gui/qjsonmodel.cpp @@ -211,7 +211,7 @@ bool QJsonModel::loadJson(const QByteArray &json) if (!jdoc.isNull()) { beginResetModel(); - delete mRootItem; + delete mRootItem; if (jdoc.isArray()) { mRootItem = QJsonTreeItem::load(QJsonValue(jdoc.array())); @@ -228,7 +228,7 @@ bool QJsonModel::loadJson(const QByteArray &json) if (!ok) { - qDebug()<<Q_FUNC_INFO<<"ERROR: cannot load json"; + qDebug()<<Q_FUNC_INFO<<"ERROR: cannot load json"; } mtx.unlock(); @@ -250,12 +250,12 @@ QVariant QJsonModel::data(const QModelIndex &index, int role) const case Roles::ValueRole: return item->value(); case Qt::DisplayRole: { - if (index.column() == 0) - return QString("%1").arg(item->key()); - else if (index.column() == 1) - return QString("%1").arg(item->value()); - else - return QString(""); + if (index.column() == 0) + return QString("%1").arg(item->key()); + else if (index.column() == 1) + return QString("%1").arg(item->value()); + else + return QString(""); } case Qt::EditRole: { if (index.column() == 1) diff --git a/gui/qml/main.qml b/gui/qml/main.qml index 3ddf8d3..4fce2c4 100644 --- a/gui/qml/main.qml +++ b/gui/qml/main.qml @@ -49,30 +49,30 @@ ApplicationWindow { } function showInitFailure(msg) { - console.debug("ERRORS:", ctx.errors) - if (msg == undefined) { - if (ctx.errors == 'bad_auth_502' || ctx.errors == 'bad_auth_timeout') { - msg = qsTr("Oops! The authentication service seems down. Please try again later") - initFailure.title = qsTr("Service Error") - } - else if (ctx.errors == 'bad_auth') { - if (allowEmptyPass) { - // For now, this is a libraryVPN, so we can be explicit about what credentials are here. - // Another option to consider is to customize the error strings while vendoring. - //: Incorrect library card number - msg = qsTr("Please check your Patron ID") - } else { - msg = qsTr("Could not log in with those credentials, please retry") - } - initFailure.title = qsTr("Login Error") - } else { - //: %1 -> application name - //: %2 -> error string - msg = qsTr("Got an error starting %1: %2").arg(ctx.appName).arg(ctx.errors) - } - } - initFailure.text = msg - initFailure.visible = true + console.debug("ERRORS:", ctx.errors) + if (msg == undefined) { + if (ctx.errors == 'bad_auth_502' || ctx.errors == 'bad_auth_timeout') { + msg = qsTr("Oops! The authentication service seems down. Please try again later") + initFailure.title = qsTr("Service Error") + } + else if (ctx.errors == 'bad_auth') { + if (allowEmptyPass) { + // For now, this is a libraryVPN, so we can be explicit about what credentials are here. + // Another option to consider is to customize the error strings while vendoring. + //: Incorrect library card number + msg = qsTr("Please check your Patron ID") + } else { + msg = qsTr("Could not log in with those credentials, please retry") + } + initFailure.title = qsTr("Login Error") + } else { + //: %1 -> application name + //: %2 -> error string + msg = qsTr("Got an error starting %1: %2").arg(ctx.appName).arg(ctx.errors) + } + } + initFailure.text = msg + initFailure.visible = true } function shouldAllowEmptyPass() { @@ -124,7 +124,7 @@ ApplicationWindow { "wait": "qrc:/assets/icon/png/black/vpn_wait_0.png", "blocked": "qrc:/assets/icon/png/black/vpn_blocked.png", } - + SystemTrayIcon { |