Skip to content

Commit 323cd3b

Browse files
committed
Updates to Paths
1 parent 2924653 commit 323cd3b

File tree

5 files changed

+40
-20
lines changed

5 files changed

+40
-20
lines changed

README.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,41 @@ Airline pilots are required to maintain a logbook containing details of their fl
88

99
I have used paid solutions for many years, and have seen more and of them move from being a one-time license purchase to becoming a "Logbook as a Service" type subscription. After the one I have been using for the last couple of years, and had bought a "lifetime license" for ended up announcing they also moved to a subscription based service, I decided that it is time for a free and open source alternative that is fast, easy to use, and does not require a subscription.
1010

11+
## How does it look like?
12+
13+
Here are some screenshots:
14+
15+
![Alt Screenshot 1](assets/screenshots/screenshot1.png)
16+
17+
![Alt Screenshot 2](assets/screenshots/screenshot3.png)
18+
1119
## The state of the project!
1220

13-
openPilotLog is currently in development, so no release is provided yet. If you would like to be informed about upcoming releases, you can [subscribe](https://openpilotlog.eu/?page_id=48) to our newsletter.
21+
openPilotLog is currently in development, it is not recommended to use it as your primary logbook solution just yet. If you would like to be informed about upcoming stable releases, you can [subscribe](https://openpilotlog.eu/?page_id=48) to our newsletter.
1422

1523
If you want to learn more about this project, check out the [wiki](https://github.com/fiffty-50/openpilotlog/wiki) or the [blog](https://openpilotlog.eu/?page_id=35)!
1624

1725
For developers, the code documentation can be found at our [doxygen](https://fiffty-50.github.io/openPilotLog/html/index.html) pages. If you are interested in contributing to the project, you can get in touch [here](mailto:felix.turo@gmail.com?subject=[GitHub]%20Contributing%20to%20openPilotLog).
1826

19-
# How does it look like?
27+
## Installation
2028

21-
Here are some early screenshots:
29+
Right now, there are only testing versions available, so I have not created installers for them. Since this version is aimed at early testers and advanced users, some manual steps may be required to install openPilotLog.
2230

23-
![Alt Screenshot 1](assets/screenshots/logbookwidget_light.png)
31+
### Windows
32+
Download and install the release and unzip it to a destination folder of your liking.
33+
### macOS
34+
Download and open the .dmg file for your configuration (ARM64 - M1/M2 based machines, x86_64 - Intel based).
35+
### Linux - using flatpak
36+
Make sure you have [flatpak](https://flatpak.org/setup/) installed and working. Then download the release and install the package.
2437

25-
![Alt Screenshot 2](assets/screenshots/newflight_1_dark.png)
38+
```bash
39+
# Requires kde platform runtime version `5.15-21.08`.
40+
flatpak install org.kde.Platform
41+
flatpak install --user [PathToDownloadedPackage].flatpak
2642

27-
![Alt Screenshot 3](assets/screenshots/newflight_2_light.png)
43+
# Then run the program with
44+
flatpak run org.opl.openPilotLog
45+
```
46+
### Linux - build latest from source
47+
If you want to build the project from source you can use cmake-ninja, Qt Creator flatpak-builder (see `yaml` file located [here](docs/deployment/linux-flatpak/org.opl.openPilotLog.yaml)). You can find more information in the [deployment docs](docs/deployment/linux-flatpak/flatpak_creation.md)
2848

29-
![Alt Screenshot 4](assets/screenshots/pilotsdialog_dark.png)

assets/screenshots/screenshot1.png

-1.92 KB
Loading

assets/screenshots/screenshot3.png

-23.2 KB
Loading

src/classes/paths.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ namespace OPL {
55

66
const bool Paths::setup() {
77
LOG << "Setting up directories at: " << basePath;
8-
const QString dir_path = basePath;
9-
for(const auto& str : qAsConst(directories)){
10-
QDir dir(dir_path + str);
8+
for(const auto& str : qAsConst(directories)){
9+
QDir dir(basePath + str);
1110
if(!dir.exists()) {
1211
if (!dir.mkpath(dir.absolutePath()))
1312
return false;

src/classes/paths.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@
1010

1111
namespace OPL {
1212

13-
13+
/*!
14+
* \brief The Paths class provides paths for the applications folder structure.
15+
* \details In order to be cross-platform compatible, QStandardPaths returns the default
16+
* writable locations for Application Data for the current operating system,
17+
* for example `/home/user/.local/share/opl` on linux or `/Users/user/Library/Application Support/opl` on macos.
18+
*
19+
* OPL writes into a singular directory, with several subdirectories, which are enumerated in Directories.
20+
*/
1421
class Paths
1522
{
1623
public:
@@ -50,17 +57,12 @@ class Paths
5057
* \brief returns a QFileInfo for the default database file.
5158
*/
5259
static const QFileInfo databaseFileInfo();
53-
private:
54-
// Define the paths where the application data will be written. This will be standard locations on all platforms eventually
55-
// but for now on Windows and MacOS, we use the application runtime directory to make it easier to
56-
// debug and develop. On Linux XDG standard directories are required for the flatpak to work.
57-
#ifdef linux
60+
61+
/*!
62+
* \brief the base Path of the Application Directory. Evaluates to an XDG writable App Data location depending on the OS
63+
*/
5864
static const inline QString basePath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QDir::toNativeSeparators("/")
5965
+ ORGNAME + QDir::toNativeSeparators("/");
60-
#else
61-
static const inline QString basePath = QCoreApplication::applicationDirPath();
62-
#endif
63-
6466
};
6567

6668

0 commit comments

Comments
 (0)