Skip to content

Commit

Permalink
fix: remove banner from homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
openarun committed Jan 7, 2024
1 parent 54a4e29 commit c277c16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
14 changes: 1 addition & 13 deletions pages/homepage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@ HomePage::HomePage(MainWindow *parent)
setLayout(mainLayout);
mainLayout->addWidget(scroll);

QFile bannerFile("://featuredbanners.json");
bannerFile.open(QIODevice::ReadOnly | QIODevice::Text);
QJsonObject bannerData = QJsonDocument::fromJson(bannerFile.readAll()).object();
QList<QPair<QString, App*>> banners;
for (const QString &key : bannerData.keys()) {
App *app = static_cast<PackageKitSource*>(SourceManager::instance()->getSource("PackageKit"))->getDataFromID(key);
if (app->hasMetadata)
banners << qMakePair(bannerData.value(key).toString(), app);
}
gallery *featuredGallery = new gallery(banners, parent);
layout->addWidget(featuredGallery);

addCategory(tr("Messaging"), "InstantMessaging", parent);
addCategory(tr("Internet"), "Network", parent);
addCategory(tr("Games"), "Game", parent);
Expand Down Expand Up @@ -85,7 +73,7 @@ void HomePage::addCategory(QString name, QString category, MainWindow *parent)
}
});
pk->getCategory(category);

DSuggestButton *moreBtn = new DSuggestButton(tr("View More"));
connect(moreBtn, &DSuggestButton::clicked, this, [ = ] {
parent->navView->setCurrentIndex(parent->navModel->index(categories.indexOf(category) + 1, 0));
Expand Down
10 changes: 1 addition & 9 deletions resources/resources.qrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
<RCC>
<qresource prefix="/">
<file>settings.json</file>
<file>featuredbanners.json</file>
<file>banners/firefox.jpg</file>
<file>banners/kdenlive.jpg</file>
<file>banners/gimp.jpg</file>
<file>banners/inkscape.jpg</file>
<file>banners/krita.jpg</file>
<file>banners/vlc.jpg</file>
<file>banners/audacity.jpg</file>
<file>icons/star.png</file>
<file>icons/starhalf.png</file>
<file>icons/indicator.svg</file>
<file>icons/light/home.svg</file>
<file>icons/light/internet.svg</file>
<file>icons/light/internet.svg</file>
<file>icons/light/games.svg</file>
<file>icons/light/office.svg</file>
<file>icons/light/development.svg</file>
Expand Down

0 comments on commit c277c16

Please sign in to comment.