Finishing touches

This commit is contained in:
PaulCombal 2020-02-19 11:19:07 +01:00
parent f07600e620
commit f96a34be99
6 changed files with 11 additions and 13 deletions

View File

@ -15,8 +15,7 @@ all: ${CURDIR}/bin/samrewritten
@echo -e "==== Use '\033[1mmake clean\033[0m' to remove object files" @echo -e "==== Use '\033[1mmake clean\033[0m' to remove object files"
@echo -e "==== Nothing left to do." @echo -e "==== Nothing left to do."
dev: CXXFLAGS += -g dev: CXXFLAGS += -g -DDEBUG_CERR
dev: CXXFLAGS += -DDEBUG_CERR
dev: ${CURDIR}/bin/samrewritten dev: ${CURDIR}/bin/samrewritten
clean: clean:

View File

@ -60,7 +60,7 @@ Usage:
-a, --app arg Set which AppId you want to use. Same as using positional -a, --app arg Set which AppId you want to use. Same as using positional
'AppId' 'AppId'
-i, --idle Set your Steam profile as 'ingame'. Ctrl+c to stop. -i, --idle Set your Steam profile as 'ingame'. Ctrl+c to stop.
--ls Display stats (TODO) and achievements for selected app. --ls Display achievements and stats for selected app.
--sort arg Sort option for --ls. You can leave empty or set to --sort arg Sort option for --ls. You can leave empty or set to
'unlock_rate' 'unlock_rate'
--unlock arg Unlock achievements for an AppId. Separate achievement --unlock arg Unlock achievements for an AppId. Separate achievement

View File

@ -45,7 +45,7 @@ bool go_cli_mode(int argc, char* argv[]) {
("h,help", "Show CLI help.") ("h,help", "Show CLI help.")
("a,app", "Set which AppId you want to use. Same as using positional 'AppId'", cxxopts::value<AppId_t>()) ("a,app", "Set which AppId you want to use. Same as using positional 'AppId'", cxxopts::value<AppId_t>())
("i,idle", "Set your Steam profile as 'ingame'. Ctrl+c to stop.") ("i,idle", "Set your Steam profile as 'ingame'. Ctrl+c to stop.")
("ls", "Display stats (TODO) and achievements for selected app.") ("ls", "Display achievements and stats for selected app.")
("sort", "Sort option for --ls. You can leave empty or set to 'unlock_rate'", cxxopts::value<std::string>()) ("sort", "Sort option for --ls. You can leave empty or set to 'unlock_rate'", cxxopts::value<std::string>())
("unlock", "Unlock achievements for an AppId. Separate achievement names by a comma.", cxxopts::value<std::vector<std::string>>()) ("unlock", "Unlock achievements for an AppId. Separate achievement names by a comma.", cxxopts::value<std::vector<std::string>>())
("lock", "Lock achievements for an AppId. Separate achievement names by a comma.", cxxopts::value<std::vector<std::string>>()) ("lock", "Lock achievements for an AppId. Separate achievement names by a comma.", cxxopts::value<std::vector<std::string>>())

View File

@ -1096,7 +1096,6 @@ namespace cxxopts
return m_count; return m_count;
} }
// TODO: maybe default options should count towards the number of arguments
bool bool
has_default() const noexcept has_default() const noexcept
{ {

View File

@ -166,8 +166,7 @@ SteamAppDAO::parse_app_names(const std::string file_path, std::map<AppId_t, std:
std::string file_contents; std::string file_contents;
std::ifstream stream(file_path); std::ifstream stream(file_path);
if (!stream.is_open()) if ( !stream.is_open() ) {
{
std::cerr << "SteamAppDAO::parse_app_names: Unable to open file " << file_path << std::endl; std::cerr << "SteamAppDAO::parse_app_names: Unable to open file " << file_path << std::endl;
zenity(); zenity();
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -183,6 +182,7 @@ SteamAppDAO::parse_app_names(const std::string file_path, std::map<AppId_t, std:
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
// Stream is RAII, but we close it here since we won't use it after
stream.close(); stream.close();
/* we have the whole config file in memory. let's parse it ... */ /* we have the whole config file in memory. let's parse it ... */

View File

@ -9,8 +9,9 @@
#include <future> #include <future>
#include <glibmm-2.4/glibmm.h> #include <glibmm-2.4/glibmm.h>
// TODO use #ifndef __VALGRIND_H or similar #ifdef DEBUG_CERR
// #include <valgrind/valgrind.h> #include <valgrind/valgrind.h>
#endif
AsyncGuiLoader::AsyncGuiLoader(MainPickerWindow* window) AsyncGuiLoader::AsyncGuiLoader(MainPickerWindow* window)
: m_window(window) : m_window(window)
@ -40,8 +41,6 @@ AsyncGuiLoader::load_achievements_idle()
#endif #endif
// Fire off the schema parsing now. // Fire off the schema parsing now.
// TODO: figure out if all the icons are already there and skip parsing schema
// TODO: We want schema parsing to be done serverside now, and pass the result via IPC
m_achievement_idle_data.state = ACH_STATE_LOADING_GUI; m_achievement_idle_data.state = ACH_STATE_LOADING_GUI;
} }
return G_SOURCE_CONTINUE; return G_SOURCE_CONTINUE;
@ -84,8 +83,9 @@ AsyncGuiLoader::load_achievements_idle()
m_window->show_no_achievements_found_placeholder(); m_window->show_no_achievements_found_placeholder();
m_achievement_refresh_lock.unlock(); m_achievement_refresh_lock.unlock();
// See top of the file #ifdef DEBUG_CERR
// VALGRIND_MONITOR_COMMAND("detailed_snapshot"); VALGRIND_MONITOR_COMMAND("detailed_snapshot");
#endif
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
} }