Skip to content

Commit

Permalink
code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mhogomchungu committed Feb 9, 2025
1 parent 228914a commit 1149881
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
41 changes: 31 additions & 10 deletions src/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,18 +603,34 @@ std::vector< utility::PlayerOpts > utility::getMediaPlayers()

m.emplace_back( "","Flatpak" ) ;
}else{
struct app
class appList
{
app( const char * u,const char * e ) : uiName( u ),exeName( e )
public:
struct app
{
app( const char * u,const char * e ) : uiName( u ),exeName( e )
{
}
const char * uiName ;
const char * exeName ;
} ;
appList()
{
m_appList.emplace_back( "VLC","vlc" ) ;
m_appList.emplace_back( "SMPlayer","smplayer" ) ;
m_appList.emplace_back( "MPV","mpv" ) ;
}
const char * uiName ;
const char * exeName ;
};

std::array< app,3 > apps = { { { "VLC","vlc" },
{ "SMPlayer","smplayer" },
{ "MPV","mpv" } } } ;
auto begin() const
{
return m_appList.begin() ;
}
auto end() const
{
return m_appList.end() ;
}
private:
std::vector< app > m_appList ;
} apps ;

for( const auto& it : apps ){

Expand Down Expand Up @@ -2003,7 +2019,7 @@ bool utility::cliArguments::portable() const

bool utility::cliArguments::printMediaPlayers() const
{
return this->contains( "--print-media-players" ) ;
return this->contains( "--show-media-players" ) ;
}

QString utility::cliArguments::dataPath() const
Expand Down Expand Up @@ -2457,6 +2473,11 @@ bool utility::Qt6Version()
#endif
}

bool utility::Qt5Version()
{
return !utility::Qt6Version() ;
}

QString utility::OSXApplicationDirPath()
{
return QCoreApplication::applicationDirPath() ;
Expand Down
1 change: 1 addition & 0 deletions src/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ namespace utility
void failedToParseJsonData( Logger&,const QJsonParseError& ) ;
bool runningGitVersion() ;
bool Qt6Version() ;
bool Qt5Version() ;
QString runningVersionOfMediaDownloader() ;
QString aboutVersionInfo() ;
QString compileTimeVersion() ;
Expand Down

0 comments on commit 1149881

Please sign in to comment.