mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 11:47:46 +00:00
Only fetch the news once
This commit is contained in:
parent
30d2791810
commit
703f66a8d6
1 changed files with 47 additions and 48 deletions
|
@ -202,25 +202,8 @@ LauncherWindow::LauncherWindow(LauncherCore& core, QWidget* parent) : QMainWindo
|
|||
|
||||
reloadControls();
|
||||
|
||||
getHeadline(core, [this](Headline headline) {
|
||||
getHeadline(core, [&](Headline headline) {
|
||||
this->headline = headline;
|
||||
reloadControls();
|
||||
});
|
||||
}
|
||||
|
||||
ProfileSettings LauncherWindow::currentProfile() const {
|
||||
return core.getProfile(profileSelect->currentIndex());
|
||||
}
|
||||
|
||||
ProfileSettings& LauncherWindow::currentProfile() {
|
||||
return core.getProfile(profileSelect->currentIndex());
|
||||
}
|
||||
|
||||
void LauncherWindow::reloadControls() {
|
||||
if(currentlyReloadingControls)
|
||||
return;
|
||||
|
||||
currentlyReloadingControls = true;
|
||||
|
||||
if(!headline.banner.empty()) {
|
||||
auto request = QNetworkRequest(headline.banner[0].bannerImage);
|
||||
|
@ -267,6 +250,22 @@ void LauncherWindow::reloadControls() {
|
|||
|
||||
newsListView->insertTopLevelItems(0, QList<QTreeWidgetItem*>({newsItem, pinnedItem, topicsItem}));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ProfileSettings LauncherWindow::currentProfile() const {
|
||||
return core.getProfile(profileSelect->currentIndex());
|
||||
}
|
||||
|
||||
ProfileSettings& LauncherWindow::currentProfile() {
|
||||
return core.getProfile(profileSelect->currentIndex());
|
||||
}
|
||||
|
||||
void LauncherWindow::reloadControls() {
|
||||
if(currentlyReloadingControls)
|
||||
return;
|
||||
|
||||
currentlyReloadingControls = true;
|
||||
|
||||
const int oldIndex = profileSelect->currentIndex();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue