Rename all symbols to new project name

This commit is contained in:
2021-06-12 14:59:58 +02:00
rodzic 6dff747afd
commit 418bc5e6f6
26 zmienionych plików z 90 dodań i 90 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
#include <QThread>
#include <QDebug>
#include "command.h"
#include "qssgeneralexception.h"
#include "looqsgeneralexception.h"

Wyświetl plik

@ -21,7 +21,7 @@ int CommandAdd::handle(QStringList arguments)
{
QCommandLineParser parser;
parser.addOptions({
{ { "c", "continue" }, "Continue adding files, don't exit on first error. If this option is not given, qss will exit asap, but it's possible that a few files will still be processed. "
{ { "c", "continue" }, "Continue adding files, don't exit on first error. If this option is not given, looqs will exit asap, but it's possible that a few files will still be processed. "
"Set -t 1 to avoid this behavior, but processing will be slower. "},
{ { "a", "all" }, "On error, no files should be added, even already processed ones" },
{ { "v", "verbose" }, "Print skipped and added files" },
@ -36,7 +36,7 @@ int CommandAdd::handle(QStringList arguments)
bool verbose = parser.isSet("verbose");
if(parser.isSet("all"))
{
throw QSSGeneralException("To be implemented");
throw LooqsGeneralException("To be implemented");
}
if(parser.isSet("threads"))
{

Wyświetl plik

@ -19,13 +19,13 @@ int CommandList::handle(QStringList arguments)
bool reverse = parser.isSet("reverse");
if(reverse)
{
throw QSSGeneralException("Reverse option to be implemented");
throw LooqsGeneralException("Reverse option to be implemented");
}
QStringList files = parser.positionalArguments();
QString queryStrings = files.join(' ');
auto results = dbService->search(QSSQuery::build(queryStrings));
auto results = dbService->search(LooqsQuery::build(queryStrings));
for(SearchResult &result : results)
{

Wyświetl plik

@ -16,7 +16,7 @@ int CommandSearch::handle(QStringList arguments)
QStringList files = parser.positionalArguments();
QString queryStrings = files.join(' ');
QSSQuery query = QSSQuery::build(queryStrings);
LooqsQuery query = LooqsQuery::build(queryStrings);
bool reverse = parser.isSet("reverse");
if(reverse)
{

Wyświetl plik

@ -15,7 +15,7 @@ int CommandUpdate::handle(QStringList arguments)
{ { "n", "dry-run"}, "Only print which files would be updated, don't actually update them"},
{ "pattern", "Only consider to update files in the index matching the pattern, e. g. */.git/*.", "pattern" },
{ { "d", "delete" }, "If a file does not exist anymore, delete it" },
{ { "c", "continue" }, "Continue adding files, don't exit on first error. If this option is not given, qss will exit asap, but it's possible that a few files will still be processed. "
{ { "c", "continue" }, "Continue adding files, don't exit on first error. If this option is not given, looqs will exit asap, but it's possible that a few files will still be processed. "
"Set -t 1 to avoid this behavior, but processing will be slower."},
{ { "a", "all" }, "On error, no files should be updated, even already processed ones" },
{ { "t", "threads" }, "Number of threads to use.", "threads" }
@ -34,7 +34,7 @@ int CommandUpdate::handle(QStringList arguments)
if(parser.isSet("all"))
{
throw QSSGeneralException("To be implemented");
throw LooqsGeneralException("To be implemented");
}
if(parser.isSet("threads"))
{

Wyświetl plik

@ -16,7 +16,7 @@ QSqlDatabase DatabaseFactory::createNew()
if(!db.open())
{
Logger::error() << "Failed to open the database: " << this->connectionString << endl;
throw QSSGeneralException("Failed to create open new connection");
throw LooqsGeneralException("Failed to create open new connection");
}
return db;
}
@ -32,7 +32,7 @@ QSqlDatabase DatabaseFactory::forCurrentThread()
if(!db.open())
{
Logger::error() << "Failed to open the database: " << this->connectionString << endl;
throw QSSGeneralException("Failed to create open new connection");
throw LooqsGeneralException("Failed to create open new connection");
}
dbStore.setLocalData(db);
return db;

Wyświetl plik

@ -1,6 +1,6 @@
#include <QDataStream>
#include "encodingdetector.h"
#include <qssgeneralexception.h>
#include <looqsgeneralexception.h>
EncodingDetector::EncodingDetector()
{
@ -13,7 +13,7 @@ QString EncodingDetector::detectEncoding(const QByteArray &data) const
if(uchardet_handle_data(detector, data.data(), data.size()) != 0 )
{
uchardet_delete(detector);
throw QSSGeneralException("Decoder failed");
throw LooqsGeneralException("Decoder failed");
}
uchardet_data_end(detector);
QString encoding = uchardet_get_charset(detector);
@ -33,13 +33,13 @@ QString EncodingDetector::detectEncoding(QDataStream &s) const
{
uchardet_delete(detector);
throw QSSGeneralException("Decoder failed");
throw LooqsGeneralException("Decoder failed");
}
}
if(n == -1)
{
uchardet_delete(detector);
throw QSSGeneralException("Read failed");
throw LooqsGeneralException("Read failed");
}
uchardet_data_end(detector);
QString encoding = uchardet_get_charset(detector);

Wyświetl plik

@ -131,7 +131,7 @@ SaveFileResult FileSaver::saveFile(const QFileInfo &fileInfo)
pageData = processor->process(Utils::readFile(absPath));
}
}
catch(QSSGeneralException &e)
catch(LooqsGeneralException &e)
{
Logger::error() << "Error while processing" << absPath << ":" << e.message << endl;
return PROCESSFAIL;

Wyświetl plik

@ -69,7 +69,7 @@ int main(int argc, char *argv[])
{
Common::ensureConfigured();
}
catch(QSSGeneralException &e)
catch(LooqsGeneralException &e)
{
Logger::error() << "Error: " << e.message;
return 1;
@ -86,7 +86,7 @@ int main(int argc, char *argv[])
{
return cmd->handle(args);
}
catch(const QSSGeneralException &e)
catch(const LooqsGeneralException &e)
{
Logger::error() << "Exception caught, message: " << e.message << endl;
}

Wyświetl plik

@ -6,7 +6,7 @@
QVector<PageData> OdtProcessor::process(const QByteArray &data) const
{
throw QSSGeneralException("Not implemented yet");
throw LooqsGeneralException("Not implemented yet");
}
QVector<PageData> OdtProcessor::process(QString path) const
@ -15,12 +15,12 @@ QVector<PageData> OdtProcessor::process(QString path) const
zipFile.setFileName("content.xml");
if(!zipFile.open(QIODevice::ReadOnly))
{
throw QSSGeneralException("Error while opening file " + path);
throw LooqsGeneralException("Error while opening file " + path);
}
QByteArray entireContent = zipFile.readAll();
if(entireContent.isEmpty())
{
throw QSSGeneralException("Error while reading content.xml of " + path);
throw LooqsGeneralException("Error while reading content.xml of " + path);
}
TagStripperProcessor tsp;
return tsp.process(entireContent);

Wyświetl plik

@ -13,11 +13,11 @@ QVector<PageData> PdfProcessor::process(const QByteArray &data) const
QScopedPointer<Poppler::Document> doc(Poppler::Document::loadFromData(data));
if(doc.isNull())
{
throw QSSGeneralException("Failed to process pdf data");
throw LooqsGeneralException("Failed to process pdf data");
}
if(doc->isLocked())
{
throw QSSGeneralException("Doc is locked");
throw LooqsGeneralException("Doc is locked");
}
QRectF entirePage;

Wyświetl plik

@ -11,7 +11,7 @@ bool SqliteDbService::fileExistsInDatabase(QString path, qint64 mtime)
query.addBindValue(path);
query.addBindValue(mtime);
if(!query.exec())
{ throw QSSGeneralException("Error while trying to query for file existance: " + query.lastError().text());
{ throw LooqsGeneralException("Error while trying to query for file existance: " + query.lastError().text());
}
if(!query.next())
{
@ -20,7 +20,7 @@ bool SqliteDbService::fileExistsInDatabase(QString path, qint64 mtime)
return query.value(0).toBool();
}
QVector<SearchResult> SqliteDbService::search(const QSSQuery &query)
QVector<SearchResult> SqliteDbService::search(const LooqsQuery &query)
{
auto connection = dbFactory->forCurrentThread();
SqliteSearch searcher(connection);
@ -33,7 +33,7 @@ bool SqliteDbService::fileExistsInDatabase(QString path)
query.prepare("SELECT 1 FROM file WHERE path = ?");
query.addBindValue(path);
if(!query.exec())
{ throw QSSGeneralException("Error while trying to query for file existance: " + query.lastError().text());
{ throw LooqsGeneralException("Error while trying to query for file existance: " + query.lastError().text());
}
if(!query.next())
{
@ -82,7 +82,7 @@ int SqliteDbService::getFiles(QVector<FileData> &results, QString wildCardPatter
query.setForwardOnly(true);
if(!query.exec())
{
throw QSSGeneralException("Error while trying to retrieve files from database: " + query.lastError().text());
throw LooqsGeneralException("Error while trying to retrieve files from database: " + query.lastError().text());
}
//TODO: port this to QRegularExpression once >5.12 gets more widespread because of this bug

Wyświetl plik

@ -26,7 +26,7 @@ public:
bool deleteFile(QString path);
bool fileExistsInDatabase(QString path);
bool fileExistsInDatabase(QString path, qint64 mtime);
QVector<SearchResult> search(const QSSQuery &query);
QVector<SearchResult> search(const LooqsQuery &query);
};

Wyświetl plik

@ -10,12 +10,12 @@ QByteArray Utils::readFile(QString path)
QFile file(path);
if(!file.open(QIODevice::ReadOnly))
{
throw QSSGeneralException("Failed to open file: " + path);
throw LooqsGeneralException("Failed to open file: " + path);
}
QByteArray data = file.readAll();
if(data.isEmpty() && file.error() != QFileDevice::FileError::NoError)
{
throw QSSGeneralException("Error reading file: " + path + ", Error: " + file.error());
throw LooqsGeneralException("Error reading file: " + path + ", Error: " + file.error());
}
return data;
}

Wyświetl plik

@ -5,7 +5,7 @@
#include <QByteArray>
#include <QTextStream>
#include <QDebug>
#include "qssgeneralexception.h"
#include "looqsgeneralexception.h"
class Utils
{