Fix spdlog errors during build caused by wxString

This commit is contained in:
apoorv569 2025-09-24 16:11:56 +05:30
parent 3f2bb4551c
commit 97963fd52c
7 changed files with 31 additions and 31 deletions

View File

@ -902,7 +902,7 @@ wxArrayString cDatabase::CheckDuplicates(const wxArrayString &files)
if (sqlite3_step(statement.stmt) != SQLITE_ROW)
sorted_files.push_back(files[i]);
else
SH_LOG_INFO("Already added: {}, skipping..", files[i]);
SH_LOG_INFO("Already added: {}, skipping..", files[i].ToStdString());
rc = sqlite3_clear_bindings(statement.stmt);
rc = sqlite3_reset(statement.stmt);

View File

@ -454,11 +454,11 @@ void cSettings::SetShowExtension(bool value)
void cSettings::PrintFont()
{
SH_LOG_DEBUG("Font face: {}", m_Font.GetFaceName());
SH_LOG_DEBUG("Font face: {}", m_Font.GetFaceName().ToStdString());
SH_LOG_DEBUG("Font size: {}", m_Font.GetPointSize());
SH_LOG_DEBUG("Font family: {}", m_Font.GetFamilyString());
SH_LOG_DEBUG("Font style: {}", m_Font.GetStyleString());
SH_LOG_DEBUG("Font weight: {}", m_Font.GetWeightString());
SH_LOG_DEBUG("Font family: {}", m_Font.GetFamilyString().ToStdString());
SH_LOG_DEBUG("Font style: {}", m_Font.GetStyleString().ToStdString());
SH_LOG_DEBUG("Font weight: {}", m_Font.GetWeightString().ToStdString());
}
void cSettings::SetCustomFont()

View File

@ -69,7 +69,7 @@ void LogDragResult(wxDragResult result)
default: msg = "Huh?"; break;
}
SH_LOG_DEBUG("Drag result: {}", msg);
SH_LOG_DEBUG("Drag result: {}", msg.ToStdString());
}
void cDirectoryBrowser::OnDragFromDirCtrl(wxTreeEvent& event)

View File

@ -115,7 +115,7 @@ void cHivesPanel::OnDragAndDropToHives(wxDropFilesEvent& event)
wxString file_name = serializer.DeserializeShowFileExtension() ?
files[i].BeforeLast('.') : files[i];
SH_LOG_DEBUG("Dropping {} file(s) {} on {}", rows - i, files[i], m_pHives->GetItemText(drop_target));
SH_LOG_DEBUG("Dropping {} file(s) {} on {}", rows - i, files[i].ToStdString(), m_pHives->GetItemText(drop_target).ToStdString());
if (drop_target.IsOk() && m_pHives->IsContainer(drop_target) &&
db.GetFavoriteColumnValueByFilename(file_name.ToStdString()) == 0)
@ -219,7 +219,7 @@ void cHivesPanel::OnShowHivesContextMenu(wxDataViewEvent& event)
if (m_pHives->GetItemText(current_item) == hive_name)
{
found_item = current_item;
SH_LOG_DEBUG("Found item: {}", m_pHives->GetItemText(current_item));
SH_LOG_DEBUG("Found item: {}", m_pHives->GetItemText(current_item).ToStdString());
break;
}
@ -575,7 +575,7 @@ void cHivesPanel::OnClickAddHive(wxCommandEvent& event)
if (m_pHives->GetItemText(current_item) == hive_name)
{
found_item = current_item;
SH_LOG_DEBUG("Found item: {}", m_pHives->GetItemText(current_item));
SH_LOG_DEBUG("Found item: {}", m_pHives->GetItemText(current_item).ToStdString());
break;
}

View File

@ -359,7 +359,7 @@ void cListCtrl::OnDragFromLibrary(wxDataViewEvent& event)
fileData->AddFile(sample_path);
event.SetDataObject(fileData);
SH_LOG_DEBUG("Started dragging '{}'.", sample_path);
SH_LOG_DEBUG("Started dragging '{}'.", sample_path.ToStdString());
}
void cListCtrl::OnShowLibraryContextMenu(wxDataViewEvent& event)

