Skip to content

Commit

Permalink
more work supporting flatpak
Browse files Browse the repository at this point in the history
  • Loading branch information
mhogomchungu committed Oct 8, 2024
1 parent f15b7b2 commit 6b696e8
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/flatpak/io.github.mhogomchungu.sirikali.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<name>Francis Banyikwa</name>
</developer>

<description><p>This application makes it easy to use Gocryptfs, Securefs and Cryfs to store documents in secured folders.</p><p>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.</p></description>
<description><p>This application makes it easy to use Gocryptfs, Securefs and Cryfs to store documents in secured folders.</p><p>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.</p></description>

<launchable type="desktop-id">io.github.mhogomchungu.sirikali.desktop</launchable>

Expand Down
15 changes: 15 additions & 0 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" ) ){
Expand Down Expand Up @@ -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" )
{
}
37 changes: 37 additions & 0 deletions src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -128,6 +162,8 @@ class settings
static bool portableVersion() ;
static QString portableVersionConfigPath() ;

const flatpakRuntimeOptions& flatpakIntance() ;

settings::windowDimensions getWindowDimensions() ;
void setWindowDimensions( const settings::windowDimensions& ) ;
settings() ;
Expand Down Expand Up @@ -239,6 +275,7 @@ class settings
std::unique_ptr< QSettings > m_settingsP ;
QSettings& m_settings ;
bool m_portableVersion ;
flatpakRuntimeOptions m_flatpakRuntimeOptions ;
};

#endif //SETTINGS_H

0 comments on commit 6b696e8

Please sign in to comment.