Replace typedef by using / std::unique_ptr => std::make_unique

wilder
Laurent Montel 5 years ago
parent 9f996b0a46
commit c573e3e8de
  1. 2
      ktnef/src/qwmf.cpp
  2. 8
      ktnef/src/wmfstruct.h
  3. 2
      src/configuredialog/configagentdelegate.cpp
  4. 2
      src/configuredialog/configureaccountpage.cpp
  5. 4
      src/configuredialog/configureaccountpage.h
  6. 14
      src/configuredialog/configureappearancepage.h
  7. 18
      src/configuredialog/configurecomposerpage.h
  8. 2
      src/configuredialog/configuredialog.cpp
  9. 4
      src/configuredialog/configuremiscpage.h
  10. 10
      src/configuredialog/configuresecuritypage.h
  11. 2
      src/editor/composer.h
  12. 2
      src/kmmainwidget.h

@ -1085,7 +1085,7 @@ QColor QWinMetaFile::color(short *parm)
green = (colorRef >> 8) & 255; green = (colorRef >> 8) & 255;
blue = (colorRef >> 16) & 255; blue = (colorRef >> 16) & 255;
return QColor(red, green, blue); return {red, green, blue};
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

@ -6,10 +6,10 @@
#ifndef wmfstruct_h #ifndef wmfstruct_h
#define wmfstruct_h #define wmfstruct_h
typedef short WORD; using WORD = short;
typedef int DWORD; using DWORD = int;
typedef qint32 LONG; using LONG = qint32;
typedef void *_HANDLE; using _HANDLE = void *;
typedef struct _RECT { typedef struct _RECT {
WORD left; WORD left;

@ -153,7 +153,7 @@ QSize ConfigAgentDelegate::sizeHint(const QStyleOptionViewItem &option, const QM
const int iconHeight = KIconLoader::global()->currentSize(KIconLoader::Desktop) + (s_delegatePaddingSize * 2); //icon height + padding either side const int iconHeight = KIconLoader::global()->currentSize(KIconLoader::Desktop) + (s_delegatePaddingSize * 2); //icon height + padding either side
const int textHeight = option.fontMetrics.height() + qMax(option.fontMetrics.height(), 16) + (s_delegatePaddingSize * 2); //height of text + icon/text + padding either side const int textHeight = option.fontMetrics.height() + qMax(option.fontMetrics.height(), 16) + (s_delegatePaddingSize * 2); //height of text + icon/text + padding either side
return QSize(1, qMax(iconHeight, textHeight)); //any width,the view will give us the whole thing in list mode return {1, qMax(iconHeight, textHeight)}; //any width,the view will give us the whole thing in list mode
} }
QWidget *ConfigAgentDelegate::createEditor(QWidget *, const QStyleOptionViewItem &, const QModelIndex &) const QWidget *ConfigAgentDelegate::createEditor(QWidget *, const QStyleOptionViewItem &, const QModelIndex &) const

@ -358,7 +358,7 @@ void AccountsPage::ReceivingTab::slotEditNotifications()
{ {
const auto instance = Akonadi::AgentManager::self()->instance(QStringLiteral("akonadi_newmailnotifier_agent")); const auto instance = Akonadi::AgentManager::self()->instance(QStringLiteral("akonadi_newmailnotifier_agent"));
if (instance.isValid()) { if (instance.isValid()) {
std::unique_ptr<Akonadi::AgentConfigurationDialog>(new Akonadi::AgentConfigurationDialog(instance, this))->exec(); std::make_unique<Akonadi::AgentConfigurationDialog>(instance, this)->exec();
} else { } else {
KMessageBox::error(this, i18n("New Mail Notifier Agent not registered. Please contact your administrator.")); KMessageBox::error(this, i18n("New Mail Notifier Agent not registered. Please contact your administrator."));
} }

@ -109,8 +109,8 @@ public:
QString helpAnchor() const override; QString helpAnchor() const override;
// hrmpf. moc doesn't like nested classes with slots/signals...: // hrmpf. moc doesn't like nested classes with slots/signals...:
typedef AccountsPageSendingTab SendingTab; using SendingTab = AccountsPageSendingTab;
typedef AccountsPageReceivingTab ReceivingTab; using ReceivingTab = AccountsPageReceivingTab;
Q_SIGNALS: Q_SIGNALS:
void accountListChanged(const QStringList &); void accountListChanged(const QStringList &);

@ -35,7 +35,7 @@ class ThemeComboBox;
namespace MailCommon { namespace MailCommon {
class Tag; class Tag;
typedef QSharedPointer<Tag> TagPtr; using TagPtr = QSharedPointer<Tag>;
} }
namespace MailCommon { namespace MailCommon {
@ -264,12 +264,12 @@ public:
QString helpAnchor() const override; QString helpAnchor() const override;
// hrmpf. moc doesn't like nested classes with slots/signals...: // hrmpf. moc doesn't like nested classes with slots/signals...:
typedef AppearancePageFontsTab FontsTab; using FontsTab = AppearancePageFontsTab;
typedef AppearancePageColorsTab ColorsTab; using ColorsTab = AppearancePageColorsTab;
typedef AppearancePageLayoutTab LayoutTab; using LayoutTab = AppearancePageLayoutTab;
typedef AppearancePageHeadersTab HeadersTab; using HeadersTab = AppearancePageHeadersTab;
typedef AppearancePageGeneralTab ReaderTab; using ReaderTab = AppearancePageGeneralTab;
typedef AppearancePageMessageTagTab MessageTagTab; using MessageTagTab = AppearancePageMessageTagTab;
}; };
#endif // CONFIGUREAPPEARANCEPAGE_H #endif // CONFIGUREAPPEARANCEPAGE_H

@ -235,15 +235,15 @@ public:
QString helpAnchor() const override; QString helpAnchor() const override;
// hrmpf. moc doesn't like nested classes with slots/signals...: // hrmpf. moc doesn't like nested classes with slots/signals...:
typedef ComposerPageGeneralTab GeneralTab; using GeneralTab = ComposerPageGeneralTab;
typedef ComposerPageTemplatesTab TemplatesTab; using TemplatesTab = ComposerPageTemplatesTab;
typedef ComposerPageCustomTemplatesTab CustomTemplatesTab; using CustomTemplatesTab = ComposerPageCustomTemplatesTab;
typedef ComposerPageSubjectTab SubjectTab; using SubjectTab = ComposerPageSubjectTab;
typedef ComposerPageCharsetTab CharsetTab; using CharsetTab = ComposerPageCharsetTab;
typedef ComposerPageHeadersTab HeadersTab; using HeadersTab = ComposerPageHeadersTab;
typedef ComposerPageAttachmentsTab AttachmentsTab; using AttachmentsTab = ComposerPageAttachmentsTab;
typedef ComposerPageAutoCorrectionTab AutoCorrectionTab; using AutoCorrectionTab = ComposerPageAutoCorrectionTab;
typedef ComposerPageAutoImageResizeTab AutoImageResizeTab; using AutoImageResizeTab = ComposerPageAutoImageResizeTab;
}; };
#endif // CONFIGURECOMPOSERPAGE_H #endif // CONFIGURECOMPOSERPAGE_H

@ -44,7 +44,7 @@ QSize ConfigureDialog::sizeHint() const
{ {
const int width = KMailSettings::self()->configureDialogWidth(); const int width = KMailSettings::self()->configureDialogWidth();
const int height = KMailSettings::self()->configureDialogHeight(); const int height = KMailSettings::self()->configureDialogHeight();
return QSize(width, height); return {width, height};
} }
void ConfigureDialog::hideEvent(QHideEvent *ev) void ConfigureDialog::hideEvent(QHideEvent *ev)

@ -59,8 +59,8 @@ public:
explicit MiscPage(QWidget *parent = nullptr); explicit MiscPage(QWidget *parent = nullptr);
QString helpAnchor() const override; QString helpAnchor() const override;
typedef MiscPageFolderTab FolderTab; using FolderTab = MiscPageFolderTab;
typedef MiscPageInviteTab InviteTab; using InviteTab = MiscPageInviteTab;
}; };
class MiscPagePrintingTab : public ConfigModuleTab class MiscPagePrintingTab : public ConfigModuleTab

