Commit afcb0a6a authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Cache data: show warning when it exceeds 1Gb

parent a6c29d95
Pipeline #238275 passed with stage
in 10 minutes and 49 seconds
......@@ -175,6 +175,9 @@ TemporaryData::TemporaryData(KdenliveDoc *doc, bool currentProjectOnly, QWidget
"files used for faster editing. Deleting is safe, proxy clips can be recreated if you have the original source clips."));
connect(help_cached, &QToolButton::clicked, this, [this]() { QToolTip::showText(QCursor::pos(), help_cached->toolTip()); });
// Cache info message
cache_info->hide();
processBackupDirectories();
connect(listWidget, &QTreeWidget::itemSelectionChanged, this, &TemporaryData::refreshGlobalPie);
......@@ -622,6 +625,14 @@ void TemporaryData::gotFolderSize(KJob *job)
listWidget->resizeColumnToContents(0);
listWidget->resizeColumnToContents(1);
if (m_globalDirectories.isEmpty()) {
// Processing done, check total size
if (m_totalGlobal > 1048576000) {
// Cache larger than 1 GB, warn
cache_info->setText(i18n("Your cached data exceeds 1Gb, cleanup is recommended."));
cache_info->animatedShow();
} else {
cache_info->animatedHide();
}
gTotalSize->setText(KIO::convertSize(m_totalGlobal));
listWidget->setCurrentItem(listWidget->topLevelItem(0));
} else {
......
......@@ -656,6 +656,16 @@
</item>
</layout>
</item>
<item>
<widget class="KMessageWidget" name="cache_info">
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="messageType">
<enum>KMessageWidget::Warning</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
......@@ -672,6 +682,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KMessageWidget</class>
<extends>QFrame</extends>
<header>kmessagewidget.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment