Reduce usage of moc.
This commit is contained in:
parent
75adb928fe
commit
6c78120883
|
@ -657,7 +657,7 @@
|
|||
<customwidget>
|
||||
<class>KColorButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>kcolorbutton.h</header>
|
||||
<header>KColorButton</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
|
|
|
@ -121,6 +121,9 @@ EditMountPointDialogWidget::EditMountPointDialogWidget(QWidget* parent, const Pa
|
|||
if (radioLabel().isChecked())
|
||||
radioDeviceNode().setChecked(true);
|
||||
}
|
||||
|
||||
connect(m_ButtonMore, &QPushButton::clicked, this, &EditMountPointDialogWidget::buttonMoreClicked);
|
||||
connect(m_ButtonSelect, &QPushButton::clicked, this, &EditMountPointDialogWidget::buttonSelectClicked);
|
||||
}
|
||||
|
||||
EditMountPointDialogWidget::~EditMountPointDialogWidget()
|
||||
|
@ -141,14 +144,14 @@ void EditMountPointDialogWidget::setupOptions(const QStringList& options)
|
|||
m_Options = optTmpList.join(QStringLiteral(","));
|
||||
}
|
||||
|
||||
void EditMountPointDialogWidget::on_m_ButtonSelect_clicked(bool)
|
||||
void EditMountPointDialogWidget::buttonSelectClicked(bool)
|
||||
{
|
||||
const QString s = QFileDialog::getExistingDirectory(this, editPath().text());
|
||||
if (!s.isEmpty())
|
||||
editPath().setText(s);
|
||||
}
|
||||
|
||||
void EditMountPointDialogWidget::on_m_ButtonMore_clicked(bool)
|
||||
void EditMountPointDialogWidget::buttonMoreClicked(bool)
|
||||
{
|
||||
QPointer<EditMountOptionsDialog> dlg = new EditMountOptionsDialog(this, m_Options.split(QStringLiteral(",")));
|
||||
|
||||
|
|
|
@ -38,13 +38,10 @@ class MountEntry;
|
|||
|
||||
class EditMountPointDialogWidget : public QWidget, public Ui::EditMountPointDialogWidgetBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
EditMountPointDialogWidget(QWidget* parent, const Partition& p);
|
||||
~EditMountPointDialogWidget();
|
||||
|
||||
public:
|
||||
QPushButton& buttonMore() {
|
||||
return *m_ButtonMore;
|
||||
}
|
||||
|
@ -77,9 +74,9 @@ public:
|
|||
bool acceptChanges();
|
||||
bool writeMountpoints(const QString& filename);
|
||||
|
||||
protected Q_SLOTS:
|
||||
void on_m_ButtonSelect_clicked(bool);
|
||||
void on_m_ButtonMore_clicked(bool);
|
||||
protected:
|
||||
void buttonSelectClicked(bool);
|
||||
void buttonMoreClicked(bool);
|
||||
|
||||
private:
|
||||
void setupOptions(const QStringList& options);
|
||||
|
|
|
@ -67,11 +67,6 @@ void ListDevices::on_m_ListDevices_itemSelectionChanged()
|
|||
}
|
||||
}
|
||||
|
||||
void ListDevices::on_m_ListDevices_customContextMenuRequested(const QPoint& pos)
|
||||
{
|
||||
emit contextMenuRequested(listDevices().viewport()->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
void ListDevices::on_m_ListDevices_itemDoubleClicked(QListWidgetItem* list_item)
|
||||
{
|
||||
ListDeviceWidgetItem* item = dynamic_cast<ListDeviceWidgetItem*>(list_item);
|
||||
|
|
|
@ -43,7 +43,6 @@ public:
|
|||
Q_SIGNALS:
|
||||
void selectionChanged(const QString& device_node);
|
||||
void deviceDoubleClicked(const QString& device_node);
|
||||
void contextMenuRequested(const QPoint&);
|
||||
|
||||
public:
|
||||
void setActionCollection(KActionCollection* coll) {
|
||||
|
@ -53,11 +52,11 @@ public:
|
|||
|
||||
void updateDevices(OperationStack::Devices& devices);
|
||||
|
||||
protected:
|
||||
QListWidget& listDevices() {
|
||||
Q_ASSERT(m_ListDevices);
|
||||
return *m_ListDevices;
|
||||
}
|
||||
protected:
|
||||
const QListWidget& listDevices() const {
|
||||
Q_ASSERT(m_ListDevices);
|
||||
return *m_ListDevices;
|
||||
|
@ -66,9 +65,10 @@ protected:
|
|||
return m_ActionCollection;
|
||||
}
|
||||
|
||||
void customContextMenuRequested(const QPoint& pos);
|
||||
|
||||
protected Q_SLOTS:
|
||||
void on_m_ListDevices_itemSelectionChanged();
|
||||
void on_m_ListDevices_customContextMenuRequested(const QPoint& pos);
|
||||
void on_m_ListDevices_itemDoubleClicked(QListWidgetItem* list_item);
|
||||
|
||||
private:
|
||||
|
|
|
@ -48,9 +48,3 @@ void ListOperations::updateOperations(const OperationStack::Operations& ops)
|
|||
|
||||
listOperations().scrollToBottom();
|
||||
}
|
||||
|
||||
void ListOperations::on_m_ListOperations_customContextMenuRequested(const QPoint& pos)
|
||||
{
|
||||
emit contextMenuRequested(listOperations().viewport()->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
|
|
|
@ -35,15 +35,11 @@ class KActionCollection;
|
|||
*/
|
||||
class ListOperations : public QWidget, public Ui::ListOperationsBase
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ListOperations)
|
||||
|
||||
public:
|
||||
ListOperations(QWidget* parent = nullptr);
|
||||
|
||||
Q_SIGNALS:
|
||||
void contextMenuRequested(const QPoint&);
|
||||
|
||||
public:
|
||||
void setActionCollection(KActionCollection* coll) {
|
||||
m_ActionCollection = coll;
|
||||
|
@ -51,22 +47,22 @@ public:
|
|||
|
||||
void updateOperations(const OperationStack::Operations& ops);
|
||||
|
||||
QListWidget& listOperations() {
|
||||
Q_ASSERT(m_ListOperations);
|
||||
return *m_ListOperations;
|
||||
}
|
||||
|
||||
protected:
|
||||
KActionCollection* actionCollection() {
|
||||
return m_ActionCollection;
|
||||
}
|
||||
|
||||
QListWidget& listOperations() {
|
||||
Q_ASSERT(m_ListOperations);
|
||||
return *m_ListOperations;
|
||||
}
|
||||
const QListWidget& listOperations() const {
|
||||
Q_ASSERT(m_ListOperations);
|
||||
return *m_ListOperations;
|
||||
}
|
||||
|
||||
protected Q_SLOTS:
|
||||
void on_m_ListOperations_customContextMenuRequested(const QPoint& pos);
|
||||
void customContextMenuRequested(const QPoint& pos);
|
||||
|
||||
private:
|
||||
KActionCollection* m_ActionCollection;
|
||||
|
|
|
@ -99,6 +99,9 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||
{
|
||||
setupObjectNames();
|
||||
setupUi(this);
|
||||
connect(&m_ListDevices->listDevices(), &QListWidget::customContextMenuRequested, this, &MainWindow::listDevicesContextMenuRequested);
|
||||
connect(&m_TreeLog->treeLog(), &QTreeWidget::customContextMenuRequested, this, &MainWindow::treeLogContextMenuRequested);
|
||||
connect(&m_ListOperations->listOperations(), &QListWidget::customContextMenuRequested, this, &MainWindow::listOperationsContextMenuRequested);
|
||||
init();
|
||||
}
|
||||
|
||||
|
@ -559,28 +562,28 @@ void MainWindow::updateWindowTitle()
|
|||
setWindowTitle(title);
|
||||
}
|
||||
|
||||
void MainWindow::on_m_ListOperations_contextMenuRequested(const QPoint& pos)
|
||||
void MainWindow::listOperationsContextMenuRequested(const QPoint& pos)
|
||||
{
|
||||
QMenu* menu = static_cast<QMenu*>(guiFactory()->container(QStringLiteral("edit"), this));
|
||||
|
||||
if (menu)
|
||||
menu->exec(pos);
|
||||
menu->exec(m_ListOperations->listOperations().viewport()->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
void MainWindow::on_m_TreeLog_contextMenuRequested(const QPoint& pos)
|
||||
void MainWindow::treeLogContextMenuRequested(const QPoint& pos)
|
||||
{
|
||||
QMenu* menu = static_cast<QMenu*>(guiFactory()->container(QStringLiteral("log"), this));
|
||||
|
||||
if (menu)
|
||||
menu->exec(pos);
|
||||
menu->exec(m_TreeLog->treeLog().viewport()->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
void MainWindow::on_m_ListDevices_contextMenuRequested(const QPoint& pos)
|
||||
void MainWindow::listDevicesContextMenuRequested(const QPoint& pos)
|
||||
{
|
||||
QMenu* menu = static_cast<QMenu*>(guiFactory()->container(QStringLiteral("device"), this));
|
||||
|
||||
if (menu)
|
||||
menu->exec(pos);
|
||||
menu->exec(m_ListDevices->listDevices().viewport()->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
void MainWindow::on_m_PartitionManagerWidget_contextMenuRequested(const QPoint& pos)
|
||||
|
|
|
@ -229,11 +229,11 @@ protected Q_SLOTS:
|
|||
|
||||
void on_m_ApplyProgressDialog_finished();
|
||||
|
||||
void on_m_ListDevices_contextMenuRequested(const QPoint& pos);
|
||||
void listDevicesContextMenuRequested(const QPoint& pos);
|
||||
void on_m_ListDevices_selectionChanged(const QString& device_node);
|
||||
|
||||
void on_m_TreeLog_contextMenuRequested(const QPoint& pos);
|
||||
void on_m_ListOperations_contextMenuRequested(const QPoint& pos);
|
||||
void treeLogContextMenuRequested(const QPoint& pos);
|
||||
void listOperationsContextMenuRequested(const QPoint& pos);
|
||||
|
||||
protected:
|
||||
void scanDevices();
|
||||
|
|
|
@ -142,11 +142,6 @@ void TreeLog::onSaveLog()
|
|||
}
|
||||
}
|
||||
|
||||
void TreeLog::on_m_TreeLog_customContextMenuRequested(const QPoint& pos)
|
||||
{
|
||||
emit contextMenuRequested(treeLog().viewport()->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
void TreeLog::onNewLogMessage(Log::Level logLevel, const QString& s)
|
||||
{
|
||||
static const QString icons[] = {
|
||||
|
|
|
@ -32,16 +32,12 @@ class QTreeWidget;
|
|||
*/
|
||||
class TreeLog: public QWidget, public Ui::TreeLogBase
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(TreeLog)
|
||||
|
||||
public:
|
||||
TreeLog(QWidget* parent = nullptr);
|
||||
~TreeLog();
|
||||
|
||||
Q_SIGNALS:
|
||||
void contextMenuRequested(const QPoint&);
|
||||
|
||||
public:
|
||||
void init();
|
||||
void onNewLogMessage(Log::Level logLevel, const QString& s);
|
||||
|
@ -49,14 +45,14 @@ public:
|
|||
void onClearLog();
|
||||
void onSaveLog();
|
||||
|
||||
protected:
|
||||
void on_m_TreeLog_customContextMenuRequested(const QPoint& pos);
|
||||
void onHeaderContextMenu(const QPoint& pos);
|
||||
|
||||
QTreeWidget& treeLog() {
|
||||
Q_ASSERT(m_TreeLog);
|
||||
return *m_TreeLog;
|
||||
}
|
||||
|
||||
protected:
|
||||
void onHeaderContextMenu(const QPoint& pos);
|
||||
|
||||
const QTreeWidget& treeLog() const {
|
||||
Q_ASSERT(m_TreeLog);
|
||||
return *m_TreeLog;
|
||||
|
|
Loading…
Reference in New Issue