mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
WIP: minor fixes
This commit is contained in:
@@ -539,33 +539,48 @@ void FileShareTrayController::hideToTray() {
|
||||
}
|
||||
|
||||
void FileShareTrayController::startSendMode() {
|
||||
service_->StartSendMode([this](NearbySharingApi::StatusCode status) {
|
||||
QMetaObject::invokeMethod(
|
||||
this,
|
||||
[this, status]() {
|
||||
SetStatus(QStringLiteral("StartSendMode: %1").arg(StatusToString(status)));
|
||||
if (status != NearbySharingApi::StatusCode::kOk) {
|
||||
running_ = false;
|
||||
emit runningChanged();
|
||||
}
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
service_->StopReceiveMode([this](NearbySharingApi::StatusCode status)
|
||||
{
|
||||
if (status == NearbySharingApi::StatusCode::kOk || status == NearbySharingApi::StatusCode::kStatusAlreadyStopped)
|
||||
{
|
||||
service_->StartSendMode([this](NearbySharingApi::StatusCode status) {
|
||||
QMetaObject::invokeMethod(
|
||||
this,
|
||||
[this, status]() {
|
||||
SetStatus(QStringLiteral("StartSendMode: %1").arg(StatusToString(status)));
|
||||
if (status != NearbySharingApi::StatusCode::kOk) {
|
||||
running_ = false;
|
||||
emit runningChanged();
|
||||
}
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
void FileShareTrayController::startReceiveMode() {
|
||||
service_->StartReceiveMode([this](NearbySharingApi::StatusCode status) {
|
||||
QMetaObject::invokeMethod(
|
||||
this,
|
||||
[this, status]() {
|
||||
SetStatus(
|
||||
QStringLiteral("StartReceiveMode: %1").arg(StatusToString(status)));
|
||||
if (status != NearbySharingApi::StatusCode::kOk) {
|
||||
running_ = false;
|
||||
emit runningChanged();
|
||||
}
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
service_->StopSendMode([this](NearbySharingApi::StatusCode status)
|
||||
{
|
||||
if (status == NearbySharingApi::StatusCode::kOk || status == NearbySharingApi::StatusCode::kStatusAlreadyStopped)
|
||||
{
|
||||
|
||||
service_->StartReceiveMode([this](NearbySharingApi::StatusCode status) {
|
||||
QMetaObject::invokeMethod(
|
||||
this,
|
||||
[this, status]() {
|
||||
SetStatus(
|
||||
QStringLiteral("StartReceiveMode: %1").arg(StatusToString(status)));
|
||||
if (status != NearbySharingApi::StatusCode::kOk) {
|
||||
running_ = false;
|
||||
emit runningChanged();
|
||||
}
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -123,15 +123,19 @@ class FileShareTrayController : public QObject {
|
||||
bool running_ = false;
|
||||
|
||||
bool auto_accept_incoming_ = true;
|
||||
|
||||
// qr stuff
|
||||
QString qr_code_url_;
|
||||
QStringList qr_code_rows_;
|
||||
int qr_code_size_ = 0;
|
||||
QString log_path_ = QStringLiteral("/tmp/nearby_qml_file_tray.log");
|
||||
|
||||
// pending send stuff
|
||||
QString pending_send_file_path_;
|
||||
QString pending_send_file_name_;
|
||||
qlonglong pending_send_target_id_ = 0;
|
||||
|
||||
// send targets
|
||||
QVariantList discovered_targets_;
|
||||
QHash<qlonglong, int> discovered_row_by_target_;
|
||||
QSet<qlonglong> pending_target_removals_;
|
||||
|
||||
Reference in New Issue
Block a user