246 lines
7.3 KiB
Plaintext
246 lines
7.3 KiB
Plaintext
From 6b50cc2e133cc7bab8dbcc0781eedeed5d25e828 Mon Sep 17 00:00:00 2001
|
|
From: X512 <danger_mail@list.ru>
|
|
Date: Tue, 16 Jun 2020 21:58:19 +0900
|
|
Subject: platform: add Haiku
|
|
|
|
---
|
|
platform.cpp | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/platform.cpp b/platform.cpp
|
|
index fb99670..98acbcb 100644
|
|
--- a/platform.cpp
|
|
+++ b/platform.cpp
|
|
@@ -169,7 +169,7 @@ QString Platform::getDefaultPath()
|
|
return QString(getenv("USERPROFILE")) + "\\Desktop";
|
|
#elif defined(Q_OS_MAC)
|
|
return QString(getenv("HOME")) + "/Desktop";
|
|
-#elif defined(Q_OS_LINUX)
|
|
+#elif defined(Q_OS_LINUX) || defined(Q_OS_HAIKU)
|
|
return QString(getenv("HOME"));
|
|
#else
|
|
#error "Unknown default path for this platform"
|
|
--
|
|
2.27.0
|
|
|
|
|
|
From e0cfa8174613515541327e2c41bc36d9cb5ad91b Mon Sep 17 00:00:00 2001
|
|
From: X512 <danger_mail@list.ru>
|
|
Date: Tue, 16 Jun 2020 22:03:22 +0900
|
|
Subject: QML: Qt5 fixes
|
|
|
|
---
|
|
qml/dukto/Dukto.qml | 12 ++++++------
|
|
qml/dukto/DuktoOverlay.qml | 14 ++++++++++++++
|
|
2 files changed, 20 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/qml/dukto/Dukto.qml b/qml/dukto/Dukto.qml
|
|
index ecf6311..4c044fc 100644
|
|
--- a/qml/dukto/Dukto.qml
|
|
+++ b/qml/dukto/Dukto.qml
|
|
@@ -40,15 +40,15 @@ Rectangle {
|
|
|
|
Connections {
|
|
target: guiBehind
|
|
- onTransferStart: duktoOverlay.state = "progress"
|
|
- onReceiveCompleted: {
|
|
+ function onTransferStart() {duktoOverlay.state = "progress";}
|
|
+ function onReceiveCompleted() {
|
|
duktoOverlay.state = ""
|
|
duktoInner.gotoPage("recent");
|
|
}
|
|
- onGotoTextSnippet: duktoOverlay.state = "showtext"
|
|
- onGotoSendPage: duktoOverlay.state = "send";
|
|
- onGotoMessagePage: duktoOverlay.state = "message";
|
|
- onHideAllOverlays: duktoOverlay.state = "";
|
|
+ function onGotoTextSnippet() {duktoOverlay.state = "showtext";}
|
|
+ function onGotoSendPage() {duktoOverlay.state = "send";}
|
|
+ function onGotoMessagePage() {duktoOverlay.state = "message";}
|
|
+ function onHideAllOverlays() {duktoOverlay.state = "";}
|
|
}
|
|
|
|
DuktoInner {
|
|
diff --git a/qml/dukto/DuktoOverlay.qml b/qml/dukto/DuktoOverlay.qml
|
|
index 34238da..7920718 100644
|
|
--- a/qml/dukto/DuktoOverlay.qml
|
|
+++ b/qml/dukto/DuktoOverlay.qml
|
|
@@ -47,6 +47,7 @@ Rectangle {
|
|
width: parent.width
|
|
x: -50
|
|
opacity: 0
|
|
+ visible: false
|
|
onBack: parent.state = ""
|
|
}
|
|
|
|
@@ -58,6 +59,7 @@ Rectangle {
|
|
width: parent.width
|
|
x: -50
|
|
opacity: 0
|
|
+ visible: false
|
|
}
|
|
|
|
ShowTextPage {
|
|
@@ -67,6 +69,7 @@ Rectangle {
|
|
width: parent.width
|
|
x: -50
|
|
opacity: 0
|
|
+ visible: false
|
|
onBack: parent.state = ""
|
|
onBackOnSend: {
|
|
sendPage.setDestinationFocus();
|
|
@@ -80,6 +83,7 @@ Rectangle {
|
|
height: parent.height
|
|
x: -50
|
|
opacity: 0
|
|
+ visible: false
|
|
onBack: parent.state = ""
|
|
}
|
|
|
|
@@ -91,6 +95,7 @@ Rectangle {
|
|
height: parent.height
|
|
x: -50
|
|
opacity: 0
|
|
+ visible: false
|
|
onBack: parent.state = ""
|
|
onShowTextPage: {
|
|
showTextPage.setTextEditFocus();
|
|
@@ -106,6 +111,7 @@ Rectangle {
|
|
width: parent.width
|
|
x: -50
|
|
opacity: 0
|
|
+ visible: false
|
|
onBack: parent.state = backState
|
|
}
|
|
|
|
@@ -116,6 +122,7 @@ Rectangle {
|
|
width: parent.width
|
|
x: -50
|
|
opacity: 0
|
|
+ visible: false
|
|
onOk: {
|
|
guiBehind.showTermsOnStart = false;
|
|
parent.state = ""
|
|
@@ -128,6 +135,7 @@ Rectangle {
|
|
PropertyChanges {
|
|
target: ipPage
|
|
opacity: 1
|
|
+ visible: true
|
|
x: 0
|
|
}
|
|
PropertyChanges {
|
|
@@ -141,6 +149,7 @@ Rectangle {
|
|
PropertyChanges {
|
|
target: progressPage
|
|
opacity: 1
|
|
+ visible: true
|
|
x: 0
|
|
}
|
|
PropertyChanges {
|
|
@@ -154,6 +163,7 @@ Rectangle {
|
|
PropertyChanges {
|
|
target: showTextPage
|
|
opacity: 1
|
|
+ visible: true
|
|
x: 0
|
|
}
|
|
},
|
|
@@ -162,6 +172,7 @@ Rectangle {
|
|
PropertyChanges {
|
|
target: settingsPage
|
|
opacity: 1
|
|
+ visible: true
|
|
x: 0
|
|
}
|
|
},
|
|
@@ -170,6 +181,7 @@ Rectangle {
|
|
PropertyChanges {
|
|
target: sendPage
|
|
opacity: 1
|
|
+ visible: true
|
|
x: 0
|
|
}
|
|
},
|
|
@@ -178,6 +190,7 @@ Rectangle {
|
|
PropertyChanges {
|
|
target: messagePage
|
|
opacity: 1
|
|
+ visible: true
|
|
x: 0
|
|
}
|
|
PropertyChanges {
|
|
@@ -191,6 +204,7 @@ Rectangle {
|
|
PropertyChanges {
|
|
target: termsPage
|
|
opacity: 1
|
|
+ visible: true
|
|
x: 0
|
|
}
|
|
}
|
|
--
|
|
2.27.0
|
|
|
|
|
|
From 95baa0cb0a7332de48ede1f6eeef5044cc4ce3a0 Mon Sep 17 00:00:00 2001
|
|
From: X512 <danger_mail@list.ru>
|
|
Date: Tue, 16 Jun 2020 21:57:40 +0900
|
|
Subject: DuktoProtocol: Qt5 fixes
|
|
|
|
---
|
|
duktoprotocol.cpp | 25 +++++--------------------
|
|
1 file changed, 5 insertions(+), 20 deletions(-)
|
|
|
|
diff --git a/duktoprotocol.cpp b/duktoprotocol.cpp
|
|
index c83b8b9..6d6f6c5 100644
|
|
--- a/duktoprotocol.cpp
|
|
+++ b/duktoprotocol.cpp
|
|
@@ -56,11 +56,11 @@ DuktoProtocol::~DuktoProtocol()
|
|
void DuktoProtocol::initialize()
|
|
{
|
|
mSocket = new QUdpSocket(this);
|
|
- mSocket->bind(QHostAddress::Any, mLocalUdpPort);
|
|
+ mSocket->bind(QHostAddress::AnyIPv4, mLocalUdpPort);
|
|
connect(mSocket, SIGNAL(readyRead()), this, SLOT(newUdpData()));
|
|
|
|
mTcpServer = new QTcpServer(this);
|
|
- mTcpServer->listen(QHostAddress::Any, mLocalTcpPort);
|
|
+ mTcpServer->listen(QHostAddress::AnyIPv4, mLocalTcpPort);
|
|
connect(mTcpServer, SIGNAL(newConnection()), this, SLOT(newIncomingConnection()));
|
|
}
|
|
|
|
@@ -822,23 +822,8 @@ qint64 DuktoProtocol::computeTotalSize(QStringList *e)
|
|
// Invia un pacchetto a tutti gli indirizzi broadcast del PC
|
|
void DuktoProtocol::sendToAllBroadcast(QByteArray *packet, qint16 port)
|
|
{
|
|
- // Elenco interfacce disponibili
|
|
- QList<QNetworkInterface> ifaces = QNetworkInterface::allInterfaces();
|
|
-
|
|
- // Iterazione sulle interfacce
|
|
- for (int i = 0; i < ifaces.size(); i++)
|
|
- {
|
|
- // Iterazione per tutti gli IP dell'interfaccia
|
|
- QList<QNetworkAddressEntry> addrs = ifaces[i].addressEntries();
|
|
-
|
|
- // Invio pacchetto per ogni IP di broadcast
|
|
- for (int j = 0; j < addrs.size(); j++)
|
|
- if ((addrs[j].ip().protocol() == QAbstractSocket::IPv4Protocol) && (addrs[j].broadcast().toString() != ""))
|
|
- {
|
|
- mSocket->writeDatagram(packet->data(), packet->length(), addrs[j].broadcast(), port);
|
|
- mSocket->flush();
|
|
- }
|
|
- }
|
|
+ mSocket->writeDatagram(packet->data(), packet->length(), QHostAddress::Broadcast, port);
|
|
+ mSocket->flush();
|
|
}
|
|
|
|
// Interrompe un trasferimento in corso (utilizzabile solo lato invio)
|
|
@@ -859,5 +844,5 @@ void DuktoProtocol::updateBuddyName()
|
|
sayGoodbye();
|
|
|
|
// Invio pacchetto di annuncio con il nuovo nome
|
|
- sayHello(QHostAddress::Broadcast, true);
|
|
+ sayHello(QHostAddress::Broadcast);
|
|
}
|
|
--
|
|
2.27.0
|
|
|