Skip to content

Commit

Permalink
more work on cryptomator backend
Browse files Browse the repository at this point in the history
  • Loading branch information
mhogomchungu committed Dec 26, 2024
1 parent 549ec48 commit 173e6dc
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
19 changes: 2 additions & 17 deletions src/checkforupdates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,9 @@ void checkUpdates::checkIfInstalled()

for( const auto& xt : utility::asConst( apps ) ){

const auto& m = [ & ](){
if( it->enginesMatch( xt ) && it->updatable() ){

const auto& displayName = it->displayName() ;

if( displayName.isEmpty() ){

return it->name() ;
}else{
return displayName ;
}
}() ;

if( m == xt ){

if( it->updatable() ){

m_backendsInstallable.emplace_back( it ) ;
}
m_backendsInstallable.emplace_back( it ) ;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/configoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ void configOptions::translateUI()

}else if( utility::platformIsWindows() ){

m_ui->cbInternallyManageBackEnds->setText( tr( "Manage Securefs and Cppcryptfs" ) ) ;
m_ui->cbInternallyManageBackEnds->setText( tr( "Manage Securefs, Cppcryptfs And Cryptomator" ) ) ;

}else if( utility::platformIsLinux() ){

Expand Down
5 changes: 5 additions & 0 deletions src/engines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,11 @@ engines::engine::exe_args engines::engine::unMountCommand( const engines::engine
}
}

bool engines::engine::enginesMatch( const QString& e ) const
{
return this->name() == e ;
}

QString engines::engine::installedVersionHack( const QString& ) const
{
return {} ;
Expand Down
2 changes: 2 additions & 0 deletions src/engines.h
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,8 @@ class engines

engines::engine::exe_args unMountCommand( const engines::engine::terminate_process& e ) const ;

virtual bool enginesMatch( const QString& ) const ;

virtual QString installedVersionHack( const QString& ) const ;

virtual void setInstalledVersionHack( const QString&,const QString& ) const ;
Expand Down
8 changes: 6 additions & 2 deletions src/engines/cryptomator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ static engines::engine::BaseOptions _setOptions()
s.passwordFormat = "" ;
s.configFileArgument = "" ;
s.keyFileArgument = "" ;

s.incorrectPasswordText = QStringList{ "InvalidPassphraseException" } ;
s.volumePropertiesCommands = QStringList{} ;
s.configFileNames = QStringList{ "vault.cryptomator" } ;
Expand Down Expand Up @@ -97,7 +96,7 @@ cryptomator::cryptomator() :

bool cryptomator::updatable() const
{
if( utility::platformIsWindows() ){
if( utility::platformIsWindows() || utility::platformIsFlatPak() ){

return true ;
}else{
Expand Down Expand Up @@ -136,6 +135,11 @@ bool cryptomator::onlineArchiveFileName( const QString& e ) const
}
}

bool cryptomator::enginesMatch( const QString& e ) const
{
return this->name() + "-cli" == e ;
}

void cryptomator::setUpBinary( bool add,QStringList& apps,const QString& basePath ) const
{
engines::engine::setUpBinary( add,apps,basePath,"cryptomator-cli" ) ;
Expand Down
2 changes: 2 additions & 0 deletions src/engines/cryptomator.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class cryptomator : public engines::engine

bool onlineArchiveFileName( const QString& ) const override ;

bool enginesMatch( const QString& ) const override ;

void deleteBinPath( const QString& ) const override ;

void setUpBinary( bool,QStringList&,const QString& ) const override ;
Expand Down
3 changes: 3 additions & 0 deletions src/processManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ static void _change_env( QProcess& exe,const processManager::opts& opts )
opts.engine.changeEnvironment( opts.args.cmd,opts.args.cmd_args ) ;
} ) ;
#endif
#else
Q_UNUSED( exe )
Q_UNUSED( opts )
#endif
}

Expand Down

0 comments on commit 173e6dc

Please sign in to comment.