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,12 +79,8 @@ QSize WidgetUtils::availableScreenSize(QWidget *p_widget)
|
||||
void WidgetUtils::openUrlByDesktop(const QUrl &p_url)
|
||||
{
|
||||
const auto scheme = p_url.scheme();
|
||||
if (scheme == "http" || scheme == "https" ||
|
||||
(p_url.isLocalFile() && QFileInfo(p_url.toLocalFile()).isDir())) {
|
||||
QDesktopServices::openUrl(p_url);
|
||||
return;
|
||||
}
|
||||
|
||||
if (scheme != "http" && scheme != "https" &&
|
||||
!(p_url.isLocalFile() && QFileInfo(p_url.toLocalFile()).isDir())) {
|
||||
// Prompt for user.
|
||||
int ret = MessageBoxHelper::questionYesNo(MessageBoxHelper::Warning,
|
||||
MainWindow::tr("Are you sure to open link (%1)?").arg(p_url.toString()),
|
||||
@ -94,6 +90,9 @@ void WidgetUtils::openUrlByDesktop(const QUrl &p_url)
|
||||
if (ret == QMessageBox::No) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QDesktopServices::openUrl(p_url);
|
||||
}
|
||||
|
||||
bool WidgetUtils::processKeyEventLikeVi(QWidget *p_widget,
|
||||
|
Loading…
x
Reference in New Issue
Block a user