aboutsummaryrefslogtreecommitdiffstats
path: root/examples/winextras/iconextractor/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/winextras/iconextractor/main.cpp')
-rw-r--r--examples/winextras/iconextractor/main.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/winextras/iconextractor/main.cpp b/examples/winextras/iconextractor/main.cpp
index 0d7ebbd..b72a49a 100644
--- a/examples/winextras/iconextractor/main.cpp
+++ b/examples/winextras/iconextractor/main.cpp
@@ -77,7 +77,7 @@ struct PixmapEntry {
QPixmap pixmap;
};
-typedef QList<PixmapEntry> PixmapEntryList;
+using PixmapEntryList = QList<PixmapEntry>;
static std::wostream &operator<<(std::wostream &str, const QString &s)
{
@@ -98,8 +98,8 @@ static QString formatSize(const QSize &size)
static PixmapEntryList extractIcons(const QString &sourceFile, bool large)
{
const QString nativeName = QDir::toNativeSeparators(sourceFile);
- const wchar_t *sourceFileC = reinterpret_cast<const wchar_t *>(nativeName.utf16());
- const UINT iconCount = ExtractIconEx(sourceFileC, -1, 0, 0, 0);
+ const auto *sourceFileC = reinterpret_cast<const wchar_t *>(nativeName.utf16());
+ const UINT iconCount = ExtractIconEx(sourceFileC, -1, nullptr, nullptr, 0);
if (!iconCount) {
std::wcerr << sourceFile << " does not appear to contain icons.\n";
return PixmapEntryList();
@@ -107,8 +107,8 @@ static PixmapEntryList extractIcons(const QString &sourceFile, bool large)
QScopedArrayPointer<HICON> icons(new HICON[iconCount]);
const UINT extractedIconCount = large ?
- ExtractIconEx(sourceFileC, 0, icons.data(), 0, iconCount) :
- ExtractIconEx(sourceFileC, 0, 0, icons.data(), iconCount);
+ ExtractIconEx(sourceFileC, 0, icons.data(), nullptr, iconCount) :
+ ExtractIconEx(sourceFileC, 0, nullptr, icons.data(), iconCount);
if (!extractedIconCount) {
qErrnoWarning("Failed to extract icons from %s", qPrintable(sourceFile));
return PixmapEntryList();
@@ -145,7 +145,7 @@ static QPixmap pixmapFromShellImageList(int iImageList, const SHFILEINFO &info)
if (FAILED(SHGetImageList(iImageList, iID_IImageList, reinterpret_cast<void **>(&imageList))))
return result;
- HICON hIcon = 0;
+ HICON hIcon = nullptr;
if (SUCCEEDED(imageList->GetIcon(info.iIcon, ILD_TRANSPARENT, &hIcon))) {
result = QtWin::fromHICON(hIcon);
DestroyIcon(hIcon);
@@ -180,7 +180,7 @@ static PixmapEntryList extractShellIcons(const QString &sourceFile, bool addOver
};
const QString nativeName = QDir::toNativeSeparators(sourceFile);
- const wchar_t *sourceFileC = reinterpret_cast<const wchar_t *>(nativeName.utf16());
+ const auto *sourceFileC = reinterpret_cast<const wchar_t *>(nativeName.utf16());
SHFILEINFO info;
unsigned int baseFlags = SHGFI_ICON | SHGFI_SYSICONINDEX | SHGFI_ICONLOCATION;