diff options
author | joe berner <stackyjoe@gmail.com> | 2018-12-18 10:59:15 -0600 |
---|---|---|
committer | joe berner <stackyjoe@gmail.com> | 2018-12-18 10:59:15 -0600 |
commit | e42bc7e16e6d9f813b5c712261dffbef6b1bddb2 (patch) | |
tree | 0c9e39d7e3f425691f854288a733b8d56c5f6ed3 /src-qt5/desktop-utils/lumina-pdf/main.cpp | |
parent | Merge pull request #640 from lumina-desktop/q5sys-patch-1 (diff) | |
download | lumina-e42bc7e16e6d9f813b5c712261dffbef6b1bddb2.tar.gz lumina-e42bc7e16e6d9f813b5c712261dffbef6b1bddb2.tar.bz2 lumina-e42bc7e16e6d9f813b5c712261dffbef6b1bddb2.zip |
Changes the UI interface so that only the current page is rendered on screen at a time. This has significant memory benefits for large PDF files. This also implements a least-recently used cache of tunable size, which improves responsiveness if you're hopping between two specific pages.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf/main.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-pdf/main.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/main.cpp b/src-qt5/desktop-utils/lumina-pdf/main.cpp index f0430fc8..5e2ed0a9 100644 --- a/src-qt5/desktop-utils/lumina-pdf/main.cpp +++ b/src-qt5/desktop-utils/lumina-pdf/main.cpp @@ -1,28 +1,31 @@ -#include <QTranslator> #include <QApplication> #include <QDebug> #include <QFile> +#include <QTranslator> #include "mainUI.h" #include <LUtils.h> //#include <LuminaThemes.h> -int main(int argc, char ** argv) -{ - //LTHEME::LoadCustomEnvSettings(); - unsetenv("QT_AUTO_SCREEN_SCALE_FACTOR"); //need pixel-perfect geometries +int main(int argc, char **argv) { + // LTHEME::LoadCustomEnvSettings(); + unsetenv("QT_AUTO_SCREEN_SCALE_FACTOR"); // need pixel-perfect geometries QApplication a(argc, argv); LUtils::LoadTranslation(&a, "l-pdf"); - //Read the input variables + // Read the input variables QString path = ""; - for(int i=1; i<argc; i++){ - path = LUtils::PathToAbsolute( argv[i] ); - if(QFile::exists(path)){ break; } //already found a valid file + for (int i = 1; i < argc; i++) { + path = LUtils::PathToAbsolute(argv[i]); + if (QFile::exists(path)) { + break; + } // already found a valid file } MainUI w; - if(!path.isEmpty()){ w.loadFile(path); } + if (!path.isEmpty()) { + w.loadFile(path); + } w.show(); int retCode = a.exec(); return retCode; |