Skip to content

Commit

Permalink
vkconfig3: fix warnings
Browse files Browse the repository at this point in the history
Change-Id: I55b927f2a2eb9a36f7c1b92f0331eab78fc9bc68
  • Loading branch information
christophe-lunarg committed Nov 27, 2024
1 parent 04020f1 commit fe6a846
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 35 deletions.
2 changes: 1 addition & 1 deletion vkconfig_cmd/main_layers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static int RunLayersList(Configurator& configurator, const CommandLine& command_
}

static int RunLayersVerbose(Configurator& configurator, const CommandLine& command_line) {
printf(configurator.layers.Log().c_str());
printf("%s", configurator.layers.Log().c_str());
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion vkconfig_core/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ bool Configuration::Load(const Path& full_path, const LayerManager& layers) {
return true;
}

bool Configuration::Save(const Path& full_path, bool exporter) const {
bool Configuration::Save(const Path& full_path) const {
assert(!full_path.Empty());

QJsonObject root;
Expand Down
2 changes: 1 addition & 1 deletion vkconfig_core/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Configuration {
static Configuration Create(const LayerManager& layers, const std::string& configuration_key);

bool Load(const Path& full_path, const LayerManager& layers);
bool Save(const Path& full_path, bool exporter = false) const;
bool Save(const Path& full_path) const;
void Reset(const LayerManager& layers);

Parameter* Find(const std::string& layer_key);
Expand Down
20 changes: 7 additions & 13 deletions vkconfig_core/configuration_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,6 @@ void ConfigurationManager::SortConfigurations() {
std::sort(this->available_configurations.begin(), this->available_configurations.end(), Compare());
}

std::vector<ReferencedLayer> ConfigurationManager::BuildReferencedLayers(const LayerManager &layers, const Path &path) {
std::vector<ReferencedLayer> result;

layers.GatherLayerNames();

return result;
}

void ConfigurationManager::LoadConfigurationsPath(const LayerManager &layers) {
const std::vector<Path> &configuration_files = CollectFilePaths(Get(Path::CONFIGS));
for (std::size_t i = 0, n = configuration_files.size(); i < n; ++i) {
Expand Down Expand Up @@ -350,7 +342,8 @@ void ConfigurationManager::RenameConfiguration(const std::string &old_configurat
this->SortConfigurations();
}

bool ConfigurationManager::ImportConfiguration(const LayerManager &layers, const Path &full_import_path) {
bool ConfigurationManager::ImportConfiguration(const LayerManager &layers, const Path &full_import_path,
std::string &configuration_name) {
assert(!full_import_path.Empty());

this->last_path_import_config = full_import_path.AbsoluteDir();
Expand All @@ -360,17 +353,18 @@ bool ConfigurationManager::ImportConfiguration(const LayerManager &layers, const
return false;
}

configuration.key = MakeConfigurationName(this->available_configurations, configuration.key + " (Imported)");
configuration_name = configuration.key =
MakeConfigurationName(this->available_configurations, configuration.key + " (Imported)");
this->available_configurations.push_back(configuration);
this->SortConfigurations();

// this->GetActiveConfigurationInfo()->name = configuration.key;

return true;
}

bool ConfigurationManager::ExportConfiguration(const LayerManager &layers, const Path &full_export_path,
const std::string &configuration_name) {
(void)layers;

assert(!configuration_name.empty());
assert(!full_export_path.Empty());

Expand All @@ -379,5 +373,5 @@ bool ConfigurationManager::ExportConfiguration(const LayerManager &layers, const
Configuration *configuration = this->FindConfiguration(configuration_name);
assert(configuration);

return configuration->Save(full_export_path, true);
return configuration->Save(full_export_path);
}
4 changes: 1 addition & 3 deletions vkconfig_core/configuration_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ConfigurationManager : public Serialize {
int GetConfigurationIndex(const std::string& configuration_name) const;

void RenameConfiguration(const std::string& old_configuration_name, const std::string& new_configuration_name);
bool ImportConfiguration(const LayerManager& layers, const Path& full_import_path);
bool ImportConfiguration(const LayerManager& layers, const Path& full_import_path, std::string& configuration_name);
bool ExportConfiguration(const LayerManager& layers, const Path& full_export_path, const std::string& configuration_name);

const Configuration* FindConfiguration(const std::string& configuration_name) const;
Expand All @@ -62,8 +62,6 @@ class ConfigurationManager : public Serialize {
bool IsDefaultConfiguration(const std::string& configuration_key) const;
void ResetDefaultConfigurations(const LayerManager& layers);

std::vector<ReferencedLayer> BuildReferencedLayers(const LayerManager& layers, const Path& path);

bool Empty() const { return this->available_configurations.empty(); }

bool HasFile(const Configuration& configuration) const;
Expand Down
1 change: 0 additions & 1 deletion vkconfig_core/layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ LayerControl Layer::GetActualControl() const {
std::string Layer::GetActualControlTooltip() const {
if (this->type == LAYER_TYPE_IMPLICIT) {
if (!this->disable_env.empty()) {
const std::string& value = qgetenv(this->disable_env.c_str()).toStdString();
if (qEnvironmentVariableIsSet(this->disable_env.c_str())) {
return format("'%s' is set", this->disable_env.c_str());
}
Expand Down
4 changes: 0 additions & 4 deletions vkconfig_gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason) {
case QSystemTrayIcon::Context:
break;
case QSystemTrayIcon::DoubleClick:
Qt::WindowStates window_states = this->windowState();
const bool is_minimized = this->isMinimized();
const bool is_visible = this->isVisible();
const bool is_hidden = this->isHidden();
if (this->isMinimized() || this->isHidden()) {
this->setVisible(true);
this->showNormal();
Expand Down
3 changes: 0 additions & 3 deletions vkconfig_gui/settings_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@

#include <cassert>

static const char *TOOLTIP_ORDER =
"Layers are executed between the Vulkan application and driver in the specific order represented here";

SettingsTreeManager::SettingsTreeManager(std::shared_ptr<Ui::MainWindow> ui) : ui(ui) {
assert(ui.get() != nullptr);

Expand Down
9 changes: 7 additions & 2 deletions vkconfig_gui/tab_about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,16 @@ TabAbout::TabAbout(MainWindow &window, std::shared_ptr<Ui::MainWindow> ui) : Tab

TabAbout::~TabAbout() {}

void TabAbout::UpdateUI(UpdateUIMode mode) {}
void TabAbout::UpdateUI(UpdateUIMode mode) { (void)mode; }

void TabAbout::CleanUI() {}

bool TabAbout::EventFilter(QObject *target, QEvent *event) { return false; }
bool TabAbout::EventFilter(QObject *target, QEvent *event) {
(void)target;
(void)event;

return false;
}

void TabAbout::on_about_lunarg_pushButton_pressed() {
QDesktopServices::openUrl(QUrl("https://www.lunarg.com/", QUrl::TolerantMode));
Expand Down
7 changes: 6 additions & 1 deletion vkconfig_gui/tab_applications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ void TabApplications::UpdateUI(UpdateUIMode mode) {

void TabApplications::CleanUI() { this->ResetLaunchApplication(); }

bool TabApplications::EventFilter(QObject *target, QEvent *event) { return false; }
bool TabApplications::EventFilter(QObject *target, QEvent *event) {
(void)target;
(void)event;

return false;
}

void TabApplications::on_launch_executable_search_pressed() {
Configurator &configurator = Configurator::Get();
Expand Down
11 changes: 10 additions & 1 deletion vkconfig_gui/tab_configurations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ TabConfigurations::~TabConfigurations() {
}

void TabConfigurations::UpdateUI_Configurations(UpdateUIMode ui_update_mode) {
(void)mode;

Configurator &configurator = Configurator::Get();

ui->configurations_executable_scope->blockSignals(true);
Expand Down Expand Up @@ -220,6 +222,8 @@ void TabConfigurations::UpdateUI_LoaderMessages() {
}

void TabConfigurations::UpdateUI_Layers(UpdateUIMode mode) {
(void)mode;

ui->configurations_layers_list->blockSignals(true);
ui->configurations_layers_list->clear();

Expand Down Expand Up @@ -272,6 +276,8 @@ void TabConfigurations::UpdateUI_Layers(UpdateUIMode mode) {
}

void TabConfigurations::UpdateUI_Settings(UpdateUIMode mode) {
(void)mode;

Configurator &configurator = Configurator::Get();

if (configurator.GetActiveConfiguration() == nullptr) {
Expand Down Expand Up @@ -582,10 +588,13 @@ void TabConfigurations::OnContextMenuImportClicked(ListItem *item) {
return;
}

const bool result = configurator.configurations.ImportConfiguration(configurator.layers, selected_path);
std::string configuration_name;
const bool result = configurator.configurations.ImportConfiguration(configurator.layers, selected_path, configuration_name);

if (result) {
configurator.SetActiveConfigurationName(configuration_name);
configurator.Override(OVERRIDE_AREA_ALL);

this->UpdateUI_Configurations(UPDATE_REBUILD_UI);
this->UpdateUI_LoaderMessages();
this->UpdateUI_Layers(UPDATE_REBUILD_UI);
Expand Down
7 changes: 6 additions & 1 deletion vkconfig_gui/tab_diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ void TabDiagnostics::UpdateUI(UpdateUIMode mode) {

void TabDiagnostics::CleanUI() {}

bool TabDiagnostics::EventFilter(QObject *target, QEvent *event) { return false; }
bool TabDiagnostics::EventFilter(QObject *target, QEvent *event) {
(void)target;
(void)event;

return false;
}

void TabDiagnostics::on_diagnostic_keep_running_toggled(bool checked) {
Configurator &configurator = Configurator::Get();
Expand Down
9 changes: 7 additions & 2 deletions vkconfig_gui/tab_documentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ TabDocumentation::TabDocumentation(MainWindow &window, std::shared_ptr<Ui::MainW

TabDocumentation::~TabDocumentation() {}

void TabDocumentation::UpdateUI(UpdateUIMode mode) {}
void TabDocumentation::UpdateUI(UpdateUIMode mode) { (void)mode; }

void TabDocumentation::CleanUI() {}

bool TabDocumentation::EventFilter(QObject *target, QEvent *event) { return false; }
bool TabDocumentation::EventFilter(QObject *target, QEvent *event) {
(void)target;
(void)event;

return false;
}
1 change: 1 addition & 0 deletions vkconfig_gui/vkconfig.pro
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CONFIG += sdk_no_version_check

INCLUDEPATH += ../external/Vulkan-Headers/include
INCLUDEPATH += ../Vulkan-Headers/include
INCLUDEPATH += ../external/Debug/64/Vulkan-Headers/include

# Ignore JSON validation
DEFINES += JSON_VALIDATION_OFF
Expand Down
2 changes: 1 addition & 1 deletion vkconfig_gui/widget_tab_configurations_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ConfigurationLayerWidget : public QLabel {
std::string layer_name;

protected:
bool eventFilter(QObject *target, QEvent *event);
bool eventFilter(QObject *target, QEvent *event) override;
void resizeEvent(QResizeEvent *event) override;

public Q_SLOTS:
Expand Down
2 changes: 2 additions & 0 deletions vkconfig_gui/widget_tab_layers_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ void LayersPathWidget::resizeEvent(QResizeEvent* event) {
}

void LayersPathWidget::on_buttom_remove_clicked(bool checked) {
(void)checked;

Configurator& configurator = Configurator::Get();

std::vector<ReferencedLayer> referenced_layers;
Expand Down

0 comments on commit fe6a846

Please sign in to comment.