Begin 'shared' project to share code between cli and gui
This commit is contained in:
21
cli/cli.pro
21
cli/cli.pro
@ -32,7 +32,8 @@ SOURCES += \
|
||||
filesaver.cpp \
|
||||
databasefactory.cpp \
|
||||
sqlitedbservice.cpp \
|
||||
logger.cpp
|
||||
logger.cpp \
|
||||
commandsearch.cpp
|
||||
|
||||
HEADERS += \
|
||||
encodingdetector.h \
|
||||
@ -54,5 +55,21 @@ HEADERS += \
|
||||
filedata.h \
|
||||
databasefactory.h \
|
||||
sqlitedbservice.h \
|
||||
logger.h
|
||||
logger.h \
|
||||
commandsearch.h
|
||||
INCLUDEPATH += /usr/include/poppler/qt5/ /usr/include/quazip5
|
||||
|
||||
|
||||
|
||||
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../shared/release/ -lshared
|
||||
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../shared/debug/ -lshared
|
||||
else:unix: LIBS += -L$$OUT_PWD/../shared/ -lshared
|
||||
|
||||
INCLUDEPATH += $$PWD/../shared
|
||||
DEPENDPATH += $$PWD/../shared
|
||||
|
||||
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../shared/release/libshared.a
|
||||
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../shared/debug/libshared.a
|
||||
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../shared/release/shared.lib
|
||||
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../shared/debug/shared.lib
|
||||
else:unix: PRE_TARGETDEPS += $$OUT_PWD/../shared/libshared.a
|
||||
|
1
cli/commandsearch.cpp
Normal file
1
cli/commandsearch.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "commandsearch.h"
|
20
cli/commandsearch.h
Normal file
20
cli/commandsearch.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef COMMANDSEARCH_H
|
||||
#define COMMANDSEARCH_H
|
||||
#include "command.h"
|
||||
#include "../shared/sqlitesearch.h"
|
||||
|
||||
class CommandSearch : public Command
|
||||
{
|
||||
private:
|
||||
SqliteSearch searcher;
|
||||
|
||||
public:
|
||||
using Command::Command;
|
||||
|
||||
int handle(QStringList arguments) override
|
||||
{
|
||||
return 23;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // COMMANDSEARCH_H
|
@ -20,6 +20,7 @@
|
||||
#include "commandadd.h"
|
||||
#include "commanddelete.h"
|
||||
#include "commandupdate.h"
|
||||
#include "commandsearch.h"
|
||||
#include "databasefactory.h"
|
||||
#include "logger.h"
|
||||
void printUsage(QString argv0)
|
||||
@ -43,7 +44,9 @@ Command *commandFromName(QString name, SqliteDbService &dbService)
|
||||
}
|
||||
if(name == "search")
|
||||
{
|
||||
return new CommandSearch(dbService);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user