Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
Extract libostfilegui out of libostfile
Browse files Browse the repository at this point in the history
libostfile now has no GUI dependencies
  • Loading branch information
pstavirs committed Nov 16, 2023
1 parent f3dccb9 commit 23ee0e6
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 24 deletions.
12 changes: 9 additions & 3 deletions client/ostinato.pro
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,32 @@ INCLUDEPATH += "../rpc/" "../common/"
win32 {
QMAKE_LFLAGS += -static
CONFIG(debug, debug|release) {
LIBS += -L"../common/debug" -lostfile -lostprotogui -lostproto
LIBS += -L"../common/debug" -lostfilegui -lostfile
LIBS += -L"../common/debug" -lostprotogui -lostproto
LIBS += -L"../rpc/debug" -lpbrpc
POST_TARGETDEPS += \
"../common/debug/libostfilegui.a" \
"../common/debug/libostfile.a" \
"../common/debug/libostprotogui.a" \
"../common/debug/libostproto.a" \
"../rpc/debug/libpbrpc.a"
} else {
LIBS += -L"../common/release" -lostfile -lostprotogui -lostproto
LIBS += -L"../common/release" -lostfilegui -lostfile
LIBS += -L"../common/release" -lostprotogui -lostproto
LIBS += -L"../rpc/release" -lpbrpc
POST_TARGETDEPS += \
"../common/release/libostfilegui.a" \
"../common/release/libostfile.a" \
"../common/release/libostprotogui.a" \
"../common/release/libostproto.a" \
"../rpc/release/libpbrpc.a"
}
} else {
LIBS += -L"../common" -lostfile -lostprotogui -lostproto
LIBS += -L"../common" -lostfile -lostfilegui
LIBS += -L"../common" -lostprotogui -lostproto
LIBS += -L"../rpc" -lpbrpc
POST_TARGETDEPS += \
"../common/libostfilegui.a" \
"../common/libostfile.a" \
"../common/libostprotogui.a" \
"../common/libostproto.a" \
Expand Down
10 changes: 6 additions & 4 deletions common/nativefileformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>

#include "crc32c.h"

#include <QApplication>
#include <QCoreApplication>
#include <QFile>
#include <QVariant>

Expand Down Expand Up @@ -437,17 +437,19 @@ bool NativeFileFormat::isNativeFileFormat(

void NativeFileFormat::initFileMetaData(OstProto::FileMetaData &metaData)
{
QCoreApplication *app = QCoreApplication::instance();

// Fill in the "native" file format version
metaData.set_format_version_major(kFileFormatVersionMajor);
metaData.set_format_version_minor(kFileFormatVersionMinor);
metaData.set_format_version_revision(kFileFormatVersionRevision);

metaData.set_generator_name(
qApp->applicationName().toUtf8().constData());
app->applicationName().toUtf8().constData());
metaData.set_generator_version(
qApp->property("version").toString().toUtf8().constData());
app->property("version").toString().toUtf8().constData());
metaData.set_generator_revision(
qApp->property("revision").toString().toUtf8().constData());
app->property("revision").toString().toUtf8().constData());
}

int NativeFileFormat::fileMetaSize(const quint8* file, int size)
Expand Down
13 changes: 1 addition & 12 deletions common/ostfile.pro
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
TEMPLATE = lib
CONFIG += qt staticlib
QT += widgets network xml script
QT += network xml script
LIBS += \
-lprotobuf

FORMS = \
pcapfileimport.ui \

PROTOS = \
fileformat.proto

Expand All @@ -24,10 +21,6 @@ HEADERS = \
sessionfileformat.h \
streamfileformat.h

HEADERS += \
fileformatoptions.h \
pcapoptionsdialog.h

SOURCES += \
ostprotolib.cpp \
nativefileformat.cpp \
Expand All @@ -42,10 +35,6 @@ SOURCES += \
sessionfileformat.cpp \
streamfileformat.cpp \

SOURCES += \
fileformatoptions.cpp \
pcapoptionsdialog.cpp

SOURCES += \
vlanpdml.cpp \
svlanpdml.cpp \
Expand Down
15 changes: 15 additions & 0 deletions common/ostfilegui.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
TEMPLATE = lib
CONFIG += qt staticlib
QT += widgets

FORMS = \
pcapfileimport.ui

HEADERS = \
fileformatoptions.h \
pcapoptionsdialog.h

SOURCES = \
fileformatoptions.cpp \
pcapoptionsdialog.cpp

2 changes: 0 additions & 2 deletions common/pcapfileformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>

#include "pcapfileformat.h"

#include "pcapoptionsdialog.h"

#include "pdmlreader.h"
#include "ostprotolib.h"
#include "streambase.h"
Expand Down
7 changes: 5 additions & 2 deletions ost.pro
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
TEMPLATE = subdirs
SUBDIRS = client server ostfile ostproto ostprotogui rpc extra
SUBDIRS = client server ostfile ostfilegui ostproto ostprotogui rpc extra

client.target = client
client.file = client/ostinato.pro
client.depends = ostfile ostproto ostprotogui rpc extra
client.depends = ostfile ostfilegui ostproto ostprotogui rpc extra

server.target = server
server.file = server/drone.pro
Expand All @@ -12,6 +12,9 @@ server.depends = ostproto rpc
ostfile.file = common/ostfile.pro
ostfile.depends = ostproto

ostfilegui.file = common/ostfilegui.pro
ostfilegui.depends = ostfile

ostproto.file = common/ostproto.pro

ostprotogui.file = common/ostprotogui.pro
Expand Down
2 changes: 1 addition & 1 deletion test/test.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TEMPLATE = app
CONFIG += qt console
QT += xml network script widgets
QT += xml network script
INCLUDEPATH += "../rpc/" "../common/" "../client"
win32 {
LIBS += -lwpcap -lpacket
Expand Down

0 comments on commit 23ee0e6

Please sign in to comment.