From 28206e8586858f3e852c386da171b42951267645 Mon Sep 17 00:00:00 2001 From: taynpg Date: Wed, 5 Nov 2025 09:35:36 +0800 Subject: [PATCH] =?UTF-8?q?fun=EF=BC=9A=E5=AF=B9=E7=85=A7=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=89=93=E5=BC=80=E6=9C=AC=E5=9C=B0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Console/Console.cpp | 2 +- Gui/Control/CompareControl.cpp | 16 ++++++++++++++++ Note/version.md | 2 +- Server/Server.cpp | 8 ++++---- Server/main.cpp | 4 ++-- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Console/Console.cpp b/Console/Console.cpp index 940dc4a..e925dad 100644 --- a/Console/Console.cpp +++ b/Console/Console.cpp @@ -33,7 +33,7 @@ void ConsoleHelper::SetIpPort(const QString& ip, quint16 port) { ip_ = ip; port_ = port; - qDebug() << "SetIpPort:" << ip_ << port_; + qInfo() << "SetIpPort:" << ip_ << port_; } void ConsoleHelper::Connect() diff --git a/Gui/Control/CompareControl.cpp b/Gui/Control/CompareControl.cpp index 7238640..d175b89 100644 --- a/Gui/Control/CompareControl.cpp +++ b/Gui/Control/CompareControl.cpp @@ -1,5 +1,7 @@ #include "CompareControl.h" +#include +#include #include #include #include @@ -51,6 +53,20 @@ void Compare::InitMenu() ui->tableWidget->setItem(cnt, 2, item3); }); menu_->addAction(tr("删除"), this, [this]() { deleteSelectedRows(); }); + menu_->addAction(tr("尝试打开本地路径"), this, [this]() { + auto selected = ui->tableWidget->selectedItems(); + if (selected.size() != 3) { + return; + } + auto item = selected[1]; + auto path = item->text(); + QDir dir(path); + if (!dir.exists()) { + FTCommon::msg(this, tr("本地路径不存在。")); + return; + } + QDesktopServices::openUrl(QUrl::fromLocalFile(path)); + }); menu_->addSeparator(); connect(ui->tableWidget, &QTableWidget::customContextMenuRequested, this, [this](const QPoint& pos) { menu_->exec(QCursor::pos()); }); diff --git a/Note/version.md b/Note/version.md index 197fd3c..86ae040 100644 --- a/Note/version.md +++ b/Note/version.md @@ -8,7 +8,7 @@ | 序号 | 类型 | 内容 | 说明 | 基于版本 | 完成版本 | | :--: | :--: | ------------------------------------------------------------ | :--: | :------: | :------: | -| 28 | 变更 | 语言简体中文。 | | 0.2.2 | | +| 28 | 变更 | 语言简体中文。 | | 0.2.2 | 0.2.3 | | 27 | 功能 | 传输前检查对方或者自己是否已存在某些文件,提示是否覆盖。 | | 0.2.2 | | | 26 | 功能 | 最好能保存关闭界面时Splitter和UI的尺寸。 | | 0.2.2 | | | 25 | 功能 | 手动输入的文件夹访问路径保存历史记录,以便后续可能再次使用(10条)。 | | 0.2.2 | | diff --git a/Server/Server.cpp b/Server/Server.cpp index 104b88b..4f89338 100644 --- a/Server/Server.cpp +++ b/Server/Server.cpp @@ -29,7 +29,7 @@ bool Server::startServer(quint16 port) return false; } - qDebug() << "Server started on port" << serverPort(); + qInfo() << "Server started on port" << serverPort(); monitorTimer_->start(MONITOR_HEART_SPED); id_ = QString("0.0.0.0:%1").arg(serverPort()); return true; @@ -78,7 +78,7 @@ void Server::onNewConnection() clients_.insert(clientId, client); } - qDebug() << "Client connected:" << clientId; + qInfo() << "Client connected:" << clientId; auto frame = QSharedPointer::create(); frame->type = FBT_SER_MSG_YOURID; frame->fid = id_; @@ -227,7 +227,7 @@ void Server::onClientDisconnected() } } - qDebug() << "Client disconnected:" << __LINE__ << clientId; + qInfo() << "Client disconnected:" << __LINE__ << clientId; socket->deleteLater(); } @@ -245,7 +245,7 @@ void Server::monitorClients() } } for (const auto& s : prepareRemove) { - qDebug() << "Removing inactive client:" << s->property("clientId").toString(); + qInfo() << "Removing inactive client:" << s->property("clientId").toString(); s->disconnectFromHost(); } } diff --git a/Server/main.cpp b/Server/main.cpp index af22fda..a024fc7 100644 --- a/Server/main.cpp +++ b/Server/main.cpp @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) int port = 9009; if (argc < 2) { - qDebug() << "==============> Usage: frelayServer port."; + qInfo() << "==============> Usage: frelayServer port."; } else { port = atoi(argv[1]); } @@ -28,7 +28,7 @@ int main(int argc, char* argv[]) return 1; } - qDebug() << "TCP server is running. Press Ctrl+C to exit..."; + qInfo() << "TCP server is running. Press Ctrl+C to exit..."; return app.exec(); } \ No newline at end of file