Skip to content

Commit

Permalink
Move startup item code to command
Browse files Browse the repository at this point in the history
  • Loading branch information
mhtvsSFrpHdE committed Feb 16, 2023
1 parent bbd1e60 commit 7502280
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
16 changes: 3 additions & 13 deletions qpp/prefetch/Source/Core/Startup/startup.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#include <QProcess>

#include "startup.h"
#include "..\..\Setting\setting.h"
#include "..\..\Setting\const_setting.h"
#include "..\..\Output\stdout.h"
#include "..\const_core.h"
#include "..\StartProcess\start_process.h"
#include "..\..\Global\global.h"
#include "..\..\Input\const_input.h"

#define gn Const_Setting::ConfigGroupName

Expand Down Expand Up @@ -34,14 +32,6 @@ void Core_Startup::_startOnce()
// Disable after fist run
startOnce_remove();

// Get startup items
auto startupItem = Setting::getArrayValue(gn::StartupItem, Setting::setting);
for (int i = 0; i < startupItem.size(); ++i)
{
auto fileName = startupItem[i];
Core_StartProcess::startProcess(fileName);
}

using namespace Const_Core::Message;
StdOut::printLine(RunStartupItems);
using namespace Const_Input;
Global::inputLoopThreadAddress->receiveText(Command_Level1::startup);
}
21 changes: 21 additions & 0 deletions qpp/prefetch/Source/Input/Thread/Command/Level1/startup.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "parent_define.h"
#include "..\..\..\..\Setting\setting.h"
#include "..\..\..\..\Setting\const_setting.h"
#include "..\..\..\..\Core\StartProcess\start_process.h"
#include "..\..\..\..\Output\stdout.h"
#include "..\..\..\..\Core\const_core.h"

#define gn Const_Setting::ConfigGroupName

void Parent_Prefetch::startup()
{
// Get startup items
auto startupItem = Setting::getArrayValue(gn::StartupItem, Setting::setting);
for (int i = 0; i < startupItem.size(); ++i)
{
auto fileName = startupItem[i];
Core_StartProcess::startProcess(fileName);
}

StdOut::printLine(Const_Core::Message::RunStartupItems);
}
1 change: 1 addition & 0 deletions qpp/prefetch/Source/Input/const_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ namespace Const_Input
const QString exit = "exit";
const QString traydc = "traydc";
const QString expiresc = "expiresc";
const QString startup = "startup";
}
namespace Command_Level2
{
Expand Down
1 change: 1 addition & 0 deletions qpp/prefetch/Source/Setting/setting.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <QSettings>
#include <QString>
#include <QStringList>

// Look at GenericCpp\ReturnByReference first
class Setting
Expand Down
1 change: 1 addition & 0 deletions qpp/prefetch/prefetch.pro
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ SOURCES += \
Source/Input/Thread/Command/Level1/exit.cpp \
Source/Input/Thread/Command/Level1/expiresc.cpp \
Source/Input/Thread/Command/Level1/start.cpp \
Source/Input/Thread/Command/Level1/startup.cpp \
Source/Input/Thread/Command/Level1/stop.cpp \
Source/Input/Thread/Command/Level1/test.cpp \
Source/Input/Thread/Command/Level1/traydc.cpp \
Expand Down

0 comments on commit 7502280

Please sign in to comment.