mirror of https://gitee.com/openkylin/peony.git
[FIX] #191467 【蓝牙】蓝牙文件发送功能测试-文件选择
note: 文件操作层会设置QApplication是否在关闭所有窗口时退出,这个流程不应该影响peony以外的应用
This commit is contained in:
parent
cc4bbcc2e0
commit
2905b8c89e
|
@ -316,15 +316,15 @@ void FileOperationManager::startOperation(FileOperation *operation, bool addToHi
|
|||
}
|
||||
|
||||
start:
|
||||
|
||||
static bool oldQuitOnLastWindow = QApplication::quitOnLastWindowClosed();
|
||||
QApplication::setQuitOnLastWindowClosed(false);
|
||||
|
||||
connect(operation, &FileOperation::operationFinished, this, [=]() {
|
||||
operation->notifyFileWatcherOperationFinished();
|
||||
if (qApp->property("isPeony").toBool()) {
|
||||
auto settings = GlobalSettings::getInstance();
|
||||
bool runbackend = settings->getInstance()->getValue(RESIDENT_IN_BACKEND).toBool();
|
||||
QApplication::setQuitOnLastWindowClosed(!runbackend);
|
||||
|
||||
QTimer::singleShot(1000, this, [=]() {
|
||||
int last_op_count = m_thread_pool->children().count();
|
||||
if (last_op_count == 0) {
|
||||
|
@ -335,13 +335,13 @@ start:
|
|||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
QApplication::setQuitOnLastWindowClosed(oldQuitOnLastWindow);
|
||||
}
|
||||
}, Qt::BlockingQueuedConnection);
|
||||
|
||||
|
||||
|
||||
bool allowParallel = m_allow_parallel;
|
||||
|
||||
|
||||
connect(operation, &FileOperation::operationTotalFileSize, this, [=](const qint64& total_file_size) {
|
||||
// fix #171449
|
||||
if (m_progressbar->isHidden()) {
|
||||
|
|
|
@ -110,6 +110,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
PeonyApplication app(argc, argv, "peony-qt");
|
||||
qApp->setProperty("isPeony", true);
|
||||
Peony::XdgPortalHelper::getInstance()->tryResetPortal();
|
||||
if (app.isSecondary())
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue