Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows build fixed #109

Merged
merged 31 commits into from
Oct 31, 2024
Merged

windows build fixed #109

merged 31 commits into from
Oct 31, 2024

Conversation

Pandoriaantje
Copy link
Contributor

@Pandoriaantje Pandoriaantje commented Oct 12, 2024

added some fixes to build on windows platform, using Botan >= 3.4 (tested with latest Botan 3.5).
Builds fine with QT 6.7.3 MingGW 11.2.0 and above.

removed Phonon dependency.
usage of QVariant::type() is deprecated in favor of metaType()
usage of memcpy is Unsafe for Non-Trivial Types and not intentional. replaced with assignment operators or std::copy where needed.
When you use new[] to allocate an array of objects, you must use delete[] to deallocate that memory. Using delete without the brackets is incorrect and can lead to undefined behavior, including memory leaks or crashes, because delete doesn't know it's dealing with an array and won't properly call destructors for each element in the array.
Quick hack to enforcing light mode (on windows?) until dark mode is properly implemented to aid in text visibility issues. (e.g. Tools/Profile Tools/Profile Cleaner has no text visible)
using toLocalFile() will work across Windows, Linux, and macOS. This method is designed to handle the conversion of a QUrl to a local file path in a platform-independent manner.
Changed the OS declaration for Windows to reflect the LIB path in Velocity.pro.
allows to compile on windows platform with mingw32-make instead of make.
__WIN32__ is not a std macro to detect windows. replaced with "_WIN32"
Since compiling with VC++ is no longer maintained, removed traces of MSC_VER, in favor of building with MINWG
configuring Settings/Preferences/Package Drop Action to Rehash/Resign, would try to resigning  LIVE, PIR and CON files, leading to a error. judging from the logic in packageviewer.cpp, LIVE and PIR containers like avatar items need only a rehash. This fixes mass (drag-drop) rehashing.
@@ -9,22 +9,6 @@ About::About(QWidget *parent) :
setFixedSize(sizeHint());
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QtHelpers::GenAdjustWidgetAppearanceToOS(this);

#ifdef _WIN32
if (!QFile::exists(QtHelpers::ExecutingDirectory() + "Developers.mp3"))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this? Would prefer to keep it, it's a nice easter egg

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm generally in favor of removing dependencies if this allows us to remove Phonon. Maybe we can use QMediaPlayer to play it?

package->Resign(QtHelpers::GetKVPath(package->metaData->certificate.ownerConsoleType, this));
if (fileMagic == CON)
{
package->Resign(QtHelpers::GetKVPath(package->metaData->certificate.ownerConsoleType, this));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious what effect this was having previously? Was it corrupting some files?

@DerfJagged
Copy link

@Pandoriaantje would you mind sharing the binaries?

@hetelek
Copy link
Owner

hetelek commented Oct 31, 2024

Have not tested this much, but I was at least able to build and run on Windows. I will merge this and we can follow up with more PRs if necessary. Thank you @Pandoriaantje !

@hetelek hetelek merged commit eb3fb5e into hetelek:master Oct 31, 2024
@hetelek
Copy link
Owner

hetelek commented Oct 31, 2024

@Pandoriaantje would you mind sharing the binaries?

@DerfJagged I just uploaded Windows binaries at https://github.com/hetelek/Velocity/releases/tag/v1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants