mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
Expose QPixmapCache's cache limit size as an user preference
This commit is contained in:
parent
776d809f2f
commit
b96104bed4
6 changed files with 42 additions and 5 deletions
|
|
@ -361,7 +361,8 @@ void MainWindow::createMenus()
|
|||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent), localServer(0), bHasActivated(false)
|
||||
{
|
||||
QPixmapCache::setCacheLimit(200000);
|
||||
connect(settingsCache, SIGNAL(pixmapCacheSizeChanged(int)), this, SLOT(pixmapCacheSizeChanged(int)));
|
||||
pixmapCacheSizeChanged(settingsCache->getPixmapCacheSize());
|
||||
|
||||
client = new RemoteClient;
|
||||
connect(client, SIGNAL(connectionClosedEventReceived(const Event_ConnectionClosed &)), this, SLOT(processConnectionClosedEvent(const Event_ConnectionClosed &)));
|
||||
|
|
@ -430,3 +431,10 @@ void MainWindow::changeEvent(QEvent *event)
|
|||
|
||||
QMainWindow::changeEvent(event);
|
||||
}
|
||||
|
||||
void MainWindow::pixmapCacheSizeChanged(int value)
|
||||
{
|
||||
//qDebug() << "Setting pixmap cache size to " << value << " MBs";
|
||||
// translate MBs to KBs
|
||||
QPixmapCache::setCacheLimit(value * 1024);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue