mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
fixed write paths for YACReader
This commit is contained in:
parent
8255637028
commit
4c5f224d52
@ -7,6 +7,8 @@
|
|||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
#include "yacreader_global.h"
|
||||||
|
|
||||||
Configuration::Configuration()
|
Configuration::Configuration()
|
||||||
{
|
{
|
||||||
//read configuration
|
//read configuration
|
||||||
@ -77,7 +79,7 @@ void Configuration::load(const QString & path)
|
|||||||
alwaysOnTop = false;
|
alwaysOnTop = false;
|
||||||
|
|
||||||
//load from file
|
//load from file
|
||||||
QFile f(QCoreApplication::applicationDirPath()+path);
|
QFile f(YACReader::getSettingsPath()+path);
|
||||||
f.open(QIODevice::ReadOnly);
|
f.open(QIODevice::ReadOnly);
|
||||||
QTextStream txtS(&f);
|
QTextStream txtS(&f);
|
||||||
QString content = txtS.readAll();
|
QString content = txtS.readAll();
|
||||||
@ -158,61 +160,3 @@ void Configuration::load(const QString & path)
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::save()
|
|
||||||
{
|
|
||||||
QFile f(QCoreApplication::applicationDirPath()+"/YACReader.conf");
|
|
||||||
if(!f.open(QIODevice::WriteOnly))
|
|
||||||
{
|
|
||||||
QMessageBox::critical(NULL,tr("Saving config file...."),tr("There was a problem saving YACReader configuration. Please, check if you have enough permissions in the YACReader root folder."));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
QTextStream txtS(&f);
|
|
||||||
|
|
||||||
txtS << PATH << "\n";
|
|
||||||
txtS << defaultPath << "\n";
|
|
||||||
|
|
||||||
txtS << MAG_GLASS_SIZE << "\n";
|
|
||||||
txtS << magnifyingGlassSize.width() <<","<< magnifyingGlassSize.height() << "\n";
|
|
||||||
|
|
||||||
txtS << ZOOM_LEVEL << "\n";
|
|
||||||
txtS << zoomLevel << "\n";
|
|
||||||
|
|
||||||
txtS << SLIDE_SIZE << "\n";
|
|
||||||
txtS << gotoSlideSize.height() << "\n";
|
|
||||||
|
|
||||||
txtS << FIT << "\n";
|
|
||||||
txtS << (int)adjustToWidth << "\n";
|
|
||||||
|
|
||||||
txtS << FLOW_TYPE << "\n";
|
|
||||||
txtS << (int)flowType << "\n";
|
|
||||||
|
|
||||||
txtS << FULLSCREEN << "\n";
|
|
||||||
txtS << (int)fullScreen << "\n";
|
|
||||||
|
|
||||||
txtS << FIT_TO_WIDTH_RATIO << "\n";
|
|
||||||
txtS << fitToWidthRatio << "\n";
|
|
||||||
|
|
||||||
txtS << Y_WINDOW_POS << "\n";
|
|
||||||
txtS << windowPos.x() << "," << windowPos.y() << "\n";
|
|
||||||
|
|
||||||
txtS << Y_WINDOW_SIZE << "\n";
|
|
||||||
txtS << windowSize.width() << "," << windowSize.height() << "\n";
|
|
||||||
|
|
||||||
txtS << MAXIMIZED << "\n";
|
|
||||||
txtS << (int)maximized << "\n";
|
|
||||||
|
|
||||||
txtS << DOUBLE_PAGE << "\n";
|
|
||||||
txtS << (int)doublePage << "\n";
|
|
||||||
|
|
||||||
txtS << ADJUST_TO_FULL_SIZE << "\n";
|
|
||||||
txtS << (int) adjustToFullSize << "\n";
|
|
||||||
|
|
||||||
txtS << BACKGROUND_COLOR << "\n";
|
|
||||||
txtS << backgroundColor.red() << "," << backgroundColor.green() << "," << backgroundColor.blue() << "\n";
|
|
||||||
|
|
||||||
txtS << ALWAYS_ON_TOP << "\n";
|
|
||||||
txtS << (int)alwaysOnTop << "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -89,9 +89,6 @@ using namespace YACReader;
|
|||||||
void setLastVersionCheck(const QDate & date){ settings->setValue(LAST_VERSION_CHECK,date);}
|
void setLastVersionCheck(const QDate & date){ settings->setValue(LAST_VERSION_CHECK,date);}
|
||||||
int getNumDaysBetweenVersionChecks() {return settings->value(NUM_DAYS_BETWEEN_VERSION_CHECKS,1).toInt();}
|
int getNumDaysBetweenVersionChecks() {return settings->value(NUM_DAYS_BETWEEN_VERSION_CHECKS,1).toInt();}
|
||||||
void setNumDaysBetweenVersionChecks(int days) {return settings->setValue(NUM_DAYS_BETWEEN_VERSION_CHECKS,days);}
|
void setNumDaysBetweenVersionChecks(int days) {return settings->setValue(NUM_DAYS_BETWEEN_VERSION_CHECKS,days);}
|
||||||
|
|
||||||
void save();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -43,7 +43,7 @@ int main(int argc, char * argv[])
|
|||||||
|
|
||||||
int ret = app.exec();
|
int ret = app.exec();
|
||||||
|
|
||||||
Configuration::getConfiguration().save();
|
//Configuration::getConfiguration().save();
|
||||||
|
|
||||||
YACReader::exitCheck(ret);
|
YACReader::exitCheck(ret);
|
||||||
|
|
||||||
|
@ -1008,7 +1008,7 @@ void MainWindowViewer::getSiblingComics(QString path,QString currentComic)
|
|||||||
int index = list.indexOf(currentComic);
|
int index = list.indexOf(currentComic);
|
||||||
if(index == -1) //comic not found
|
if(index == -1) //comic not found
|
||||||
{
|
{
|
||||||
QFile f(QCoreApplication::applicationDirPath()+"/errorLog.txt");
|
/*QFile f(QCoreApplication::applicationDirPath()+"/errorLog.txt");
|
||||||
if(!f.open(QIODevice::WriteOnly))
|
if(!f.open(QIODevice::WriteOnly))
|
||||||
{
|
{
|
||||||
QMessageBox::critical(NULL,tr("Saving error log file...."),tr("There was a problem saving YACReader error log file. Please, check if you have enough permissions in the YACReader root folder."));
|
QMessageBox::critical(NULL,tr("Saving error log file...."),tr("There was a problem saving YACReader error log file. Please, check if you have enough permissions in the YACReader root folder."));
|
||||||
@ -1025,7 +1025,7 @@ void MainWindowViewer::getSiblingComics(QString path,QString currentComic)
|
|||||||
txtS << s << '\n';
|
txtS << s << '\n';
|
||||||
}
|
}
|
||||||
f.close();
|
f.close();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
previousComicPath = nextComicPath = "";
|
previousComicPath = nextComicPath = "";
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
|
#include "yacreader_global.h"
|
||||||
|
|
||||||
Bookmarks::Bookmarks()
|
Bookmarks::Bookmarks()
|
||||||
:lastPageIndex(0)
|
:lastPageIndex(0)
|
||||||
{
|
{
|
||||||
@ -123,7 +125,7 @@ void Bookmarks::save()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void BookmarksList::load()
|
void BookmarksList::load()
|
||||||
{
|
{
|
||||||
QFile f(QCoreApplication::applicationDirPath()+"/bookmarks.yacr");
|
QFile f(YACReader::getSettingsPath()+"/bookmarks.yacr");
|
||||||
if(f.open(QIODevice::ReadOnly))
|
if(f.open(QIODevice::ReadOnly))
|
||||||
{
|
{
|
||||||
QDataStream dataS(&f);
|
QDataStream dataS(&f);
|
||||||
@ -134,7 +136,7 @@ void BookmarksList::load()
|
|||||||
|
|
||||||
void BookmarksList::save()
|
void BookmarksList::save()
|
||||||
{
|
{
|
||||||
QFile f(QCoreApplication::applicationDirPath()+"/bookmarks.yacr");
|
QFile f(YACReader::getSettingsPath()+"/bookmarks.yacr");
|
||||||
f.open(QIODevice::WriteOnly);
|
f.open(QIODevice::WriteOnly);
|
||||||
QDataStream dataS(&f);
|
QDataStream dataS(&f);
|
||||||
if(list.count()>numMaxBookmarks)
|
if(list.count()>numMaxBookmarks)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user