Browse Source

Refactored APilotEntry

renamed APilotEntry struct and moved it into seperate file. Renamed Decl.h to decl.h and adjusted includes
Felix Turo 4 years ago
parent
commit
1ff2a9e573

+ 3 - 1
openPilotLog.pro

@@ -31,6 +31,7 @@ SOURCES += \
     src/database/entry_deprecated.cpp \
     src/experimental/adatabase.cpp \
     src/experimental/aentry.cpp \
+    src/experimental/apilotentry.cpp \
     src/functions/acalc.cpp \
     src/functions/areadcsv.cpp \
     src/functions/astat.cpp \
@@ -60,10 +61,11 @@ HEADERS += \
     src/database/dbinfo.h \
     src/database/dbsetup.h \
     src/database/entry_deprecated.h \
-    src/experimental/Decl.h \
     src/experimental/UserInput.h \
     src/experimental/adatabase.h \
     src/experimental/aentry.h \
+    src/experimental/apilotentry.h \
+    src/experimental/decl.h \
     src/functions/acalc.h \
     src/functions/areadcsv.h \
     src/functions/astat.h \

+ 1 - 0
src/experimental/adatabase.h

@@ -11,6 +11,7 @@
 #include "debug.h"
 
 #include "aentry.h"
+#include "apilotentry.h"
 
 namespace experimental {
 

+ 0 - 12
src/experimental/aentry.cpp

@@ -29,16 +29,4 @@ const TableData& AEntry::getData()
     return tableData;
 }
 
-APilotEntry::APilotEntry()
-    : AEntry::AEntry(DEFAULT_PILOT_POSITION)
-{}
-
-APilotEntry::APilotEntry(int row_id)
-    : AEntry::AEntry(DataPosition("pilots", row_id))
-{}
-
-APilotEntry::APilotEntry(TableData table_data)
-    : AEntry::AEntry(DEFAULT_PILOT_POSITION, table_data)
-{}
-
 }  // namespace experimental

+ 1 - 10
src/experimental/aentry.h

@@ -6,7 +6,7 @@
 #include <QMap>
 #include <QPair>
 
-#include "Decl.h"
+#include "decl.h"
 
 namespace experimental {
 
@@ -37,15 +37,6 @@ public:
 
 };
 
-struct APilotEntry : public AEntry {
-public:
-    APilotEntry();
-    APilotEntry(const APilotEntry& pe) = default;
-    APilotEntry& operator=(const APilotEntry& pe) = default;
-    APilotEntry(int row_id);
-    APilotEntry(TableData table_data);
-};
-
 }
 
 #endif // ENTRY_H

+ 17 - 0
src/experimental/apilotentry.cpp

@@ -0,0 +1,17 @@
+#include "apilotentry.h"
+
+namespace experimental {
+
+APilotEntry::APilotEntry()
+    : AEntry::AEntry(DEFAULT_PILOT_POSITION)
+{}
+
+APilotEntry::APilotEntry(int row_id)
+    : AEntry::AEntry(DataPosition("pilots", row_id))
+{}
+
+APilotEntry::APilotEntry(TableData table_data)
+    : AEntry::AEntry(DEFAULT_PILOT_POSITION, table_data)
+{}
+
+} // namespace experimental

+ 20 - 0
src/experimental/apilotentry.h

@@ -0,0 +1,20 @@
+#ifndef APILOTENTRY_H
+#define APILOTENTRY_H
+
+#include "src/experimental/aentry.h"
+#include "src/experimental/decl.h"
+
+namespace experimental {
+
+struct APilotEntry : public AEntry {
+public:
+    APilotEntry();
+    APilotEntry(const APilotEntry& pe) = default;
+    APilotEntry& operator=(const APilotEntry& pe) = default;
+    APilotEntry(int row_id);
+    APilotEntry(TableData table_data);
+};
+
+} // namespace experimental
+
+#endif // APILOTENTRY_H

+ 0 - 0
src/experimental/Decl.h → src/experimental/decl.h


+ 2 - 1
src/gui/dialogues/newpilotdialog.h

@@ -27,7 +27,8 @@
 
 #include "src/experimental/adatabase.h"
 #include "src/experimental/aentry.h"
-#include "src/experimental/Decl.h"
+#include "src/experimental/apilotentry.h"
+#include "src/experimental/decl.h"
 
 namespace Ui {
 class NewPilot;

+ 1 - 1
src/gui/widgets/homewidget.h

@@ -34,7 +34,7 @@
 #include "src/gui/dialogues/newflightdialog.h"
 
 #include "src/experimental/adatabase.h"
-#include "src/experimental/Decl.h"
+#include "src/experimental/decl.h"
 
 namespace Ui {
 class HomeWidget;