diff --git a/src/Modules/Tabs/CodeEditor/codeeditortab.cpp b/src/Modules/Tabs/CodeEditor/codeeditortab.cpp index 89f49734..e31cd0f0 100644 --- a/src/Modules/Tabs/CodeEditor/codeeditortab.cpp +++ b/src/Modules/Tabs/CodeEditor/codeeditortab.cpp @@ -112,7 +112,7 @@ CodeEditorTab::CodeEditorTab(QWidget* parent) connect(m_replaceButton, &QPushButton::clicked, this, &CodeEditorTab::replaceCurrent); connect(m_replaceAllButton, &QPushButton::clicked, this, &CodeEditorTab::replaceAll); connect(m_searchCloseButton, &QPushButton::clicked, this, &CodeEditorTab::closeSearchBar); - connect(m_matchCaseCheckBox, &QCheckBox::stateChanged, this, [this](int) { + connect(m_matchCaseCheckBox, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState) { updateSearchUi(); }); diff --git a/src/Modules/Tabs/Disassembler/disassemblertab.cpp b/src/Modules/Tabs/Disassembler/disassemblertab.cpp index dd057c3a..9447a15e 100644 --- a/src/Modules/Tabs/Disassembler/disassemblertab.cpp +++ b/src/Modules/Tabs/Disassembler/disassemblertab.cpp @@ -1034,7 +1034,7 @@ void DisassemblerTab::setFunctionsList(const QVector &funcs) for (const auto &f : sorted) { auto *it = new QListWidgetItem(QString("%1 %2").arg(f.address, f.name), m_funcList); - it->setData(Qt::UserRole, f.address); + it->setData(Qt::UserRole, f.address); } } diff --git a/src/app/IDEWindow/idewindow.cpp b/src/app/IDEWindow/idewindow.cpp index 92cdc1dc..27e2ed6f 100644 --- a/src/app/IDEWindow/idewindow.cpp +++ b/src/app/IDEWindow/idewindow.cpp @@ -18,7 +18,7 @@ IDEWindow::IDEWindow(const QString &ProjectPath, QWidget *parent) // - - Menu Bar - - auto const menu = menuBar(); - MenuBarBuilder const *menuBarBuilder = new MenuBarBuilder(menu, this); + MenuBarBuilder menuBarBuilder(menu, this); menu->setNativeMenuBar(false); // - - Widgets - - diff --git a/src/core/file/FileDataBuffer.cpp b/src/core/file/FileDataBuffer.cpp index 5acfa249..95fceab6 100644 --- a/src/core/file/FileDataBuffer.cpp +++ b/src/core/file/FileDataBuffer.cpp @@ -79,7 +79,10 @@ void FileDataBuffer::loadData(const QByteArray& data) resetOverlayLocked(); m_undoStack.clear(); m_redoStack.clear(); - m_originalHash = qHash(data, 0); + QCryptographicHash hash(QCryptographicHash::Sha256); + hash.addData(data); + m_originalHash = 0; + memcpy(&m_originalHash, hash.result().constData(), qMin(static_cast(sizeof(m_originalHash)), hash.result().size())); locker.unlock(); emit dataChanged(); } diff --git a/src/core/modules/ModuleManager.h b/src/core/modules/ModuleManager.h index 34f9f159..2c2816dc 100644 --- a/src/core/modules/ModuleManager.h +++ b/src/core/modules/ModuleManager.h @@ -22,7 +22,7 @@ class ModuleManager { static ModuleManager& instance(); template - void registerModule(std::function name, const QString &group, std::function creator, int position = 0) const { + void registerModule(std::function name, const QString &group, std::function creator, int position = 0) { ModuleDescription desc{ std::move(creator), std::move(name), diff --git a/src/widgets/filetreepanel.cpp b/src/widgets/filetreepanel.cpp index 0e863c31..6186e8ee 100644 --- a/src/widgets/filetreepanel.cpp +++ b/src/widgets/filetreepanel.cpp @@ -111,7 +111,10 @@ void FileTreePanel::open() { } void FileTreePanel::remove() const { - const QString body = tr("Are you sure you want to delete the file \"%1\"?").arg(m_fileModel->fileName(getSourceIndex())); + const QModelIndex srcIdx = getSourceIndex(); + if (!srcIdx.isValid()) return; + + const QString body = tr("Are you sure you want to delete the file \"%1\"?").arg(m_fileModel->fileName(srcIdx)); QMessageBox confirmRemove(QMessageBox::Question, tr("Delete"), body, QMessageBox::NoButton); [[maybe_unused]] const auto yes = confirmRemove.addButton(tr("Yes"), QMessageBox::YesRole); @@ -121,7 +124,7 @@ void FileTreePanel::remove() const { const auto reply = confirmRemove.clickedButton(); if (reply == no) return; - m_fileModel->remove(getSourceIndex()); + m_fileModel->remove(srcIdx); } QModelIndex FileTreePanel::getSourceIndex() const{