Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format codes for refs/heads/refactor-config #122

Open
wants to merge 4 commits into
base: refactor-config
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion makespec/BUILDVERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
139
140
2 changes: 1 addition & 1 deletion src/base/LemonApplicationInterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

#pragma once
//
#include <QString>
#include <QList>
#include <QObject>
#include <QString>

namespace Lemon {
struct LemonStartupArguments {
Expand Down
3 changes: 1 addition & 2 deletions src/base/LemonBaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@ auto LemonBaseApplication::parseCommandLine(bool *canContinue, QString *errorMes
return true;
}


#define ProcessExtraStartupOptions(option) \
DEBUG("Startup Options:" GEN_PAIR(parser.isSet(option##Option))); \
DEBUG("Startup Options:" GEN_PAIR(parser.isSet(option##Option))); \
StartupArguments.option = parser.isSet(option##Option);

ProcessExtraStartupOptions(debugLog);
Expand Down
22 changes: 11 additions & 11 deletions src/base/LemonBaseApplication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
#include "base/LemonApplicationInterface.hpp"

namespace Lemon {
class LemonBaseApplication : public SingleApplication, public LemonApplicationInterface {
Q_OBJECT
class LemonBaseApplication : public SingleApplication, public LemonApplicationInterface {
Q_OBJECT

public:
LemonBaseApplication(int &argc, char *argv[])
: SingleApplication(argc, argv, true, User | ExcludeAppPath | ExcludeAppVersion), LemonApplicationInterface(){};
virtual ~LemonBaseApplication(){};
public:
LemonBaseApplication(int &argc, char *argv[])
: SingleApplication(argc, argv, true, User | ExcludeAppPath | ExcludeAppVersion),
LemonApplicationInterface(){};
virtual ~LemonBaseApplication(){};

virtual bool Initialize() final;
virtual bool Initialize() final;

private:
bool parseCommandLine(bool *canContinue, QString *errorMessage);
};
private:
bool parseCommandLine(bool *canContinue, QString *errorMessage);
};
} // namespace Lemon

5 changes: 4 additions & 1 deletion src/base/LemonConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace Lemon::base::config {
int specialJudgeTimeLimit{};
int fileSizeLimit{};
int rejudgeTimes{};
double defaultExtraTimeRatio{};
QString defaultInputFileExtension;
QString defaultOutputFileExtension;
QStringList inputFileExtensions;
Expand All @@ -42,7 +43,9 @@ namespace Lemon::base::config {
private:
QString language = "en_US";
// Prepare for theme setting
// QString theme = ;
// TODO: Theme support
QString theme = "";

public:
int read(const QJsonObject &json);
void write(QJsonObject &json) const;
Expand Down
5 changes: 3 additions & 2 deletions src/base/LemonLog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <QTextStream>
#include <iostream>
//
#include <base/LemonMacro.hpp>
#include <base/LemonBaseApplication.hpp>
#include <base/LemonMacro.hpp>

#define NEWLINE "\r\n"
#define ___LOG_EXPAND(___x) , QPair<std::string, decltype(___x)>(std::string(#___x), [&] { return ___x; }())
Expand Down Expand Up @@ -56,7 +56,8 @@ namespace Lemon::base {
logStream << NEWLINE;
#ifndef QT_DEBUG
// We only process DEBUG log in Release mode
if (t == LEMON_LOG_DEBUG && LemonCoreApplication && !LemonCoreApplication->StartupArguments.debugLog) {
if (t == LEMON_LOG_DEBUG && LemonCoreApplication &&
! LemonCoreApplication->StartupArguments.debugLog) {
// Discard debug log in non-debug Lemon version with
// no-debugLog mode.
return;
Expand Down
1 change: 0 additions & 1 deletion src/base/LemonMacro.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*
*/


#pragma once

#define CONCATENATE1(arg1, arg2) CONCATENATE2(arg1, arg2)
Expand Down