Skip to content

Commit

Permalink
Drop support for fuzzy config
Browse files Browse the repository at this point in the history
Always assume config is correct
  • Loading branch information
mhtvsSFrpHdE committed Aug 31, 2022
1 parent fec0bc7 commit 87a783a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 31 deletions.
6 changes: 1 addition & 5 deletions qpp/prefetch/Source/Core/read_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@ void ReadFile::run()

// Get prefetch interval
auto getPrefetchInterval = Setting::getUnsignedLong("Thread", "PrefetchInterval", Setting::setting);
unsigned long prefetchIntervalInSecond = 60;
if (getPrefetchInterval.success && getPrefetchInterval.result > 0)
{
prefetchIntervalInSecond = getPrefetchInterval.result;
}
unsigned long prefetchIntervalInSecond = getPrefetchInterval.result;

// Get read thread priority
auto getReadThreadPriority = Setting::getString("Thread", "ReadThreadPriority", Setting::setting);
Expand Down
18 changes: 2 additions & 16 deletions qpp/prefetch/Source/Interface/Dpi/dpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,15 @@ void Dpi::init()
{
// Zoom level
auto getZoomLevel = Setting::getInt("Instance", "ZoomLevel", Setting::setting);
if (getZoomLevel.success)
{
zoomLevel = getZoomLevel.result;
}
else
{
zoomLevel = 100;
}
zoomLevel = getZoomLevel.result;

// Ratio
dpiMultiplier = zoomLevel / percentage;
pointToPixelMultiplier = assumeQtPointEachInch / assumeOsPointEachInch;

// Font size
auto getFontSize = Setting::getInt("Instance", "FontSize", Setting::setting);
if (getFontSize.success)
{
defaultFontSize_point = getFontSize.result;
}
else
{
defaultFontSize_point = 10;
}
defaultFontSize_point = getFontSize.result;
defaultFontSize_pixel = ptToPx(defaultFontSize_point);
}

Expand Down
9 changes: 1 addition & 8 deletions qpp/prefetch/Source/Interface/MainWindow/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent),

// Log size limit to prevent memory leak
auto getMaximumBlockCount = Setting::getInt("Instance", "MaximumBlockCount", Setting::setting);
if (getMaximumBlockCount.success)
{
ui->stdOut_plainTextEdit->setMaximumBlockCount(getMaximumBlockCount.result);
}
else
{
ui->stdOut_plainTextEdit->setMaximumBlockCount(defaultMaximumBlockCount);
}
ui->stdOut_plainTextEdit->setMaximumBlockCount(getMaximumBlockCount.result);

// Event

Expand Down
2 changes: 1 addition & 1 deletion qpp/prefetch/Source/Interface/MainWindow/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public slots:

bool startToTray;
bool minimizeToTray;
const int defaultMaximumBlockCount = 50;
int printOffset;

// Handle application close event
void closeEvent(QCloseEvent *closeEventAddress) override;
Expand Down
3 changes: 2 additions & 1 deletion qpp/prefetch/prefetch.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Firefox=explorer Firefox.lnk

[Thread]
MaxThreadCount=0
RescanInterval=0
RescanInterval=60
PrefetchInterval=90
ReadThreadPriority=LowestPriority

Expand All @@ -27,4 +27,5 @@ MinimizeToTray=true
MaximumBlockCount=100
Font=<default>
FontSize=10
PrintOffset=2
ZoomLevel=100

0 comments on commit 87a783a

Please sign in to comment.