Skip to content

Commit 521859f

Browse files
committed
Remove broken launcher news widget
The links for news are broken. As most announcements are published via Discord nowadays, remove it for now.
1 parent 963c4ec commit 521859f

File tree

5 files changed

+4
-112
lines changed

5 files changed

+4
-112
lines changed

src/blackcore/data/globalsetup.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ namespace BlackCore::Data
5959
"https://swift.fir-berlin.de/shared"
6060
};
6161

62-
m_newsUrls = CUrlList
63-
{
64-
"https://blog.swift-project.net/?__print__=1",
65-
"https://dev.swift-project.org/phame/blog/view/1/?__print__=1"
66-
};
6762
m_onlineHelpUrls = CUrlList
6863
{
6964
"https://datastore.swift-project.org/page/swifthelpdispatcher.html",
@@ -262,11 +257,6 @@ namespace BlackCore::Data
262257
return setup;
263258
}
264259

265-
const CUrlList &CGlobalSetup::getSwiftLatestNewsUrls() const
266-
{
267-
return m_newsUrls;
268-
}
269-
270260
CServerList CGlobalSetup::getPredefinedServersPlusHardcodedServers() const
271261
{
272262
static const CServerList hardcoded(
@@ -320,9 +310,6 @@ namespace BlackCore::Data
320310
% u"Bootstrap URLs: "
321311
% getSwiftBootstrapFileUrls().toQString(i18n)
322312
% separator
323-
% u"News URLs: "
324-
% getSwiftLatestNewsUrls().toQString(i18n)
325-
% separator
326313
% u"Help URLs: "
327314
% m_onlineHelpUrls.toQString(i18n)
328315
% separator;
@@ -388,7 +375,6 @@ namespace BlackCore::Data
388375
case IndexBootstrapFileUrls: return QVariant::fromValue(this->getSwiftBootstrapFileUrls());
389376
case IndexUpdateInfoFileUrls: return QVariant::fromValue(this->getSwiftUpdateInfoFileUrls());
390377
case IndexSharedUrls: return QVariant::fromValue(m_sharedUrls);
391-
case IndexNewsUrls: return QVariant::fromValue(m_newsUrls);
392378
case IndexOnlineHelpUrls: return QVariant::fromValue(m_onlineHelpUrls);
393379
case IndexCrashReportServerUrl: return QVariant::fromValue(m_crashReportServerUrl);
394380
case IndexWasLoadedFromWeb: return QVariant::fromValue(m_wasLoadedFromWeb);
@@ -420,7 +406,6 @@ namespace BlackCore::Data
420406
case IndexVatsimBookings: m_vatsimBookingsUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
421407
case IndexVatsimMetars: m_vatsimMetarsUrls = variant.value<CUrlList>(); break;
422408
case IndexSharedUrls: m_sharedUrls = variant.value<CUrlList>(); break;
423-
case IndexNewsUrls: m_newsUrls = variant.value<CUrlList>(); break;
424409
case IndexOnlineHelpUrls: m_onlineHelpUrls = variant.value<CUrlList>(); break;
425410
case IndexCrashReportServerUrl: m_crashReportServerUrl = variant.value<CUrl>(); break;
426411
case IndexWasLoadedFromWeb: m_wasLoadedFromWeb = variant.toBool(); break;

src/blackcore/data/globalsetup.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ namespace BlackCore::Data
5353
IndexSwiftDbFiles,
5454
IndexBootstrapFileUrls,
5555
IndexUpdateInfoFileUrls,
56-
IndexNewsUrls,
5756
IndexOnlineHelpUrls,
5857
IndexCrashReportServerUrl,
5958
IndexWasLoadedFromWeb,
@@ -182,9 +181,6 @@ namespace BlackCore::Data
182181
//! VATSIM data file URLs
183182
const BlackMisc::Network::CUrlList &getVatsimDataFileUrls() const { return m_vatsimDataFileUrls; }
184183

185-
//! Locations of swift DB news
186-
const BlackMisc::Network::CUrlList &getSwiftLatestNewsUrls() const;
187-
188184
//! Help page URL
189185
//! \remark working URL evaluated at runtime, based on getOnlineHelpUrls
190186
BlackMisc::Network::CUrl getHelpPageUrl(const QString &context = {}) const;
@@ -254,7 +250,6 @@ namespace BlackCore::Data
254250
BlackMisc::Network::CUrlList m_vatsimStatusFileUrls; //!< Status file, where to find the VATSIM files (METAR, data, ATIS, other status files)
255251
BlackMisc::Network::CUrlList m_vatsimDataFileUrls; //!< Overall VATSIM data file / merely for bootstrapping the first time
256252
BlackMisc::Network::CUrlList m_sharedUrls; //!< where we can obtain shared info files such as bootstrap, ..
257-
BlackMisc::Network::CUrlList m_newsUrls; //!< where we can obtain latest news
258253
BlackMisc::Network::CUrlList m_onlineHelpUrls; //!< online help URLs
259254
BlackMisc::Network::CServerList m_predefinedServers; //!< Predefined servers loaded from setup file
260255
BlackMisc::Network::CUrl m_ncepGlobalForecastSystemUrl; //!< NCEP GFS url 0.5 degree resolution
@@ -281,7 +276,6 @@ namespace BlackCore::Data
281276
BLACK_METAMEMBER(vatsimBookingsUrl),
282277
BLACK_METAMEMBER(vatsimMetarsUrls),
283278
BLACK_METAMEMBER(sharedUrls),
284-
BLACK_METAMEMBER(newsUrls),
285279
BLACK_METAMEMBER(onlineHelpUrls),
286280
BLACK_METAMEMBER(predefinedServers),
287281
BLACK_METAMEMBER(development),

src/swiftlauncher/swiftlauncher.cpp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -231,33 +231,9 @@ void CSwiftLauncher::mouseReleaseEvent(QMouseEvent *event)
231231
QDialog::mouseReleaseEvent(event);
232232
}
233233

234-
void CSwiftLauncher::displayLatestNews(QNetworkReply *reply)
235-
{
236-
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(reply);
237-
if (nwReply->error() == QNetworkReply::NoError)
238-
{
239-
const QString html = nwReply->readAll().trimmed();
240-
if (html.isEmpty()) { return; }
241-
CLogMessage(this).info(u"Received news from '%1'") << nwReply->url().toString();
242-
ui->tbr_LatestNews->setHtml(html); // causes QFSFileEngine::open: No file name specified
243-
constexpr qint64 newNews = 72 * 3600 * 1000;
244-
const qint64 deltaT = CNetworkUtils::lastModifiedSinceNow(nwReply.data());
245-
if (deltaT > 0 && deltaT < newNews)
246-
{
247-
ui->tb_Launcher->setCurrentWidget(ui->pg_LatestNewsAndAbout);
248-
ui->tw_LatestNewsAbout->setCurrentWidget(ui->tb_LatestNews);
249-
}
250-
}
251-
else
252-
{
253-
CLogMessage(this).warning(u"Error received news from '%1'") << nwReply->url().toString();
254-
}
255-
}
256-
257234
void CSwiftLauncher::updateInfoAvailable()
258235
{
259236
this->setHeaderInfo(ui->comp_UpdateInfo->getLatestAvailablePilotClientArtifactForSelection());
260-
this->loadLatestNews();
261237
}
262238

263239
void CSwiftLauncher::init()
@@ -276,7 +252,6 @@ void CSwiftLauncher::init()
276252
ui->lbl_HeaderInfo->setVisible(false);
277253
ui->sw_SwiftLauncher->setCurrentWidget(ui->pg_SwiftLauncherMain);
278254
ui->tb_Launcher->setCurrentWidget(ui->pg_CoreMode);
279-
ui->tw_LatestNewsAbout->setCurrentWidget(ui->tb_LatestNews);
280255
}
281256

