mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-14 13:22:23 +08:00
Brought back some changes that were removed with previous revert
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
parent
64d9c2e4e6
commit
b16cc2fd3b
@ -13,23 +13,23 @@
|
|||||||
using namespace WallpaperEngine::Application;
|
using namespace WallpaperEngine::Application;
|
||||||
|
|
||||||
struct option long_options [] = {
|
struct option long_options [] = {
|
||||||
{"screen-root", required_argument, 0, 'r'},
|
{"screen-root", required_argument, nullptr, 'r'},
|
||||||
{"pkg", required_argument, 0, 'p'},
|
{"pkg", required_argument, nullptr, 'p'},
|
||||||
{"dir", required_argument, 0, 'd'},
|
{"dir", required_argument, nullptr, 'd'},
|
||||||
{"silent", no_argument, 0, 's'},
|
{"silent", no_argument, nullptr, 's'},
|
||||||
{"volume", required_argument, 0, 'v'},
|
{"volume", required_argument, nullptr, 'v'},
|
||||||
{"help", no_argument, 0, 'h'},
|
{"help", no_argument, nullptr, 'h'},
|
||||||
{"fps", required_argument, 0, 'f'},
|
{"fps", required_argument, nullptr, 'f'},
|
||||||
{"assets-dir", required_argument, 0, 'a'},
|
{"assets-dir", required_argument, nullptr, 'a'},
|
||||||
{"screenshot", required_argument, 0, 'c'},
|
{"screenshot", required_argument, nullptr, 'c'},
|
||||||
{"list-properties", no_argument, 0, 'l'},
|
{"list-properties", no_argument, nullptr, 'l'},
|
||||||
{"set-property", required_argument, 0, 'o'},
|
{"set-property", required_argument, nullptr, 'o'},
|
||||||
{nullptr, 0, 0, 0}
|
{nullptr, 0, nullptr, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string stringPathFixes(const std::string& s)
|
std::string stringPathFixes(const std::string& s)
|
||||||
{
|
{
|
||||||
if (s.empty () == true)
|
if (s.empty ())
|
||||||
return s;
|
return s;
|
||||||
|
|
||||||
std::string str (s);
|
std::string str (s);
|
||||||
@ -113,7 +113,7 @@ CApplicationContext::CApplicationContext (int argc, char* argv[]) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->background.empty () == true)
|
if (this->background.empty ())
|
||||||
{
|
{
|
||||||
if (optind < argc && strlen (argv [optind]) > 0)
|
if (optind < argc && strlen (argv [optind]) > 0)
|
||||||
{
|
{
|
||||||
@ -121,7 +121,7 @@ CApplicationContext::CApplicationContext (int argc, char* argv[]) :
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->printHelp (argv [0]);
|
printHelp (argv [0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ void CApplicationContext::validatePath ()
|
|||||||
|
|
||||||
void CApplicationContext::validateAssets ()
|
void CApplicationContext::validateAssets ()
|
||||||
{
|
{
|
||||||
if (this->assets.empty () == false)
|
if (!this->assets.empty ())
|
||||||
{
|
{
|
||||||
sLog.out ("Using wallpaper engine's assets at ", this->assets, " based on --assets-dir parameter");
|
sLog.out ("Using wallpaper engine's assets at ", this->assets, " based on --assets-dir parameter");
|
||||||
return;
|
return;
|
||||||
@ -161,10 +161,10 @@ void CApplicationContext::validateAssets ()
|
|||||||
|
|
||||||
void CApplicationContext::validateScreenshot ()
|
void CApplicationContext::validateScreenshot ()
|
||||||
{
|
{
|
||||||
if (this->takeScreenshot == false)
|
if (!this->takeScreenshot)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this->screenshot.has_extension () == false)
|
if (!this->screenshot.has_extension ())
|
||||||
sLog.exception ("Cannot determine screenshot format");
|
sLog.exception ("Cannot determine screenshot format");
|
||||||
|
|
||||||
std::string extension = this->screenshot.extension ();
|
std::string extension = this->screenshot.extension ();
|
||||||
|
Loading…
Reference in New Issue
Block a user