From 6bf9bfcf7b5ddbab8d00e97d599d1133bcccef5a Mon Sep 17 00:00:00 2001 From: Felix Kauselmann <2039670+selmf@users.noreply.github.com> Date: Sun, 2 Nov 2014 17:26:46 +0100 Subject: [PATCH] Remove old unused configuration parser code. (or a part of it) --- YACReader/configuration.cpp | 116 +----------------------------------- 1 file changed, 1 insertion(+), 115 deletions(-) diff --git a/YACReader/configuration.cpp b/YACReader/configuration.cpp index 69b3ffe6..13e7a9b2 100644 --- a/YACReader/configuration.cpp +++ b/YACReader/configuration.cpp @@ -55,118 +55,4 @@ void Configuration::load(QSettings * settings) settings->setValue(ALWAYS_ON_TOP,false); if(!settings->contains(SHOW_TOOLBARS)) settings->setValue(SHOW_TOOLBARS, true); -} - -void Configuration::load(const QString & path) -{ - //load default configuration - defaultPath = "."; - magnifyingGlassSize = QSize(350,175); - gotoSlideSize = QSize(126,200); //normal - //gotoSlideSize = QSize(79,125); //small - //gotoSlideSize = QSize(173,275); //big - //gotoSlideSize = QSize(220,350); //huge - zoomLevel = 0.5; - adjustToWidth = true; - flowType = Strip; - fullScreen = false; - fitToWidthRatio = 1; - windowSize = QSize(0,0); - maximized = false; - doublePage = false; - doubleMangaPage = false; - adjustToFullSize = false; - backgroundColor = QColor(40,40,40); - alwaysOnTop = false; - - //load from file - QFile f(YACReader::getSettingsPath()+path); - f.open(QIODevice::ReadOnly); - QTextStream txtS(&f); - QString content = txtS.readAll(); - QStringList lines = content.split('\n'); - QString line,name; - int i=0; - foreach(line,lines) - { - if((i%2)==0) - { - name = line.trimmed(); - } - else - { - if(name==PATH) - { - defaultPath = line.trimmed(); - } - if(name==MAG_GLASS_SIZE) - { - QStringList values = line.split(','); - magnifyingGlassSize = QSize(values[0].toInt(),values[1].toInt()); - } - if(name==ZOOM_LEVEL) - { - zoomLevel = line.toFloat(); - } - if(name==SLIDE_SIZE) - { - int height = line.toInt(); - gotoSlideSize = QSize(static_cast(height/SLIDE_ASPECT_RATIO),height); - } - if(name==FIT) - { - adjustToWidth = line.toInt(); - } - if(name==FLOW_TYPE) - { - flowType = (FlowType)line.toInt(); - } - if(name==FULLSCREEN) - { - fullScreen = line.toInt(); - } - if(name==FIT_TO_WIDTH_RATIO) - { - fitToWidthRatio = line.toFloat(); - } - if(name==Y_WINDOW_POS) - { - QStringList l = line.split(','); - windowPos = QPoint(l[0].toInt(),l[1].toInt()); - } - if(name==Y_WINDOW_SIZE) - { - QStringList l = line.split(','); - windowSize = QSize(l[0].toInt(),l[1].toInt()); - } - if(name==MAXIMIZED) - { - maximized = line.toInt(); - } - if(name==DOUBLE_PAGE) - { - doublePage = line.toInt(); - } - if(name==DOUBLE_MANGA_PAGE) - { - doubleMangaPage = line.toInt(); - } - if(name==ADJUST_TO_FULL_SIZE) - { - adjustToFullSize = line.toInt(); - } - if(name==BACKGROUND_COLOR) - { - QStringList l = line.split(','); - backgroundColor = QColor(l[0].toInt(),l[1].toInt(),l[2].toInt()); - } - if(name==ALWAYS_ON_TOP) - { - alwaysOnTop = line.toInt(); - } - - - } - i++; - } -} +} \ No newline at end of file