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;
blue = (colorRef >> 16) & 255;
return QColor(red, green, blue);
return {red, green, blue};
}
//-----------------------------------------------------------------------------

@ -6,10 +6,10 @@
#ifndef wmfstruct_h
#define wmfstruct_h
typedef short WORD;
typedef int DWORD;
typedef qint32 LONG;
typedef void *_HANDLE;
using WORD = short;
using DWORD = int;
using LONG = qint32;
using _HANDLE = void *;
typedef struct _RECT {
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 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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save