Improve code style. Use typedef.

This commit is contained in:
Roman Telezhynskyi 2020-04-13 12:43:25 +03:00
parent e1c945d02c
commit aa81fa5ecf
4 changed files with 10 additions and 9 deletions

View file

@ -444,7 +444,7 @@ void PuzzleApplication::ActivateDarkMode()
//---------------------------------------------------------------------------------------------------------------------
void PuzzleApplication::ParseCommandLine(const SocketConnection &connection, const QStringList &arguments)
{
std::shared_ptr<VPuzzleCommandLine>cmd = CommandLine();
VPuzzleCommandLinePtr cmd = CommandLine();
// QCommandLineParser parser;
// parser.setApplicationDescription(tr("Valentina's manual layout editor."));
// parser.addHelpOption();
@ -641,7 +641,7 @@ void PuzzleApplication::Clean()
}
//--------------------------------------------------------------------------------------------
const std::shared_ptr<VPuzzleCommandLine> PuzzleApplication::CommandLine()
const VPuzzleCommandLinePtr PuzzleApplication::CommandLine()
{
return VPuzzleCommandLine::instance;
}

View file

@ -71,7 +71,7 @@ public:
void ActivateDarkMode();
void ParseCommandLine(const SocketConnection &connection, const QStringList &arguments);
const std::shared_ptr<VPuzzleCommandLine> CommandLine();
const VPuzzleCommandLinePtr CommandLine();
public slots:
void ProcessCMD();

View file

@ -76,7 +76,7 @@ VPuzzleCommandLine::VPuzzleCommandLine():
}
//-------------------------------------------------------------------------------------------
std::shared_ptr<VPuzzleCommandLine> VPuzzleCommandLine::Instance(const QCoreApplication &app)
VPuzzleCommandLinePtr VPuzzleCommandLine::Instance(const QCoreApplication &app)
{
if (instance == nullptr)
{

View file

@ -5,6 +5,9 @@
#include <QCoreApplication>
#include <QCommandLineParser>
class VPuzzleCommandLine;
using VPuzzleCommandLinePtr = std::shared_ptr<VPuzzleCommandLine>;
class VPuzzleCommandLine: public QObject
{
friend class PuzzleApplication;
@ -44,13 +47,11 @@ public:
protected:
VPuzzleCommandLine();
/**
* @brief create the single instance of the class inside puzzleapplication
*/
static std::shared_ptr<VPuzzleCommandLine> Instance(const QCoreApplication &app);
/** @brief create the single instance of the class inside puzzleapplication */
static VPuzzleCommandLinePtr Instance(const QCoreApplication &app);
private:
Q_DISABLE_COPY(VPuzzleCommandLine)
static std::shared_ptr<VPuzzleCommandLine> instance;
static VPuzzleCommandLinePtr instance;
QCommandLineParser parser;
bool isGuiEnabled;