Qt: Fix compile issues on Linux

This commit is contained in:
Connor McLaughlin 2022-03-26 18:48:23 +10:00 committed by refractionpcsx2
parent 9ac5041b43
commit 2ab6ca06ed
3 changed files with 14 additions and 6 deletions

View File

@ -47,6 +47,10 @@ CreateMemoryCardDialog::CreateMemoryCardDialog(QWidget* parent /* = nullptr */)
connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &CreateMemoryCardDialog::close);
connect(m_ui.buttonBox->button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, this, &CreateMemoryCardDialog::restoreDefaults);
#ifdef _WIN32
m_ui.ntfsCompression->setEnabled(false);
#endif
updateState();
}
@ -96,7 +100,9 @@ void CreateMemoryCardDialog::updateState()
const bool okay = (m_ui.name->text().length() > 4);
m_ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(okay);
#ifdef _WIN32
m_ui.ntfsCompression->setEnabled(m_type == MemoryCardType::File);
#endif
}
void CreateMemoryCardDialog::createCard()
@ -117,11 +123,13 @@ void CreateMemoryCardDialog::createCard()
return;
}
#ifdef _WIN32
if (m_ui.ntfsCompression->isChecked() && m_type == MemoryCardType::File)
{
const std::string fullPath(Path::CombineStdString(EmuFolders::MemoryCards, nameStr));
NTFS_CompressFile(StringUtil::UTF8StringToWxString(fullPath), true);
}
#endif
QMessageBox::information(this, tr("Create Memory Card"), tr("Memory card '%1' created.").arg(name));
accept();

View File

@ -39,8 +39,8 @@ public:
void refresh(SettingsDialog* dialog);
protected:
void mousePressEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event);
void mousePressEvent(QMouseEvent* event) override;
void mouseMoveEvent(QMouseEvent* event) override;
private:
QPoint m_dragStartPos = {};
@ -60,9 +60,9 @@ public:
void setCard(const std::optional<std::string>& name);
protected:
void dragEnterEvent(QDragEnterEvent* event);
void dragMoveEvent(QDragMoveEvent* event);
void dropEvent(QDropEvent* event);
void dragEnterEvent(QDragEnterEvent* event) override;
void dragMoveEvent(QDragMoveEvent* event) override;
void dropEvent(QDropEvent* event) override;
};
// Must be included *after* the custom widgets.

View File

@ -176,7 +176,7 @@
<customwidget>
<class>MemoryCardListWidget</class>
<extends>QTreeWidget</extends>
<header>MemoryCardSettingsWidget.h</header>
<header>Settings/MemoryCardSettingsWidget.h</header>
</customwidget>
</customwidgets>
<resources/>