diff options
| author | 2024-02-24 11:30:48 +0100 | |
|---|---|---|
| committer | 2024-02-24 11:30:48 +0100 | |
| commit | 9e9049626a307f96a6f7cb512ef8111dd0502070 (patch) | |
| tree | 0bf2bce69d028cc0f11e848a4e81ca0b9f48294a /src | |
| parent | Use separate caches for CI linux qt5 and qt6 builds (#2608) (diff) | |
| download | KVIrc-9e9049626a307f96a6f7cb512ef8111dd0502070.tar.gz KVIrc-9e9049626a307f96a6f7cb512ef8111dd0502070.tar.bz2 KVIrc-9e9049626a307f96a6f7cb512ef8111dd0502070.zip | |
Switch windows CI builds to Github Actions and Qt6 (#2606)
* Make build compatible with ninja generator
* Remove usage of Qt Windows Extras under qt6
* Avoid compilation noise on UNICODE redefinition
* Remove "KviHeapObject::operator new" signature for debug builds, add placement new operator
* Fix implicit cast of 0 to QFlags
* Fix Avoid ambiguous overload in concatenating strings
* KviIpcSentinel::winEvent - Adapt to changed method signature in qt6
* Remove windows 95/98/me support :)
* appveyor: try switching qt version
* Try creating a github action for windows build
* Remove appveyor config; move windows-only patches into dist/windows/patches
Diffstat (limited to 'src')
| -rw-r--r-- | src/kvilib/config/kvi_settings.h | 4 | ||||
| -rw-r--r-- | src/kvilib/core/KviHeapObject.cpp | 11 | ||||
| -rw-r--r-- | src/kvilib/core/KviHeapObject.h | 14 | ||||
| -rw-r--r-- | src/kvirc/kernel/KviApplication.cpp | 12 | ||||
| -rw-r--r-- | src/kvirc/kernel/KviApplication_setup.cpp | 2 | ||||
| -rw-r--r-- | src/kvirc/kernel/KviIpcSentinel.cpp | 4 | ||||
| -rw-r--r-- | src/kvirc/kernel/KviIpcSentinel.h | 4 | ||||
| -rw-r--r-- | src/kvirc/kvs/KviKvsProcessManager.cpp | 10 | ||||
| -rw-r--r-- | src/modules/setup/SetupWizard.cpp | 6 |
9 files changed, 33 insertions, 34 deletions
diff --git a/src/kvilib/config/kvi_settings.h b/src/kvilib/config/kvi_settings.h index 1b2641b48..1fa0acff0 100644 --- a/src/kvilib/config/kvi_settings.h +++ b/src/kvilib/config/kvi_settings.h @@ -194,8 +194,12 @@ #endif #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) +#ifndef UNICODE #define UNICODE +#endif +#ifndef _UNICODE #define _UNICODE #endif +#endif #endif //_KVI_SETTINGS_H_ diff --git a/src/kvilib/core/KviHeapObject.cpp b/src/kvilib/core/KviHeapObject.cpp index c8e504b62..fe7a5750f 100644 --- a/src/kvilib/core/KviHeapObject.cpp +++ b/src/kvilib/core/KviHeapObject.cpp @@ -46,14 +46,9 @@ void KviHeapObject::operator delete[](void * pData) KviMemory::free(pData); } -// these are the debug versions... -void * KviHeapObject::operator new(size_t uSize, const char *, int) +// placement new operator - needed by QMetaType +void * KviHeapObject::operator new(size_t, std::align_val_t, void * pWhere) { - return KviMemory::allocate(uSize); -} - -void KviHeapObject::operator delete(void * pData, const char *, int) -{ - KviMemory::free(pData); + return pWhere; } #endif diff --git a/src/kvilib/core/KviHeapObject.h b/src/kvilib/core/KviHeapObject.h index 227cc0bae..8882711ff 100644 --- a/src/kvilib/core/KviHeapObject.h +++ b/src/kvilib/core/KviHeapObject.h @@ -105,20 +105,14 @@ public: void operator delete[](void * pData); /** - * \brief Overloading of the new operator (debug version) + * \brief Overloading of the new placement operator * * \param size_t size in bytes of the memory that has to be allocated + * \param std::align_val_t alignment + * \param void * pointer to the already-allocated memory * \return void * */ - void * operator new(size_t uSize, const char *, int); - - /** - * \brief Overloading of the delete operator (debug version) - * - * \param pData pointer to the objet that needs to be freed - * \return void - */ - void operator delete(void * pData, const char *, int); + void * operator new(size_t uSize, std::align_val_t, void * pWhere); }; #else //COMPILE_ON_WINDOWS class KVILIB_API KviHeapObject diff --git a/src/kvirc/kernel/KviApplication.cpp b/src/kvirc/kernel/KviApplication.cpp index 1c6d22fe0..4df89bcf4 100644 --- a/src/kvirc/kernel/KviApplication.cpp +++ b/src/kvirc/kernel/KviApplication.cpp @@ -115,7 +115,9 @@ #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) #include <QPluginLoader> +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) #include <QtWin> +#endif #include <QScreen> #endif @@ -226,7 +228,7 @@ KviApplication::KviApplication(int & argc, char ** argv) // don't let qt quit the application by itself setQuitOnLastWindowClosed(false); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - m_bPortable = KviFileUtils::fileExists(g_pApp->applicationDirPath() + KVI_PATH_SEPARATOR_CHAR + "portable"); + m_bPortable = KviFileUtils::fileExists(QString("%1%2%3").arg(g_pApp->applicationDirPath().arg(KVI_PATH_SEPARATOR_CHAR).arg("portable"))); #endif //note: the early qApp->style() call leads to a crash on osx @@ -1318,7 +1320,11 @@ void KviApplication::updatePseudoTransparency() SelectObject(bitmap_dc, null_bitmap); DeleteDC(bitmap_dc); ReleaseDC(0, displayDc); +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) + QPixmap pix = QPixmap::fromImage(QImage::fromHBITMAP(bitmap)); +#else QPixmap pix = QtWin::fromHBITMAP(bitmap); +#endif DeleteObject(bitmap); @@ -1622,9 +1628,9 @@ void KviApplication::createFrame() #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) if(KVI_OPTION_BOOL(KviOption_boolShowTaskBarButton)) - new KviMainWindow(0); + new KviMainWindow(nullptr); else - new KviMainWindow(new QWidget(0, 0)); + new KviMainWindow(new QWidget(nullptr, Qt::Widget)); #else new KviMainWindow(nullptr); #endif diff --git a/src/kvirc/kernel/KviApplication_setup.cpp b/src/kvirc/kernel/KviApplication_setup.cpp index 2aba0962c..5ceeb4be5 100644 --- a/src/kvirc/kernel/KviApplication_setup.cpp +++ b/src/kvirc/kernel/KviApplication_setup.cpp @@ -300,7 +300,7 @@ bool KviApplication::findLocalKvircDirectory() #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) if(m_bPortable) { - m_szLocalKvircDir = g_pApp->applicationDirPath() + KVI_PATH_SEPARATOR_CHAR + "Settings"; + m_szLocalKvircDir = QString("%1%2%3").arg(g_pApp->applicationDirPath()).arg(KVI_PATH_SEPARATOR_CHAR).arg("Settings"); if(checkLocalKvircDirectory()) return true; } diff --git a/src/kvirc/kernel/KviIpcSentinel.cpp b/src/kvirc/kernel/KviIpcSentinel.cpp index 4f082184c..a56406402 100644 --- a/src/kvirc/kernel/KviIpcSentinel.cpp +++ b/src/kvirc/kernel/KviIpcSentinel.cpp @@ -224,7 +224,11 @@ KviIpcSentinel::KviIpcSentinel() : QWidget(nullptr) #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) bool KviIpcSentinel::winEvent(MSG * msg, long * result) +#else +bool KviIpcSentinel::winEvent(MSG * msg, qintptr * result) +#endif { if(msg->message == WM_COPYDATA) { diff --git a/src/kvirc/kernel/KviIpcSentinel.h b/src/kvirc/kernel/KviIpcSentinel.h index 7ba7aaa33..310ce0f3a 100644 --- a/src/kvirc/kernel/KviIpcSentinel.h +++ b/src/kvirc/kernel/KviIpcSentinel.h @@ -49,7 +49,11 @@ public: protected: // protected members #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) virtual bool winEvent(MSG * msg, long * result); +#else + virtual bool winEvent(MSG * msg, qintptr * result); +#endif #elif defined(COMPILE_X11_SUPPORT) && defined(COMPILE_QX11INFO_SUPPORT) virtual bool x11Event(XEvent * e); bool x11GetRemoteMessage(); diff --git a/src/kvirc/kvs/KviKvsProcessManager.cpp b/src/kvirc/kvs/KviKvsProcessManager.cpp index a2b83d620..147511503 100644 --- a/src/kvirc/kvs/KviKvsProcessManager.cpp +++ b/src/kvirc/kvs/KviKvsProcessManager.cpp @@ -77,15 +77,7 @@ bool KviKvsProcessAsyncOperation::start() if(szShell.isEmpty()) { #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - // [01:26:00] <PragmaOff> btw, what is qt_winunicode ? - // [01:26:12] <kode54> Qt export specific to win32 - // [01:26:27] <kode54> bool which indicates whether system is Unicode (NT) or not - // [01:26:58] <kode54> not sure if that's documented, but it is a public export - // - // [02:50:21] <kode54> if ( QApplication::winVersion() & Qt::WV_NT_based ) - // [02:50:41] <kode54> I see another implementation using that, maybe it is the official way of detecting that :[ - szShell = !(QSysInfo::WindowsVersion & QSysInfo::WV_DOS_based) ? "cmd.exe /c" : "command.com /c"; -// Thnx kode54 :) + szShell = "cmd.exe /c"; #else szShell = "sh -c"; #endif diff --git a/src/modules/setup/SetupWizard.cpp b/src/modules/setup/SetupWizard.cpp index 30be5a079..67a7dcdba 100644 --- a/src/modules/setup/SetupWizard.cpp +++ b/src/modules/setup/SetupWizard.cpp @@ -962,7 +962,7 @@ void SetupWizard::accept() #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) else { //portable - szDir = g_pApp->applicationDirPath() + KVI_PATH_SEPARATOR_CHAR + "Settings"; + szDir = QString("%1%2%3").arg(g_pApp->applicationDirPath()).arg(KVI_PATH_SEPARATOR_CHAR).arg("Settings"); } #endif @@ -990,7 +990,7 @@ void SetupWizard::accept() #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) else { //portable - szDir = g_pApp->applicationDirPath() + KVI_PATH_SEPARATOR_CHAR + "Downloads"; + szDir = QString("%1%2%3").arg(g_pApp->applicationDirPath()).arg(KVI_PATH_SEPARATOR_CHAR).arg("Downloads"); } #endif @@ -1109,7 +1109,7 @@ void SetupWizard::accept() #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) if(m_pDirMakePortable->isChecked()) { - KviFileUtils::writeFile(g_pApp->applicationDirPath() + KVI_PATH_SEPARATOR_CHAR + "portable", QString("true")); + KviFileUtils::writeFile(QString("%1%2%3").arg(g_pApp->applicationDirPath()).arg(KVI_PATH_SEPARATOR_CHAR).arg("portable"), QString("true")); g_pApp->m_bPortable = true; } else |
