Skip to content

Commit

Permalink
refactor: change setting dir
Browse files Browse the repository at this point in the history
  • Loading branch information
CoelacanthusHex committed Aug 13, 2020
1 parent 635228f commit 85c2cab
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/addtestcaseswizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
* addtestcasewizard.cpp @Project Lemon+
* Update 2018 Dust1404
**/
/**
* addtestcasewizard.cpp @Project LemonLime
* Update 2020 Coelacanthus
**/

#include "addtestcaseswizard.h"
#include "settings.h"
Expand Down
4 changes: 4 additions & 0 deletions src/assignmentthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
* assignmentthread.cpp @Project LemonLime
* Update 2019 iotang
**/
/**
* assignmentthread.cpp @Project LemonLime
* Update 2020 Coelacanthus
**/

#include "assignmentthread.h"
#include "globaltype.h"
Expand Down
4 changes: 4 additions & 0 deletions src/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
* compiler.cpp @Project Lemon+
* Update 2018 Dust1404
**/
/**
* compiler.cpp @Project LemonLime
* Update 2020 Coelacanthus
**/

#include "compiler.h"

Expand Down
4 changes: 4 additions & 0 deletions src/contest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
* contest.cpp @Project LemonLime
* Update 2019 iotang
**/
/**
* contest.cpp @Project LemonLime
* Update 2020 Coelacanthus
**/

#include "contest.h"
#include "assignmentthread.h"
Expand Down
4 changes: 4 additions & 0 deletions src/contestant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
* contestant.cpp @Project Lemon+
* Update 2018 Dust1404
**/
/**
* contestant.cpp @Project LemonLime
* Update 2020 Coelacanthus
**/

#include "contestant.h"

Expand Down
6 changes: 5 additions & 1 deletion src/exportutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
* exportutil.cpp @Project LemonLime
* Update 2019 iotang
**/
/**
* exportutil.cpp @Project LemonLime
* Update 2020 Coelacanthus
**/

#include "exportutil.h"
#include "contest.h"
Expand Down Expand Up @@ -1031,7 +1035,7 @@ void ExportUtil::exportResult(QWidget *widget, Contest *contest)

if (fileName.isEmpty())
return;

// TODO: refactor
if (QFileInfo(fileName).suffix() == "html")
{
QMessageBox::StandardButton res =
Expand Down
5 changes: 5 additions & 0 deletions src/exttestcasemodifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
***************************************************************************/

/**
* exttestcasemodifier.cpp @Project LemonLime
* Update 2020 Coelacanthus
**/

#include "exttestcasemodifier.h"
#include "exttestcaseupdaterdialog.h"
#include "task.h"
Expand Down
5 changes: 5 additions & 0 deletions src/exttestcasetable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
***************************************************************************/

/**
* exttestcasetable.cpp @Project LemonLime
* Update 2020 Coelacanthus
**/

#include "exttestcasetable.h"
#include "task.h"
#include "testcase.h"
Expand Down
5 changes: 5 additions & 0 deletions src/exttestcaseupdaterdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
***************************************************************************/

/**
* exttestcaseupdaterdialog.cpp @Project LemonLime
* Update 2020 Coelacanthus
**/

#include "exttestcaseupdaterdialog.h"
#include "settings.h"
#include "task.h"
Expand Down
1 change: 1 addition & 0 deletions src/judgingthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,7 @@ void JudgingThread::runProgram()
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
#else
// TODO: rewrite with cgroup
QFile::copy(":/watcher/watcher_unix", workingDirectory + "watcher");
QProcess::execute(QString("chmod"), (QStringList("+wx") << QString(workingDirectory + "watcher")));
auto *runner = new QProcess(this);
Expand Down
12 changes: 6 additions & 6 deletions src/lemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
* lemon.cpp @Project LemonLime
* Update 2019 iotang
**/
/**
* lemon.cpp @Project LemonLime
* Update 2020 Coelacanthus
**/

#include "lemon.h"
#include "addcompilerwizard.h"
Expand Down Expand Up @@ -106,9 +110,7 @@ Lemon::Lemon(QWidget *parent) : QMainWindow(parent), ui(new Ui::Lemon)
connect(ui->exitAction, SIGNAL(triggered()), this, SLOT(close()));

appTranslator = new QTranslator(this);
qtTranslator = new QTranslator(this);
QApplication::installTranslator(appTranslator);
QApplication::installTranslator(qtTranslator);
QStringList fileList = QDir(":/translation").entryList(QStringList() << "lemon_*.qm", QDir::Files);

for (int i = 0; i < fileList.size(); i++)
Expand All @@ -128,7 +130,7 @@ Lemon::Lemon(QWidget *parent) : QMainWindow(parent), ui(new Ui::Lemon)
ui->setEnglishAction->setCheckable(true);
connect(ui->setEnglishAction, SIGNAL(triggered()), this, SLOT(setUiLanguage()));
loadUiLanguage();
QSettings settings("Crash", "Lemon");
QSettings settings("LemonLime", "lemon");
QSize _size = settings.value("WindowSize", size()).toSize();
resize(_size);
}
Expand All @@ -155,7 +157,7 @@ void Lemon::closeEvent(QCloseEvent *event)
saveContest(curFile);

settings->saveSettings();
QSettings settings("Crash", "Lemon");
QSettings settings("LemonLime", "lemon");
settings.setValue("WindowSize", size());
}

Expand Down Expand Up @@ -217,14 +219,12 @@ void Lemon::loadUiLanguage()
{
languageAction->setChecked(true);
appTranslator->load(QString(":/translation/lemon_%1.qm").arg(settings->getUiLanguage()));
qtTranslator->load(QString(":/translation/qt_%1.qm").arg(settings->getUiLanguage()));
return;
}
}

settings->setUiLanguage("en");
appTranslator->load("");
qtTranslator->load("");
ui->setEnglishAction->setChecked(true);
}

Expand Down
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
* main.cpp @Project LemonLime
* Update 2019 iotang
**/
/**
* main.cpp @Project LemonLime
* Update 2020 Coelacanthus
**/

#include "lemon.h"
#include <QApplication>
Expand Down
8 changes: 6 additions & 2 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
* settings.cpp @Project LemonLime
* Update 2019 iotang
**/
/**
* settings.cpp @Project LemonLime
* Update 2020 Coelacanthus
**/

#include "settings.h"
#include "compiler.h"
Expand Down Expand Up @@ -487,7 +491,7 @@ void Settings::copyFrom(Settings *other)

void Settings::saveSettings()
{
QSettings settings("Crash", "Lemon");
QSettings settings("LemonLime", "lemon");
settings.setValue("UiLanguage", uiLanguage);
settings.beginGroup("GeneralSettings");
settings.setValue("DefaultFullScore", defaultFullScore);
Expand Down Expand Up @@ -573,7 +577,7 @@ void Settings::loadSettings()

compilerList.clear();
recentContest.clear();
QSettings settings("Crash", "Lemon");
QSettings settings("LemonLime", "lemon");
uiLanguage = settings.value("UiLanguage", QLocale::system().name()).toString();
settings.beginGroup("GeneralSettings");
defaultFullScore = settings.value("DefaultFullScore", 10).toInt();
Expand Down

0 comments on commit 85c2cab

Please sign in to comment.