Skip to content

Commit

Permalink
Fix login button error from QML
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Guerinoni <guerinoni.federico@gmail.com>
  • Loading branch information
guerinoni committed Dec 5, 2023
1 parent 117c57b commit 55681a8
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/Authenticator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <QNetworkReply>
#include <QSettings>

void Authenticator::requestLogin(QString &email, QString &pass, QString &twoFA)
void Authenticator::requestLogin(QString email, QString pass, QString twoFA)
{
QNetworkRequest req(DiscordAPI::login);
req.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
Expand Down
3 changes: 1 addition & 2 deletions src/handlers/Authenticator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class Authenticator : public QObject
Q_OBJECT

public:
Q_INVOKABLE void requestLogin(QString &email, QString &pass,
QString &twoFA);
Q_INVOKABLE void requestLogin(QString email, QString pass, QString twoFA);
Q_INVOKABLE void requestLogout();

signals:
Expand Down
12 changes: 6 additions & 6 deletions src/qml/ChannelsBar.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material

Rectangle {
color: Material.backgroundColor
Expand All @@ -20,8 +20,8 @@ Rectangle {
boundsBehavior: ListView.StopAtBounds
delegate: Text {
text: nameRole
color: hmi.guildsModel.channelsModel.selected ===
index ? Material.accentColor : Material.foreground
color: hmi.guildsModel.channelsModel.selected
=== index ? Material.accentColor : Material.foreground

MouseArea {
anchors.fill: parent
Expand All @@ -30,4 +30,4 @@ Rectangle {
}
}
}
}
}
8 changes: 4 additions & 4 deletions src/qml/Login.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material

Rectangle {

Expand Down Expand Up @@ -85,4 +85,4 @@ Rectangle {
text: qsTr("Login")
onClicked: auth.requestLogin(txtEmail.text, txtPass.text, txt2FA.text)
}
}
}
8 changes: 4 additions & 4 deletions src/qml/UserInfoBar.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material

Rectangle {
color: Material.backgroundColor
Expand Down Expand Up @@ -39,4 +39,4 @@ Rectangle {
onClicked: auth.requestLogout()
}
}
}
}
8 changes: 4 additions & 4 deletions src/qml/main.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick
import QtQuick.Window
import QtQuick.Controls

ApplicationWindow {
width: 640
Expand Down Expand Up @@ -79,4 +79,4 @@ ApplicationWindow {
popupMessageError.message = qsTr(errorMessage)
}
}
}
}

0 comments on commit 55681a8

Please sign in to comment.