mirror of
https://github.com/markdavidlong/AppleSAWS.git
synced 2026-03-10 23:25:02 +00:00
Changed viewer UI files to use unique_ptr instances
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
ApplesoftFileDetailViewer::ApplesoftFileDetailViewer(ApplesoftFile *file, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::ApplesoftFileDetailViewer)
|
||||
ui(std::make_unique<Ui::ApplesoftFileDetailViewer>())
|
||||
{
|
||||
|
||||
ui->setupUi(this);
|
||||
@@ -24,7 +24,6 @@ ApplesoftFileDetailViewer::ApplesoftFileDetailViewer(ApplesoftFile *file, QWidge
|
||||
ApplesoftFileDetailViewer::~ApplesoftFileDetailViewer()
|
||||
{
|
||||
save();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ApplesoftFileDetailViewer::setLineData(QList<ApplesoftLine> lineData)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <QWidget>
|
||||
#include <QDebug>
|
||||
#include <memory>
|
||||
|
||||
namespace Ui {
|
||||
class ApplesoftFileDetailViewer;
|
||||
@@ -30,7 +31,7 @@ protected:
|
||||
private:
|
||||
void process();
|
||||
|
||||
Ui::ApplesoftFileDetailViewer *ui;
|
||||
std::unique_ptr<Ui::ApplesoftFileDetailViewer> ui;
|
||||
QList<ApplesoftLine> m_lines;
|
||||
|
||||
QMap<QString,QString> m_notes;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
ApplesoftFileViewer::ApplesoftFileViewer(QWidget *parent) :
|
||||
FileViewerInterface(parent),
|
||||
ui(new Ui::ApplesoftFileViewer)
|
||||
ui(std::make_unique<Ui::ApplesoftFileViewer>())
|
||||
{
|
||||
ui->setupUi(this);
|
||||
m_afdv = Q_NULLPTR;
|
||||
@@ -62,7 +62,6 @@ ApplesoftFileViewer::~ApplesoftFileViewer()
|
||||
{
|
||||
m_afdv->deleteLater();
|
||||
}
|
||||
delete ui;
|
||||
}
|
||||
|
||||
bool ApplesoftFileViewer::makeMenuOptions(QMenu *menu)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <QAction>
|
||||
#include <QWidget>
|
||||
#include <QMenu>
|
||||
#include <memory>
|
||||
|
||||
namespace Ui {
|
||||
class ApplesoftFileViewer;
|
||||
@@ -69,7 +70,7 @@ private:
|
||||
ApplesoftFile *m_file;
|
||||
ApplesoftFormatter *m_formatter;
|
||||
bool m_isFirstFind;
|
||||
Ui::ApplesoftFileViewer *ui;
|
||||
std::unique_ptr<Ui::ApplesoftFileViewer> ui;
|
||||
ApplesoftFileDetailViewer *m_afdv;
|
||||
QAction *m_showIntsAction;
|
||||
QAction *m_reindentCodeAction;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
DisassemblerViewer::DisassemblerViewer(QWidget *parent) :
|
||||
FileViewerInterface(parent),
|
||||
ui(new Ui::DisassemblerViewer)
|
||||
ui(std::make_unique<Ui::DisassemblerViewer>())
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QFont textAreaFont;
|
||||
@@ -41,7 +41,6 @@ DisassemblerViewer::DisassemblerViewer(QWidget *parent) :
|
||||
|
||||
DisassemblerViewer::~DisassemblerViewer()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DisassemblerViewer::setTextFont(const QFont &font)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <QWidget>
|
||||
#include <QByteArray>
|
||||
#include <memory>
|
||||
|
||||
class BinaryFile;
|
||||
class RelocatableFile;
|
||||
@@ -50,7 +51,7 @@ protected:
|
||||
protected slots:
|
||||
void showMetadataDialog();
|
||||
private:
|
||||
Ui::DisassemblerViewer *ui;
|
||||
std::unique_ptr<Ui::DisassemblerViewer> ui;
|
||||
|
||||
DisassemblerMetadataDialog *m_dmd;
|
||||
GenericFile *m_file;
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
|
||||
HexDumpViewer::HexDumpViewer(QWidget *parent, int defaultFontSize) :
|
||||
FileViewerInterface(parent),
|
||||
ui(new Ui::HexDumpViewer)
|
||||
ui(std::make_unique<Ui::HexDumpViewer>()),
|
||||
m_defaultFontSize(defaultFontSize)
|
||||
{
|
||||
m_defaultFontSize = defaultFontSize;
|
||||
QFont textAreaFont;
|
||||
textAreaFont.setStyleHint(QFont::Monospace);
|
||||
|
||||
@@ -39,7 +39,6 @@ HexDumpViewer::HexDumpViewer(QWidget *parent, int defaultFontSize) :
|
||||
|
||||
HexDumpViewer::~HexDumpViewer()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void HexDumpViewer::toggleWordWrap(bool enabled)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <QString>
|
||||
#include <QByteArray>
|
||||
#include <QWidget>
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
@@ -43,7 +44,7 @@ private:
|
||||
|
||||
QAction *m_setFontAction;
|
||||
int m_defaultFontSize;
|
||||
Ui::HexDumpViewer *ui;
|
||||
std::unique_ptr<Ui::HexDumpViewer> ui;
|
||||
|
||||
quint16 m_offset;
|
||||
QByteArray m_data;
|
||||
|
||||
@@ -3,14 +3,13 @@
|
||||
|
||||
IntBasicFileViewer::IntBasicFileViewer(QWidget *parent) :
|
||||
FileViewerInterface(parent),
|
||||
ui(new Ui::IntBasicFileViewer)
|
||||
ui(std::make_unique<Ui::IntBasicFileViewer>())
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
IntBasicFileViewer::~IntBasicFileViewer()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void IntBasicFileViewer::setFile(GenericFile *file) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "FileViewerInterface.h"
|
||||
#include "IntBasicFile.h"
|
||||
#include <memory>
|
||||
|
||||
namespace Ui {
|
||||
class IntBasicFileViewer;
|
||||
@@ -21,6 +22,6 @@ public slots:
|
||||
void setFile(GenericFile *file);
|
||||
|
||||
private:
|
||||
Ui::IntBasicFileViewer *ui;
|
||||
std::unique_ptr<Ui::IntBasicFileViewer> ui;
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
TextHexDumpViewer::TextHexDumpViewer(QWidget *parent) :
|
||||
FileViewerInterface(parent),
|
||||
ui(new Ui::TextHexDumpViewer)
|
||||
ui(std::make_unique<Ui::TextHexDumpViewer>())
|
||||
{
|
||||
m_file = Q_NULLPTR;
|
||||
ui->setupUi(this);
|
||||
@@ -30,7 +30,6 @@ TextHexDumpViewer::TextHexDumpViewer(QWidget *parent) :
|
||||
|
||||
TextHexDumpViewer::~TextHexDumpViewer()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TextHexDumpViewer::toggleWordWrap(bool enabled)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <QString>
|
||||
#include <QByteArray>
|
||||
#include <QWidget>
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
@@ -40,7 +41,7 @@ protected:
|
||||
QString makeHexStr(QByteArray data);
|
||||
|
||||
private:
|
||||
Ui::TextHexDumpViewer *ui;
|
||||
std::unique_ptr<Ui::TextHexDumpViewer> ui;
|
||||
|
||||
quint16 m_offset;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
ViewerBase::ViewerBase(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::ViewerBase)
|
||||
ui(std::make_unique<Ui::ViewerBase>())
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
@@ -49,7 +49,6 @@ ViewerBase::ViewerBase(QWidget *parent) :
|
||||
ViewerBase::~ViewerBase()
|
||||
{
|
||||
emit viewerClosing(this);
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ViewerBase::setFile(GenericFile *file)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <QStackedWidget>
|
||||
#include <QToolBar>
|
||||
#include <QComboBox>
|
||||
#include <memory>
|
||||
|
||||
namespace Ui {
|
||||
class ViewerBase;
|
||||
@@ -33,7 +34,7 @@ protected:
|
||||
void addViewer(QString descriptor, FileViewerInterface *viewer);
|
||||
|
||||
private:
|
||||
Ui::ViewerBase *ui;
|
||||
std::unique_ptr<Ui::ViewerBase> ui;
|
||||
QStackedWidget *m_stack;
|
||||
QToolBar *m_toolbar;
|
||||
QComboBox *m_viewercombo;
|
||||
|
||||
Reference in New Issue
Block a user