D28855: put minimumkeepsize actually in the netpref KCM
Ahmad Samir
noreply at phabricator.kde.org
Wed Apr 15 17:21:30 BST 2020
ahmadsamir added inline comments.
INLINE COMMENTS
> netpref.cpp:87
> + connect(cb_globalMarkPartial, &QAbstractButton::toggled,
> + partialWidget, [partialWidget](bool checked) { partialWidget->setEnabled(checked); });
> + globalLayout->addWidget(partialWidget);
Why not "&QWidget::setEnabled" instead of the lambda?
> netpref.cpp:89
> + globalLayout->addWidget(partialWidget);
> + auto partialLayout = new QFormLayout(gb_Global);
> + partialLayout->setContentsMargins(20, 0, 0, 0); // indent below mark partial
This triggers this warning:
QLayout: Attempting to add QLayout "" to QGroupBox "", which already has a layout
I've just found out that QWidget::setLayout(QLayout *layout) will take ownership of "layout":
https://doc.qt.io/qt-5/qwidget.html#setLayout
so I guess there is no need to set a parent for partialLayout when instantiating it.
> netpref.cpp:92
> + partialWidget->setLayout(partialLayout);
> + sb_globalMinimumKeepSize = new KPluralHandlingSpinBox( this );
> + sb_globalMinimumKeepSize->setSuffix( ki18np( " byte", " bytes" ) );
Coding style, no space after ( or before ), IIUC.
> netpref.cpp:93
> + sb_globalMinimumKeepSize = new KPluralHandlingSpinBox( this );
> + sb_globalMinimumKeepSize->setSuffix( ki18np( " byte", " bytes" ) );
> + connect(sb_globalMinimumKeepSize, QOverload<int>::of(&QSpinBox::valueChanged),
Same.
> netpref.cpp:96
> + this, &KIOPreferences::configChanged);
> + partialLayout->addRow(i18nc( "@label:spinbox", "Minimum size required to keep on cancel:" ),
> + sb_globalMinimumKeepSize);
"If cancelled, automatically delete partially uploaded files smaller than"
And same coding style as before.
REPOSITORY
R241 KIO
REVISION DETAIL
https://phabricator.kde.org/D28855
To: sitter, ngraham, dfaure
Cc: ahmadsamir, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200415/b6844954/attachment.html>
More information about the Kde-frameworks-devel
mailing list