mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
Format
This commit is contained in:
@ -280,7 +280,7 @@ Theme makeTheme(const QJsonObject &json)
|
||||
wn.contentTextColor = colorFromJson(w, "contentTextColor", wn.contentTextColor);
|
||||
wn.linkColor = colorFromJson(w, "linkColor", wn.linkColor);
|
||||
wn.closeButtonColor = colorFromJson(w, "closeButtonColor", wn.closeButtonColor);
|
||||
wn.headerDecorationColor = colorFromJson(w, "headerDecorationColor",wn.headerDecorationColor);
|
||||
wn.headerDecorationColor = colorFromJson(w, "headerDecorationColor", wn.headerDecorationColor);
|
||||
}
|
||||
|
||||
if (json.contains("shortcutsIcons")) {
|
||||
|
||||
@ -378,7 +378,7 @@ QVariant ComicModel::data(const QModelIndex &index, int role) const
|
||||
Qt::ItemFlags ComicModel::flags(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return {};
|
||||
return { };
|
||||
if (index.column() == ComicModel::Rating)
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled;
|
||||
|
||||
@ -434,7 +434,7 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const
|
||||
Qt::ItemFlags FolderModel::flags(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return {};
|
||||
return { };
|
||||
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled;
|
||||
}
|
||||
|
||||
@ -36,8 +36,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
Type _type {};
|
||||
std::string _lexeme {};
|
||||
Type _type { };
|
||||
std::string _lexeme { };
|
||||
};
|
||||
|
||||
class QueryLexer
|
||||
|
||||
@ -316,9 +316,9 @@ QueryParser::TreeNode QueryParser::expression()
|
||||
}
|
||||
auto right = token(true);
|
||||
|
||||
return TreeNode("expression", { TreeNode(toLower(left), {}), TreeNode(right, {}) }, expOperator);
|
||||
return TreeNode("expression", { TreeNode(toLower(left), { }), TreeNode(right, { }) }, expOperator);
|
||||
} else {
|
||||
return TreeNode("expression", { TreeNode("all", {}), TreeNode(left, {}) });
|
||||
return TreeNode("expression", { TreeNode("all", { }), TreeNode(left, { }) });
|
||||
}
|
||||
}
|
||||
|
||||
@ -328,12 +328,12 @@ QueryParser::TreeNode QueryParser::expression()
|
||||
QueryParser::TreeNode QueryParser::baseToken()
|
||||
{
|
||||
if (tokenType() == Token::Type::quotedWord) {
|
||||
return TreeNode("expression", { TreeNode("all", {}), TreeNode(token(true), {}) });
|
||||
return TreeNode("expression", { TreeNode("all", { }), TreeNode(token(true), { }) });
|
||||
}
|
||||
|
||||
if (tokenType() == Token::Type::word) {
|
||||
return TreeNode("expression", { TreeNode("all", {}), TreeNode(token(true), {}) });
|
||||
return TreeNode("expression", { TreeNode("all", { }), TreeNode(token(true), { }) });
|
||||
}
|
||||
|
||||
return TreeNode("expression", { TreeNode("all", {}), TreeNode(token(true), {}) });
|
||||
return TreeNode("expression", { TreeNode("all", { }), TreeNode(token(true), { }) });
|
||||
}
|
||||
|
||||
@ -101,11 +101,11 @@ QVariant ReadingListModel::data(const QModelIndex &index, int role) const
|
||||
Qt::ItemFlags ReadingListModel::flags(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return {};
|
||||
return { };
|
||||
|
||||
auto item = static_cast<ListItem *>(index.internalPointer());
|
||||
if (typeid(*item) == typeid(ReadingListSeparatorItem))
|
||||
return {};
|
||||
return { };
|
||||
|
||||
if (typeid(*item) == typeid(ReadingListItem) && static_cast<ReadingListItem *>(item)->parent->getId() != 0)
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled; // only sublists are dragable
|
||||
|
||||
@ -28,7 +28,7 @@ QString readSvg(const QString &resourcePath)
|
||||
QFile in(resourcePath);
|
||||
if (!in.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
qWarning() << "Failed to open SVG resource:" << resourcePath;
|
||||
return {};
|
||||
return { };
|
||||
}
|
||||
|
||||
QString svg = QString::fromUtf8(in.readAll());
|
||||
@ -53,7 +53,7 @@ QString writeSvg(const QString &svg, const QString &resourcePath, const QString
|
||||
QFile out(outPath);
|
||||
if (!out.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
|
||||
qWarning() << "Failed to write SVG:" << outPath;
|
||||
return {};
|
||||
return { };
|
||||
}
|
||||
|
||||
out.write(svg.toUtf8());
|
||||
|
||||
@ -14,23 +14,23 @@ struct RecolorOptions {
|
||||
};
|
||||
|
||||
QString readSvg(const QString &resourcePath);
|
||||
QString writeSvg(const QString &svg, const QString &resourcePath, const QString &themeName, const RecolorOptions &options = {});
|
||||
QString writeSvg(const QString &svg, const QString &resourcePath, const QString &themeName, const RecolorOptions &options = { });
|
||||
|
||||
QString recolorSvgXML(QString &svg, const QString &placeHolder, const QColor &color);
|
||||
QString recoloredSvgToThemeFile(const QString &resourcePath,
|
||||
const QColor &color, // #f0f (magenta)
|
||||
const QString &themeName,
|
||||
const RecolorOptions &options = {});
|
||||
const RecolorOptions &options = { });
|
||||
QString recoloredSvgToThemeFile(const QString &resourcePath,
|
||||
const QColor &color1, // #f0f (magenta)
|
||||
const QColor &color2, // #0ff (cyan)
|
||||
const QString &themeName,
|
||||
const RecolorOptions &options = {});
|
||||
const RecolorOptions &options = { });
|
||||
QString recoloredSvgToThemeFile(const QString &resourcePath,
|
||||
const QColor &color1, // #f0f (magenta)
|
||||
const QColor &color2, // #0ff (cyan)
|
||||
const QColor &color3, // #ff0 (yellow)
|
||||
const QString &themeName,
|
||||
const RecolorOptions &options = {});
|
||||
const RecolorOptions &options = { });
|
||||
|
||||
#endif // ICON_UTILS_H
|
||||
|
||||
@ -133,7 +133,7 @@ ThemeEditorDialog::ThemeEditorDialog(const QJsonObject ¶ms, QWidget *parent)
|
||||
tree->setUniformRowHeights(true);
|
||||
tree->setAlternatingRowColors(true);
|
||||
|
||||
populate(nullptr, params, {});
|
||||
populate(nullptr, params, { });
|
||||
tree->expandAll();
|
||||
|
||||
connect(expandBtn, &QPushButton::clicked, tree, &QTreeWidget::expandAll);
|
||||
@ -425,7 +425,7 @@ void ThemeEditorDialog::loadFromFile()
|
||||
params = doc.object();
|
||||
syncMetaFromParams();
|
||||
tree->clear();
|
||||
populate(nullptr, params, {});
|
||||
populate(nullptr, params, { });
|
||||
tree->expandAll();
|
||||
emit themeJsonChanged(params);
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ Theme ThemeManager::themeFromId(const QString &id, ThemeVariant fallbackVariant)
|
||||
return makeTheme(json);
|
||||
}
|
||||
|
||||
return {};
|
||||
return { };
|
||||
}
|
||||
|
||||
void ThemeManager::resolveTheme()
|
||||
|
||||
@ -50,7 +50,7 @@ QJsonObject ThemeRepository::loadThemeJson(const QString &themeId) const
|
||||
if (u.id == themeId)
|
||||
return readJsonFile(u.filePath);
|
||||
|
||||
return {};
|
||||
return { };
|
||||
}
|
||||
|
||||
QString ThemeRepository::saveUserTheme(QJsonObject themeJson)
|
||||
@ -104,7 +104,7 @@ QString ThemeRepository::importThemeFromFile(const QString &filePath)
|
||||
{
|
||||
QJsonObject json = readJsonFile(filePath);
|
||||
if (json.isEmpty())
|
||||
return {};
|
||||
return { };
|
||||
|
||||
// Force a new user id regardless of what the file contains
|
||||
auto metaObj = json["meta"].toObject();
|
||||
@ -189,13 +189,13 @@ QJsonObject ThemeRepository::readJsonFile(const QString &path)
|
||||
{
|
||||
QFile file(path);
|
||||
if (!file.open(QIODevice::ReadOnly))
|
||||
return {};
|
||||
return { };
|
||||
|
||||
const QByteArray data = file.readAll();
|
||||
QJsonParseError error;
|
||||
const QJsonDocument doc = QJsonDocument::fromJson(data, &error);
|
||||
if (error.error != QJsonParseError::NoError)
|
||||
return {};
|
||||
return { };
|
||||
|
||||
return doc.object();
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ QModelIndex ActionsShortcutsModel::index(int row, int column, const QModelIndex
|
||||
Qt::ItemFlags ActionsShortcutsModel::flags(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return {};
|
||||
return { };
|
||||
if (index.column() == KEYS)
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
||||
|
||||
@ -461,8 +461,8 @@ void ConcurrentQueueTest::singleUserThread_data()
|
||||
|
||||
using ms = chrono::milliseconds;
|
||||
|
||||
QTest::newRow("-") << 0 << JobDataSet {};
|
||||
QTest::newRow("0") << 7 << JobDataSet {};
|
||||
QTest::newRow("-") << 0 << JobDataSet { };
|
||||
QTest::newRow("0") << 7 << JobDataSet { };
|
||||
QTest::newRow("A") << 1 << JobDataSet { { 5, ms(0) } };
|
||||
QTest::newRow("B") << 5 << JobDataSet { { 12, ms(1) } };
|
||||
QTest::newRow("C") << 1 << JobDataSet { { 1, ms(0) }, { 5, ms(2) }, { 3, ms(1) } };
|
||||
@ -559,9 +559,9 @@ void ConcurrentQueueTest::cancelPending1UserThread_data()
|
||||
const auto ms = [](int count) -> Clock::duration { return chrono::milliseconds(count); };
|
||||
const auto us = [](int count) -> Clock::duration { return chrono::microseconds(count); };
|
||||
|
||||
QTest::newRow("-") << 0 << JobDataSet {} << ms(0);
|
||||
QTest::newRow("01") << 2 << JobDataSet {} << ms(0);
|
||||
QTest::newRow("02") << 3 << JobDataSet {} << ms(1);
|
||||
QTest::newRow("-") << 0 << JobDataSet { } << ms(0);
|
||||
QTest::newRow("01") << 2 << JobDataSet { } << ms(0);
|
||||
QTest::newRow("02") << 3 << JobDataSet { } << ms(1);
|
||||
QTest::newRow("A") << 1 << JobDataSet { { 5, ms(3) } } << ms(1);
|
||||
QTest::newRow("B") << 5 << JobDataSet { { 12, ms(1) } } << ms(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user