Upgrade to Qt 6.10.3, refactor AppState for LibraryModel integration, add ChunkMeasurer tests, and update CI/docker configurations.
This commit is contained in:
53 files changed
+2095
-880
No files matched your search
@@ -1,6 +1,5 @@
|
||||
#include "TxtReader.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QRegularExpression>
|
||||
#include <QTextStream>
|
||||
@@ -127,6 +126,7 @@ bool TxtReader::open(const QString &filePath)
|
||||
uchardet_delete(ud);
|
||||
if (!m_content.isEmpty()) {
|
||||
m_title = QFileInfo(filePath).completeBaseName();
|
||||
m_filePath = filePath;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -136,6 +136,21 @@ bool TxtReader::open(const QString &filePath)
|
||||
// Default: UTF-8
|
||||
m_content = QString::fromUtf8(raw);
|
||||
m_title = QFileInfo(filePath).completeBaseName();
|
||||
m_filePath = filePath;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TxtReader::loadMetadata(const QString &filePath)
|
||||
{
|
||||
QFile file(filePath);
|
||||
if (!file.exists()) {
|
||||
m_error = QStringLiteral("File not found: ") + filePath;
|
||||
return false;
|
||||
}
|
||||
|
||||
// For TXT files, we only need the filename for title
|
||||
m_title = QFileInfo(filePath).completeBaseName();
|
||||
m_author.clear(); // No author info in plain text files
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -172,6 +187,11 @@ QList<TocEntry> TxtReader::tableOfContents()
|
||||
return {};
|
||||
}
|
||||
|
||||
QString TxtReader::filePath()
|
||||
{
|
||||
return m_filePath;
|
||||
}
|
||||
|
||||
QString TxtReader::title()
|
||||
{
|
||||
return m_title;
|
||||
@@ -181,3 +201,8 @@ QString TxtReader::author()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
QString TxtReader::coverImagePath()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
Reference in new issue
Block a user