#include "GuiApplication.h"
#include "qt_helpers.h"
-#include "QLImage.h"
+#include "GuiImage.h"
#include "socket_callback.h"
#include "frontends/LyXView.h"
#include "support/os.h"
#include "support/Package.h"
+#include "BufferList.h"
#include "BufferView.h"
#include "Color.h"
#include "debug.h"
#include <QFileOpenEvent>
#include <QLocale>
#include <QLibraryInfo>
+#include <QPixmapCache>
+#include <QSessionManager>
#include <QTextCodec>
#include <QTimer>
#include <QTranslator>
using namespace lyx::graphics;
- Image::newImage = boost::bind(&QLImage::newImage);
- Image::loadableFormats = boost::bind(&QLImage::loadableFormats);
+ Image::newImage = boost::bind(&GuiImage::newImage);
+ Image::loadableFormats = boost::bind(&GuiImage::loadableFormats);
// needs to be done before reading lyxrc
lyxrc.dpi = getDPI();
LoaderQueue::setPriority(10,100);
guiApp = this;
+
+ // Set the cache to 5120 kilobytes which corresponds to screen size of
+ // 1280 by 1024 pixels with a color depth of 32 bits.
+ QPixmapCache::setCacheLimit(5120);
}
socket_callbacks_.erase(fd);
}
+
+void GuiApplication::commitData(QSessionManager & sm)
+{
+ /// The implementation is required to avoid an application exit
+ /// when session state save is triggered by session manager.
+ /// The default implementation sends a close event to all
+ /// visible top level widgets when session managment allows
+ /// interaction.
+ /// We are changing that to write all unsaved buffers...
+ if (sm.allowsInteraction() && !theBufferList().quitWriteAll())
+ sm.cancel();
+}
+
+
////////////////////////////////////////////////////////////////////////
// X11 specific stuff goes here...
#ifdef Q_WS_X11