From 6b696e8be36117dcbc366b2c244035f2c62a5eca Mon Sep 17 00:00:00 2001 From: mhogomchungu Date: Tue, 8 Oct 2024 09:54:32 +0300 Subject: [PATCH] more work supporting flatpak --- ....github.mhogomchungu.sirikali.metainfo.xml | 2 +- src/settings.cpp | 15 ++++++++ src/settings.h | 37 +++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/flatpak/io.github.mhogomchungu.sirikali.metainfo.xml b/src/flatpak/io.github.mhogomchungu.sirikali.metainfo.xml index eb33ce6d..31099149 100644 --- a/src/flatpak/io.github.mhogomchungu.sirikali.metainfo.xml +++ b/src/flatpak/io.github.mhogomchungu.sirikali.metainfo.xml @@ -20,7 +20,7 @@ Francis Banyikwa -

This application makes it easy to use Gocryptfs, Securefs and Cryfs to store documents in secured folders.

Securefs and Gocryptfs are bundled with the application and users who prefer to use Cryfs should manually it first at "~/.var/app/io.github.mhogomchungu.sirikali/data/SiriKali/bin" folder.

+

This application makes it easy to use Gocryptfs, Securefs and Cryfs to store documents in secured folders.

Securefs and Gocryptfs are bundled with the application and users who prefer to use Cryfs should manually install it first at "~/.var/app/io.github.mhogomchungu.sirikali/data/SiriKali/bin" folder.

io.github.mhogomchungu.sirikali.desktop diff --git a/src/settings.cpp b/src/settings.cpp index c36fbf43..558a0028 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -188,6 +188,11 @@ QString settings::portableVersionConfigPath() return SiriKali::Windows::applicationDirPath() + "/local" ; } +const settings::flatpakRuntimeOptions& settings::flatpakIntance() +{ + return m_flatpakRuntimeOptions ; +} + bool settings::showCipherFolderAndMountPathInFavoritesList() { if( !m_settings.contains( "ShowCipherFolderAndMountPathInFavoritesList" ) ){ @@ -1668,3 +1673,13 @@ settings::translator::entry::entry( const QString& a,const char * b,const QStrin UINameTranslated( a ),UINameUnTranslated( b ),internalName( c ) { } + +settings::flatpakRuntimeOptions::flatpakRuntimeOptions() : + m_settings( "/.flatpak-info",QSettings::IniFormat ), + m_globalBinPath( m_settings.value( "Instance/app-path" ).toString() + "/bin" ), + m_architecture( m_settings.value( "Instance/arch" ).toString() ), + m_commitId( m_settings.value( "Instance/app-commit" ).toString() ), + m_runtimePath( m_settings.value( "Instance/runtime-path" ).toString() ), + m_localBinPath( "/app/bin" ) +{ +} diff --git a/src/settings.h b/src/settings.h index 2e7a7b6f..d2ec4857 100644 --- a/src/settings.h +++ b/src/settings.h @@ -97,6 +97,40 @@ class settings bool m_ok = false ; }; + class flatpakRuntimeOptions + { + public: + flatpakRuntimeOptions() ; + + const QString& globalBinPath() const + { + return m_globalBinPath ; + } + const QString& architecture() const + { + return m_architecture ; + } + const QString& commitId() const + { + return m_commitId ; + } + const QString& localBinPath() const + { + return m_localBinPath ; + } + const QString& runtimePath() const + { + return m_runtimePath ; + } + private: + QSettings m_settings ; + QString m_globalBinPath ; + QString m_architecture ; + QString m_commitId ; + QString m_runtimePath ; + QString m_localBinPath ; + } ; + class translator { public: @@ -128,6 +162,8 @@ class settings static bool portableVersion() ; static QString portableVersionConfigPath() ; + const flatpakRuntimeOptions& flatpakIntance() ; + settings::windowDimensions getWindowDimensions() ; void setWindowDimensions( const settings::windowDimensions& ) ; settings() ; @@ -239,6 +275,7 @@ class settings std::unique_ptr< QSettings > m_settingsP ; QSettings& m_settings ; bool m_portableVersion ; + flatpakRuntimeOptions m_flatpakRuntimeOptions ; }; #endif //SETTINGS_H