소스 검색

Use QUrl (2/2)

VolcaEM 6 년 전
부모
커밋
9e7ac6a009
1개의 변경된 파일5개의 추가작업 그리고 6개의 파일을 삭제
  1. 5 6
      src/yuzu/main.cpp

+ 5 - 6
src/yuzu/main.cpp

@@ -1801,26 +1801,25 @@ void GMainWindow::OnMenuReportCompatibility() {
     }
 }
 
-void GMainWindow::OpenURL(const QString& url_str) {
+void GMainWindow::OpenURL(QUrl const& url) {
 
-    const QUrl url{url_str};
     const bool open = QDesktopServices::openUrl(url);
     if (!open) {
         QMessageBox::warning(this, tr("Error opening URL"),
-                             tr("Unable to open the URL \"%1\".").arg(url_str));
+                             tr("Unable to open the URL \"%1\".").arg(url.toString()));
     }
 }
 
 void GMainWindow::OnOpenModsPage() {
-    this->OpenURL(QStringLiteral("https://github.com/yuzu-emu/yuzu/wiki/Switch-Mods"));
+    OpenURL(QUrl(QStringLiteral("https://github.com/yuzu-emu/yuzu/wiki/Switch-Mods")));
 }
 
 void GMainWindow::OnQuickstartGuide() {
-    this->OpenURL(QStringLiteral("https://yuzu-emu.org/help/quickstart/"));
+    OpenURL(QUrl(QStringLiteral("https://yuzu-emu.org/help/quickstart/")));
 }
 
 void GMainWindow::OnFAQ() {
-    this->OpenURL(QStringLiteral("https://yuzu-emu.org/wiki/faq/"));
+    OpenURL(QUrl(QStringLiteral("https://yuzu-emu.org/wiki/faq/")));
 }
 
 void GMainWindow::ToggleFullscreen() {