282257
void CSwiftLauncher::initStyleSheet()
@@ -293,22 +268,6 @@ void CSwiftLauncher::initStyleSheet()
293268
this->setStyleSheet(s);
294269
}
295270

296-
void CSwiftLauncher::loadLatestNews()
297-
{
298-
if (!sGui || sGui->isShuttingDown()) { return; }
299-
300-
CFailoverUrlList newsUrls(sGui->getGlobalSetup().getSwiftLatestNewsUrls());
301-
const CUrl newsUrl(newsUrls.obtainNextWorkingUrl(true, 10 * 1000));
302-
// const CUrl newsUrl("https://dev.swift-project.org/phame/blog/view/1/?__print__=1");
303-
304-
if (newsUrl.isEmpty())
305-
{
306-
CLogMessage(this).warning(u"No working news URL in %1") << newsUrls.toQString();
307-
return;
308-
}
309-
sGui->getFromNetwork(newsUrl, { this, &CSwiftLauncher::displayLatestNews});
310-
}
311-
312271
void CSwiftLauncher::initLogDisplay()
313272
{
314273
CLogHandler::instance()->install(true);

src/swiftlauncher/swiftlauncher.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,6 @@ private slots:
131131
//! Set header info
132132
void setHeaderInfo(const BlackMisc::Db::CArtifact &latestArtifact);
133133

134-
//! Latest news
135-
//! \sa CSwiftLauncher::displayLatestNews
136-
void loadLatestNews();
137-
138134
//! Executaable for core
139135
bool setSwiftCoreExecutable();
140136

@@ -159,9 +155,6 @@ private slots:
159155
//! Check for other swift applications, if so show message box
160156
bool warnAboutOtherSwiftApplications();
161157

162-
//! Display latest news
163-
void displayLatestNews(QNetworkReply *reply);
164-
165158
//! Distribution info is available
166159
void updateInfoAvailable();
167160

src/swiftlauncher/swiftlauncher.ui

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
<property name="tabSpacing">
9494
<number>6</number>
9595
</property>
96-
<widget class="QWidget" name="pg_LatestNewsAndAbout">
96+
<widget class="QWidget" name="pg_About">
9797
<property name="geometry">
9898
<rect>
9999
<x>0</x>
@@ -103,48 +103,11 @@
103103
</rect>
104104
</property>
105105
<attribute name="label">
106-
<string>Latest &amp;news and about</string>
106+
<string>About</string>
107107
</attribute>
108-
<layout class="QVBoxLayout" name="vl_LatestNewsAndAbout">
108+
<layout class="QVBoxLayout" name="vl_About">
109109
<item>
110-
<widget class="QTabWidget" name="tw_LatestNewsAbout">
111-
<property name="currentIndex">
112-
<number>1</number>
113-
</property>
114-
<widget class="QWidget" name="tb_LatestNews">
115-
<attribute name="title">
116-
<string>News</string>
117-
</attribute>
118-
<layout class="QVBoxLayout" name="vl_LatestNews">
119-
<item>
120-
<widget class="QTextBrowser" name="tbr_LatestNews">
121-
<property name="documentTitle">
122-
<string>Latest news</string>
123-
</property>
124-
<property name="readOnly">
125-
<bool>true</bool>
126-
</property>
127-
<property name="placeholderText">
128-
<string>Latest news will go here</string>
129-
</property>
130-
<property name="openExternalLinks">
131-
<bool>true</bool>
132-
</property>
133-
</widget>
134-
</item>
135-
</layout>
136-
</widget>
137-
<widget class="QWidget" name="tb_About">
138-
<attribute name="title">
139-
<string>About</string>
140-
</attribute>
141-
<layout class="QVBoxLayout" name="vl_About">
142-
<item>
143-
<widget class="BlackGui::Components::CAboutHtmlComponent" name="comp_AboutHTML"/>
144-
</item>
145-
</layout>
146-
</widget>
147-
</widget>
110+
<widget class="BlackGui::Components::CAboutHtmlComponent" name="comp_AboutHTML"/>
148111
</item>
149112
</layout>
150113
</widget>
@@ -928,8 +891,6 @@
928891
<tabstop>pb_DumpDir</tabstop>
929892
<tabstop>pb_P3DConfigDirs</tabstop>
930893
<tabstop>pb_FSXConfigDirs</tabstop>
931-
<tabstop>tw_LatestNewsAbout</tabstop>
932-
<tabstop>tbr_LatestNews</tabstop>
933894
<tabstop>tb_BackToMain</tabstop>
934895
<tabstop>rb_WindowNormal</tabstop>
935896
<tabstop>rb_WindowFrameless</tabstop>

0 commit comments

Comments
 (0)