From 70f8cb81b8bbdf8bc2f4931981002ab56125361d Mon Sep 17 00:00:00 2001 From: dada513 Date: Thu, 10 Feb 2022 13:14:25 +0100 Subject: [PATCH] Initial RSS re-add and removed hardcoded strings --- CMakeLists.txt | 5 +++-- buildconfig/BuildConfig.cpp.in | 1 + buildconfig/BuildConfig.h | 5 +++++ launcher/ui/MainWindow.cpp | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 593d608e..aca8b898 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,12 +46,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y") ##################################### Set Application options ##################################### ######## Set URLs ######## -set(Launcher_NEWS_RSS_URL "https://multimc.org/rss.xml" CACHE STRING "URL to fetch Launcher's news RSS feed from.") +set(Launcher_NEWS_RSS_URL "https://polymc.github.io/feed/feed.xml" CACHE STRING "URL to fetch PolyMC's news RSS feed from.") +set(Launcher_NEWS_OPEN_URL "https://polymc.github.io/news/" CACHE STRING "URL that gets opened when the user clicks 'More News'") ######## Set version numbers ######## set(Launcher_VERSION_MAJOR 1) set(Launcher_VERSION_MINOR 0) -set(Launcher_VERSION_HOTFIX 5) +set(Launcher_VERSION_HOTFIX 6) # Build number set(Launcher_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.") diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 2595f78b..655d3bfb 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -42,6 +42,7 @@ Config::Config() VERSION_STR = "@Launcher_VERSION_STRING@"; NEWS_RSS_URL = "@Launcher_NEWS_RSS_URL@"; + NEWS_OPEN_URL = "@Launcher_NEWS_OPEN_URL@"; IMGUR_CLIENT_ID = "@Launcher_IMGUR_CLIENT_ID@"; MSA_CLIENT_ID = "@Launcher_MSA_CLIENT_ID@"; META_URL = "@Launcher_META_URL@"; diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index d09d5288..6e524736 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -67,6 +67,11 @@ public: */ QString NEWS_RSS_URL; + /** + * URL that gets opened when the user clicks "More News" + */ + QString NEWS_OPEN_URL; + /** * Client ID you can get from Imgur when you register an application */ diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 3dcc8ee9..32b27afb 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1687,7 +1687,7 @@ void MainWindow::on_actionReportBug_triggered() void MainWindow::on_actionMoreNews_triggered() { - DesktopServices::openUrl(QUrl("https://multimc.org/posts.html")); + DesktopServices::openUrl(QUrl(BuildConfig.NEWS_OPEN_URL)); } void MainWindow::newsButtonClicked() @@ -1699,7 +1699,7 @@ void MainWindow::newsButtonClicked() } else { - DesktopServices::openUrl(QUrl("https://multimc.org/posts.html")); + DesktopServices::openUrl(QUrl(BuildConfig.NEWS_OPEN_URL)); } }