@ -138,11 +138,11 @@ public:
QString helpAnchor() const override; QString helpAnchor() const override;
typedef SecurityPageGeneralTab ReadingTab; using ReadingTab = SecurityPageGeneralTab;
typedef SecurityPageMDNTab MDNTab; using MDNTab = SecurityPageMDNTab;
typedef SecurityPageComposerCryptoTab ComposerCryptoTab; using ComposerCryptoTab = SecurityPageComposerCryptoTab;
typedef SecurityPageWarningTab WarningTab; using WarningTab = SecurityPageWarningTab;
typedef SecurityPageSMimeTab SMimeTab; using SMimeTab = SecurityPageSMimeTab;
}; };
#endif // CONFIGURESECURITYPAGE_H #endif // CONFIGURESECURITYPAGE_H

@ -42,7 +42,7 @@ public:
HDR_DICTIONARY = 0x800, HDR_DICTIONARY = 0x800,
HDR_ALL = 0xfff HDR_ALL = 0xfff
}; };
typedef QFlags<VisibleHeaderFlag> VisibleHeaderFlags; using VisibleHeaderFlags = QFlags<VisibleHeaderFlag>;
struct AttachmentInfo { struct AttachmentInfo {
QString comment; QString comment;

@ -88,7 +88,7 @@ class KMAIL_EXPORT KMMainWidget : public QWidget
Q_OBJECT Q_OBJECT
public: public:
typedef QList<KMMainWidget *> PtrList; using PtrList = QList<KMMainWidget *>;
KMMainWidget(QWidget *parent, KXMLGUIClient *aGUIClient, KActionCollection *actionCollection, const KSharedConfig::Ptr &config = KMKernel::self()->config()); KMMainWidget(QWidget *parent, KXMLGUIClient *aGUIClient, KActionCollection *actionCollection, const KSharedConfig::Ptr &config = KMKernel::self()->config());
~KMMainWidget() override; ~KMMainWidget() override;

Loading…
Cancel
Save