mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +08:00
fix open alert
This commit is contained in:
parent
f1af78573a
commit
5da9268aa7
@ -79,21 +79,20 @@ QSize WidgetUtils::availableScreenSize(QWidget *p_widget)
|
|||||||
void WidgetUtils::openUrlByDesktop(const QUrl &p_url)
|
void WidgetUtils::openUrlByDesktop(const QUrl &p_url)
|
||||||
{
|
{
|
||||||
const auto scheme = p_url.scheme();
|
const auto scheme = p_url.scheme();
|
||||||
if (scheme == "http" || scheme == "https" ||
|
if (scheme != "http" && scheme != "https" &&
|
||||||
(p_url.isLocalFile() && QFileInfo(p_url.toLocalFile()).isDir())) {
|
!(p_url.isLocalFile() && QFileInfo(p_url.toLocalFile()).isDir())) {
|
||||||
QDesktopServices::openUrl(p_url);
|
// Prompt for user.
|
||||||
return;
|
int ret = MessageBoxHelper::questionYesNo(MessageBoxHelper::Warning,
|
||||||
|
MainWindow::tr("Are you sure to open link (%1)?").arg(p_url.toString()),
|
||||||
|
MainWindow::tr("Malicious link might do harm to your device."),
|
||||||
|
QString(),
|
||||||
|
nullptr);
|
||||||
|
if (ret == QMessageBox::No) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prompt for user.
|
QDesktopServices::openUrl(p_url);
|
||||||
int ret = MessageBoxHelper::questionYesNo(MessageBoxHelper::Warning,
|
|
||||||
MainWindow::tr("Are you sure to open link (%1)?").arg(p_url.toString()),
|
|
||||||
MainWindow::tr("Malicious link might do harm to your device."),
|
|
||||||
QString(),
|
|
||||||
nullptr);
|
|
||||||
if (ret == QMessageBox::No) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WidgetUtils::processKeyEventLikeVi(QWidget *p_widget,
|
bool WidgetUtils::processKeyEventLikeVi(QWidget *p_widget,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user