Reduce memory usage

pull/16/head
reionwong 5 years ago
parent 1219ee312e
commit 6436f0dad9

@ -127,6 +127,8 @@ Item {
cache: false
smooth: true
visible: backend.type === 0
onSourceChanged: launcher.clearPixmapCache()
}
FastBlur {

@ -24,6 +24,7 @@
#include <QApplication>
#include <QDBusConnection>
#include <QDBusServiceWatcher>
#include <QPixmapCache>
#include <QQmlContext>
#include <QScreen>
#include <QTimer>
@ -143,6 +144,11 @@ bool Launcher::isPinedDock(const QString &desktop)
return iface.call("pinned", desktop).arguments().first().toBool();
}
void Launcher::clearPixmapCache()
{
QPixmapCache::clear();
}
QRect Launcher::screenRect()
{
return m_screenRect;

@ -51,6 +51,8 @@ public:
Q_INVOKABLE bool dockAvailable();
Q_INVOKABLE bool isPinedDock(const QString &desktop);
Q_INVOKABLE void clearPixmapCache();
QRect screenRect();
signals:

@ -55,7 +55,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
app.setApplicationName(QStringLiteral("cutefish-launcher"));
// QPixmapCache::setCacheLimit(1024 * 10);
QPixmapCache::setCacheLimit(2048);
QCommandLineParser parser;
QCommandLineOption showOption(QStringLiteral("show"), "Show Launcher");

Loading…
Cancel
Save