Skip to content

Commit

Permalink
Updates to Paths
Browse files Browse the repository at this point in the history
  • Loading branch information
fiffty-50 committed Feb 22, 2023
1 parent 2924653 commit 323cd3b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 20 deletions.
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,41 @@ Airline pilots are required to maintain a logbook containing details of their fl

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.

## How does it look like?

Here are some screenshots:

![Alt Screenshot 1](assets/screenshots/screenshot1.png)

![Alt Screenshot 2](assets/screenshots/screenshot3.png)

## The state of the project!

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.
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.

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)!

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:[email protected]?subject=[GitHub]%20Contributing%20to%20openPilotLog).

# How does it look like?
## Installation

Here are some early screenshots:
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.

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

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

![Alt Screenshot 3](assets/screenshots/newflight_2_light.png)
# Then run the program with
flatpak run org.opl.openPilotLog
```
### Linux - build latest from source
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)

![Alt Screenshot 4](assets/screenshots/pilotsdialog_dark.png)
Binary file modified assets/screenshots/screenshot1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshots/screenshot3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions src/classes/paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ namespace OPL {

const bool Paths::setup() {
LOG << "Setting up directories at: " << basePath;
const QString dir_path = basePath;
for(const auto& str : qAsConst(directories)){
QDir dir(dir_path + str);
for(const auto& str : qAsConst(directories)){
QDir dir(basePath + str);
if(!dir.exists()) {
if (!dir.mkpath(dir.absolutePath()))
return false;
Expand Down
22 changes: 12 additions & 10 deletions src/classes/paths.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@

namespace OPL {


/*!
* \brief The Paths class provides paths for the applications folder structure.
* \details In order to be cross-platform compatible, QStandardPaths returns the default
* writable locations for Application Data for the current operating system,
* for example `/home/user/.local/share/opl` on linux or `/Users/user/Library/Application Support/opl` on macos.
*
* OPL writes into a singular directory, with several subdirectories, which are enumerated in Directories.
*/
class Paths
{
public:
Expand Down Expand Up @@ -50,17 +57,12 @@ class Paths
* \brief returns a QFileInfo for the default database file.
*/
static const QFileInfo databaseFileInfo();
private:
// Define the paths where the application data will be written. This will be standard locations on all platforms eventually
// but for now on Windows and MacOS, we use the application runtime directory to make it easier to
// debug and develop. On Linux XDG standard directories are required for the flatpak to work.
#ifdef linux

/*!
* \brief the base Path of the Application Directory. Evaluates to an XDG writable App Data location depending on the OS
*/
static const inline QString basePath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QDir::toNativeSeparators("/")
+ ORGNAME + QDir::toNativeSeparators("/");
#else
static const inline QString basePath = QCoreApplication::applicationDirPath();
#endif

};


Expand Down

0 comments on commit 323cd3b

Please sign in to comment.