View File

@ -291,13 +291,13 @@ void cMainFrame::LoadConfigFile()
// Check if SampleHive configuration directory exist and create it if not
if (!wxDirExists(APP_CONFIG_DIR))
{
SH_LOG_WARN("Configuration directory not found. Creating directory at {}", APP_CONFIG_DIR);
SH_LOG_WARN("Configuration directory not found. Creating directory at {}", static_cast<std::string>(APP_CONFIG_DIR));
if (wxFileName::Mkdir(APP_CONFIG_DIR, wxPOSIX_USER_READ | wxPOSIX_USER_WRITE | wxPOSIX_USER_EXECUTE |
wxPOSIX_GROUP_READ | wxPOSIX_GROUP_EXECUTE |
wxPOSIX_OTHERS_READ | wxPOSIX_OTHERS_EXECUTE, wxPATH_MKDIR_FULL))
{
SH_LOG_INFO("Successfully created configuration directory at {}", APP_CONFIG_DIR);
SH_LOG_INFO("Successfully created configuration directory at {}", static_cast<std::string>(APP_CONFIG_DIR));
}
else
{
@ -306,18 +306,18 @@ void cMainFrame::LoadConfigFile()
}
}
else
SH_LOG_INFO("Found {} directory.", APP_CONFIG_DIR);
SH_LOG_INFO("Found {} directory.", static_cast<std::string>(APP_CONFIG_DIR));
// Check if SampleHive data directory exist and create it if not
if (!wxDirExists(APP_DATA_DIR))
{
SH_LOG_WARN("Data directory not found. Creating directory at {}", APP_DATA_DIR);
SH_LOG_WARN("Data directory not found. Creating directory at {}", static_cast<std::string>(APP_DATA_DIR));
if (wxFileName::Mkdir(APP_DATA_DIR, wxPOSIX_USER_READ | wxPOSIX_USER_WRITE | wxPOSIX_USER_EXECUTE |
wxPOSIX_GROUP_READ | wxPOSIX_GROUP_EXECUTE |
wxPOSIX_OTHERS_READ | wxPOSIX_OTHERS_EXECUTE, wxPATH_MKDIR_FULL))
{
SH_LOG_INFO("Successfully created data directory at {}", APP_DATA_DIR);
SH_LOG_INFO("Successfully created data directory at {}", static_cast<std::string>(APP_DATA_DIR));
}
else
{
@ -326,7 +326,7 @@ void cMainFrame::LoadConfigFile()
}
}
else
SH_LOG_INFO("Found {} directory.", APP_DATA_DIR);
SH_LOG_INFO("Found {} directory.", static_cast<std::string>(APP_DATA_DIR));
SampleHive::cSerializer serializer;
@ -400,7 +400,7 @@ void cMainFrame::CreateWatcher()
if (serializer.DeserializeAutoImport().first)
{
SH_LOG_INFO("Adding watch entry: {}", path);
SH_LOG_INFO("Adding watch entry: {}", path.ToStdString());
if (serializer.DeserializeRecursiveImport())
AddWatchEntry(wxFSWPath_Tree, path.ToStdString());
@ -429,7 +429,7 @@ void cMainFrame::AddWatchEntry(wxFSWPathType type, std::string path)
if (!filename.IsOk() || !filename.IsDir() || !filename.IsDirReadable())
{
SH_LOG_ERROR("Error! Something wrong with {} path", filename.GetFullPath());
SH_LOG_ERROR("Error! Something wrong with {} path", filename.GetFullPath().ToStdString());
return;
}
@ -456,7 +456,7 @@ void cMainFrame::AddWatchEntry(wxFSWPathType type, std::string path)
if (!ok)
{
SH_LOG_ERROR("Error! Cannot add '{}' to watched paths", filename.GetPath());
SH_LOG_ERROR("Error! Cannot add '{}' to watched paths", filename.GetPath().ToStdString());
return;
}
}
@ -472,31 +472,31 @@ void cMainFrame::OnFileSystemEvent(wxFileSystemWatcherEvent& event)
wxArrayString files;
files.push_back(path);
SH_LOG_DEBUG("{} {}", path, event.ToString());
SH_LOG_DEBUG("{} {}", path.ToStdString(), event.ToString().ToStdString());
switch (type)
{
case wxFSW_EVENT_CREATE:
SH_LOG_INFO("NEW FILES DETECTED, ADDING: {}", path);
SH_LOG_INFO("NEW FILES DETECTED, ADDING: {}", path.ToStdString());
SampleHive::cUtils::Get().AddSamples(files, this);
break;
case wxFSW_EVENT_ACCESS:
SH_LOG_INFO("ACCESSING DIRECTORY: {}", path);
SH_LOG_INFO("ACCESSING DIRECTORY: {}", path.ToStdString());
break;
case wxFSW_EVENT_DELETE:
SH_LOG_INFO("FILES DELETED IN DIRECTORY: {}", path);
SH_LOG_INFO("FILES DELETED IN DIRECTORY: {}", path.ToStdString());
break;
case wxFSW_EVENT_MODIFY:
SH_LOG_INFO("DIRECTORY MODIFIED: {}", path);
SH_LOG_INFO("DIRECTORY MODIFIED: {}", path.ToStdString());
break;
case wxFSW_EVENT_RENAME:
SH_LOG_INFO("FILES RENAMED IN DIRECTORY: {}", event.GetNewPath().GetFullPath());
SH_LOG_INFO("FILES RENAMED IN DIRECTORY: {}", event.GetNewPath().GetFullPath().ToStdString());
break;
case wxFSW_EVENT_WARNING:
SH_LOG_INFO("Filesystem watcher warning: {}", event.GetWarningType());
SH_LOG_INFO("Filesystem watcher warning: {}", static_cast<int>(event.GetWarningType()));
break;
case wxFSW_EVENT_ERROR:
SH_LOG_INFO("Error! Filesystem watcher: {}", event.GetErrorDescription());
SH_LOG_INFO("Error! Filesystem watcher: {}", event.GetErrorDescription().ToStdString());
break;
default:
break;
@ -817,7 +817,7 @@ void cMainFrame::OnRecieveLoopPoints(SampleHive::cLoopPointsEvent& event)
int loopB_min = static_cast<int>((m_LoopB / 60000).GetValue());
int loopB_sec = static_cast<int>(((m_LoopB % 60000) / 1000).GetValue());
SH_LOG_INFO(wxString::Format(_("Loop points set: A: %2i:%02i, B: %2i:%02i"), loopA_min, loopA_sec, loopB_min, loopB_sec));
SH_LOG_INFO("Loop points set: A: {:2}:{:02}, B: {:2}:{:02}", loopA_min, loopA_sec, loopB_min, loopB_sec);
m_pTransportControls->SetLoopABValue(true);
@ -923,7 +923,7 @@ void cMainFrame::PlaySample(const std::string& filepath, const std::string& samp
// TODO: Remove these lines (for debugging only)
float bpm = SampleHive::cUtils::Get().GetBPM(filepath);
wxString bpm_str = SampleHive::cUtils::Get().GetBPMString(bpm);
SH_LOG_DEBUG("BPM: {}, BPM_STR: {}", bpm, bpm_str);
SH_LOG_DEBUG("BPM: {}, BPM_STR: {}", bpm, bpm_str.ToStdString());
// ====================================================
PushStatusText(wxString::Format(_("Now playing: %s"), sample), 1);

View File

@ -174,7 +174,7 @@ void cTrashPanel::OnShowTrashContextMenu(wxTreeEvent& event)
m_pTrash->Delete(selected_trashed_item);
SH_LOG_INFO("{} deleted from trash and databse", trashed_item_name);
SH_LOG_INFO("{} deleted from trash and databse", trashed_item_name.ToStdString());
}
break;
case SampleHive::ID::MN_RestoreTrashedItem:
@ -226,7 +226,7 @@ void cTrashPanel::OnShowTrashContextMenu(wxTreeEvent& event)
m_pTrash->Delete(selected_item_ids[i]);
SH_LOG_INFO("{} restored from trash", files[i]);
SH_LOG_INFO("{} restored from trash", files[i].ToStdString());
}
}
break;