feat: add "clear cache" button to settings (#3277)

Co-authored-by: Leon Richardt <leon.richardt@gmail.com>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
James Upjohn 2021-11-07 01:00:27 +13:00 committed by GitHub
parent 9098e93767
commit 67eff75873
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -24,6 +24,7 @@
- Minor: Added chatter count to viewer list popout (#3261)
- Minor: Added highlights for first messages (#3267)
- Minor: Ignore out of bounds check for tiling wms (#3270)
- Minor: Add clear cache button to cache settings section (#3277)
- Minor: Added `flags.first_message` filter variable (#3292)
- Minor: Removed duplicate setting for toggling `Channel Point Redeemed Message` highlights (#3296)
- Minor: Clean up chat messages of special line characters prior to sending. (#3312)

View file

@ -503,6 +503,20 @@ void GeneralPage::initLayout(GeneralPageView &layout)
box->addWidget(layout.makeButton("Reset", []() {
getSettings()->cachePath = "";
}));
box->addWidget(layout.makeButton("Clear Cache", [&layout]() {
auto reply = QMessageBox::question(
layout.window(), "Clear cache",
"Are you sure that you want to clear your cache? Emotes may "
"take longer to load next time Chatterino is started.",
QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::Yes)
{
auto cacheDir = QDir(getPaths()->cacheDirectory());
cacheDir.removeRecursively();
cacheDir.mkdir(getPaths()->cacheDirectory());
}
}));
box->addStretch(1);
layout.addLayout(box);