From ede78c640b3349a84251fc2d9113231a15f04107 Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Wed, 6 Sep 2023 21:22:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E4=B8=8D=E5=BC=80?= =?UTF-8?q?=E8=87=AA=E8=A1=8C=E6=B7=BB=E5=8A=A0=E7=9A=84=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OfficeAssistant_msvc/applicationmanager.cpp | 2 +- OfficeAssistant_msvc/mainwindowlayout.cpp | 4 +++- OfficeAssistant_msvc/sqlitehelper.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/OfficeAssistant_msvc/applicationmanager.cpp b/OfficeAssistant_msvc/applicationmanager.cpp index 3a5b264..d6801ca 100644 --- a/OfficeAssistant_msvc/applicationmanager.cpp +++ b/OfficeAssistant_msvc/applicationmanager.cpp @@ -171,7 +171,7 @@ void ApplicationManager::onclick1(QString op, QString func, QString path, QStrin DeviceRequest *device_request = new DeviceRequest;//构造函数里面会自动发送请求 delete device_request; } - if(software_ok&&app_ok) + if (software_ok && app_ok) { QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("更新成功")); emit refresh_tab(); diff --git a/OfficeAssistant_msvc/mainwindowlayout.cpp b/OfficeAssistant_msvc/mainwindowlayout.cpp index d92dd84..76dfa3c 100644 --- a/OfficeAssistant_msvc/mainwindowlayout.cpp +++ b/OfficeAssistant_msvc/mainwindowlayout.cpp @@ -76,7 +76,9 @@ void MainWindowLayout::clickButton(QString orig_name,QString op, QString func, Q } } else if(op=="soft"){ - ShellExecute(GetDesktopWindow(), L"open",path.toStdWString().c_str(),L"",initial_position.toStdWString().c_str(),SW_SHOW); + path.replace("/", "\\"); + initial_position.replace("/", "\\"); + WinExec(path.toStdString().c_str(), SW_SHOW); emit clickButton1(op, url); }else { diff --git a/OfficeAssistant_msvc/sqlitehelper.cpp b/OfficeAssistant_msvc/sqlitehelper.cpp index f89eb9d..8be2424 100644 --- a/OfficeAssistant_msvc/sqlitehelper.cpp +++ b/OfficeAssistant_msvc/sqlitehelper.cpp @@ -1372,7 +1372,7 @@ int SQLiteHelper::insert_software(QString name, QString orig_name, QString path, time_t create_time; time(&create_time); query.addBindValue(create_time); - query.addBindValue("app"); + query.addBindValue("soft"); query.addBindValue("open"); query.addBindValue(path); query.addBindValue("");