mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
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:
parent
9098e93767
commit
67eff75873
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue