Commit ef3063a6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Modernize code

parent 9c114b97
......@@ -35,7 +35,7 @@ KDiskFreeWidget::KDiskFreeWidget( QWidget *parent )
setButtons(Help);
QVBoxLayout *topLayout = new QVBoxLayout( this );
topLayout->setContentsMargins(0, 0, 0, 0);
topLayout->setContentsMargins({});
mKdf = new KDFWidget( this, false );
topLayout->addWidget( mKdf );
......
......@@ -47,8 +47,8 @@ KDFTopLevel::KDFTopLevel(QWidget *)
actionCollection()->setDefaultShortcuts(action, KStandardShortcut::reload());
connect(action, &QAction::triggered, kdf, &KDFWidget::updateDF);
KStandardAction::quit(this, SLOT(close()), actionCollection());
KStandardAction::preferences(kdf, SLOT(settingsBtnClicked()), actionCollection());
KStandardAction::quit(this, &KDFTopLevel::close, actionCollection());
KStandardAction::preferences(kdf, &KDFWidget::settingsBtnClicked, actionCollection());
KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()),
actionCollection());
setCentralWidget(kdf);
......
......@@ -56,7 +56,7 @@ static bool GUI;
#endif
KDFWidget::KDFWidget( QWidget *parent, bool init )
: QWidget(parent), mOptionDialog(nullptr), mPopup(nullptr), mTimer(nullptr)
: QWidget(parent)
{
connect(&mDiskList , &DiskList::readDFDone,
this, &KDFWidget::updateDFDone );
......
......@@ -100,19 +100,19 @@ class KDFPRIVATE_EXPORT KDFWidget : public QWidget
QIcon generateIcon( const QString &iconName , bool mode, bool mounted);
bool readingDF;
COptionDialog *mOptionDialog;
QMenu *mPopup;
QTimer *mTimer;
COptionDialog *mOptionDialog = nullptr;
QMenu *mPopup = nullptr;
QTimer *mTimer = nullptr;
DiskList mDiskList;
bool mIsTopLevel;
CStdOption mStd;
QTreeView * m_listWidget;
KDFItemDelegate * m_itemDelegate;
QTreeView * m_listWidget = nullptr;
KDFItemDelegate * m_itemDelegate = nullptr;
QList<Column> m_columnList;
QStandardItemModel * m_listModel;
KDFSortFilterProxyModel * m_sortModel;
QStandardItemModel * m_listModel = nullptr;
KDFSortFilterProxyModel * m_sortModel = nullptr;
};
#endif
......
......@@ -76,7 +76,7 @@ void COptionDialog::slotChanged()
dataChanged = true;
}
void COptionDialog::slotHelp( void )
void COptionDialog::slotHelp()
{
KHelpClient::invokeHelp(QLatin1String(""), QStringLiteral("kdf"));
}
......
......@@ -45,8 +45,8 @@ class KDFPRIVATE_EXPORT COptionDialog : public KPageDialog
void valueChanged();
private:
KDFConfigWidget *mConf;
MntConfigWidget *mMnt;
KDFConfigWidget *mConf = nullptr;
MntConfigWidget *mMnt = nullptr;
bool dataChanged;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment