From 85c2535a1f94ce98c0d68b50176156c7a0cd8f4b Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 15 Oct 2016 17:11:53 +0200 Subject: [PATCH 1/4] Fixed: Deadlock while calling CoUninitialize() --HG-- branch : develop --- code/nel/src/misc/app_context.cpp | 6 ------ code/ryzom/client/src/init.cpp | 1 + code/ryzom/client/src/release.cpp | 4 +--- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/code/nel/src/misc/app_context.cpp b/code/nel/src/misc/app_context.cpp index 68ca720ed..6bf2d10e1 100644 --- a/code/nel/src/misc/app_context.cpp +++ b/code/nel/src/misc/app_context.cpp @@ -72,9 +72,6 @@ INelContext::~INelContext() CInstanceCounterLocalManager::releaseInstance(); - // uninit some systems stuff - CSystemUtils::uninit(); - _NelContext = NULL; *(_getInstance()) = NULL; } @@ -94,9 +91,6 @@ void INelContext::contextReady() // set numeric locale to C to avoid the use of decimal separators different of a dot char *locale = setlocale(LC_NUMERIC, "C"); - // init some systems stuff - CSystemUtils::init(); - // register any pending thinks // register local instance counter in the global instance counter manager diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index f3935eed4..240a70068 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -1148,6 +1148,7 @@ void prelogInit() Driver->setSwapVBLInterval(0); // initialize system utils class + CSystemUtils::init(); CSystemUtils::setWindow(Driver->getDisplay()); CLoginProgressPostThread::getInstance().step(CLoginStep(LoginStep_VideoModeSetupHighColor, "login_step_video_mode_setup_high_color")); diff --git a/code/ryzom/client/src/release.cpp b/code/ryzom/client/src/release.cpp index da456fadb..dd1986174 100644 --- a/code/ryzom/client/src/release.cpp +++ b/code/ryzom/client/src/release.cpp @@ -556,6 +556,7 @@ void release() // restore screensaver state CSystemUtils::enableScreensaver(LastScreenSaverEnabled); + CSystemUtils::uninit(); // release PACS primitives deletePrimitiveBlocks(); @@ -663,9 +664,6 @@ void release() NLGUI::CDBManager::release(); CWidgetManager::release(); - - - #if FINAL_VERSION // openURL ("http://www.ryzomcore.org/exit/"); #endif From f14a220e8ea52ddaa15ff8c8c4edb4456e167e04 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 15 Oct 2016 17:12:20 +0200 Subject: [PATCH 2/4] Changed: Use flat frames (better under Windows XP) --HG-- branch : develop --- code/ryzom/tools/client/ryzom_installer/ui/installdialog.ui | 6 ------ code/ryzom/tools/client/ryzom_installer/ui/mainwindow.ui | 6 ------ code/ryzom/tools/client/ryzom_installer/ui/migratedialog.ui | 6 ------ 3 files changed, 18 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/ui/installdialog.ui b/code/ryzom/tools/client/ryzom_installer/ui/installdialog.ui index bad2bcf17..0cc48efaa 100644 --- a/code/ryzom/tools/client/ryzom_installer/ui/installdialog.ui +++ b/code/ryzom/tools/client/ryzom_installer/ui/installdialog.ui @@ -69,12 +69,6 @@ Just follow the different steps and make your choice between the options presen - - QFrame::StyledPanel - - - QFrame::Raised - 6 diff --git a/code/ryzom/tools/client/ryzom_installer/ui/mainwindow.ui b/code/ryzom/tools/client/ryzom_installer/ui/mainwindow.ui index 49a2b6729..882277e5b 100644 --- a/code/ryzom/tools/client/ryzom_installer/ui/mainwindow.ui +++ b/code/ryzom/tools/client/ryzom_installer/ui/mainwindow.ui @@ -57,12 +57,6 @@ p, li { white-space: pre-wrap; } - - QFrame::StyledPanel - - - QFrame::Raised - 0 diff --git a/code/ryzom/tools/client/ryzom_installer/ui/migratedialog.ui b/code/ryzom/tools/client/ryzom_installer/ui/migratedialog.ui index 27d9f9dff..9175facbe 100644 --- a/code/ryzom/tools/client/ryzom_installer/ui/migratedialog.ui +++ b/code/ryzom/tools/client/ryzom_installer/ui/migratedialog.ui @@ -66,12 +66,6 @@ Just press Continue button and follow the different steps until everything is do - - QFrame::StyledPanel - - - QFrame::Raised - 6 From 43736cf523252ac9249d0b480882cb2cb20521a4 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 15 Oct 2016 17:12:51 +0200 Subject: [PATCH 3/4] Fixed: Wrong filename (because unallocated) --HG-- branch : develop --- .../client/ryzom_installer/src/filesextractor.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/filesextractor.cpp b/code/ryzom/tools/client/ryzom_installer/src/filesextractor.cpp index 535b43b76..7139df77d 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/filesextractor.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/filesextractor.cpp @@ -91,6 +91,8 @@ bool Set7zFileAttrib(const QString &filename, uint32 fileAttributes) { + if (filename.isEmpty()) return false; + bool attrReadOnly = (fileAttributes & FILE_ATTRIBUTE_READONLY) != 0; bool attrHidden = (fileAttributes & FILE_ATTRIBUTE_HIDDEN) != 0; bool attrSystem = (fileAttributes & FILE_ATTRIBUTE_SYSTEM) != 0; @@ -114,7 +116,7 @@ bool Set7zFileAttrib(const QString &filename, uint32 fileAttributes) #ifdef Q_OS_WIN SetFileAttributesW((wchar_t*)filename.utf16(), windowsAttributes); #else - const char *name = filename.toUtf8().constData(); + std::string name = filename.toUtf8().constData(); mode_t current_umask = umask(0); // get and set the umask umask(current_umask); // restore the umask @@ -122,9 +124,9 @@ bool Set7zFileAttrib(const QString &filename, uint32 fileAttributes) struct stat stat_info; - if (lstat(name, &stat_info) != 0) + if (lstat(name.c_str(), &stat_info) != 0) { - nlwarning("Unable to get file attributes for %s", name); + nlwarning("Unable to get file attributes for %s", name.c_str()); return false; } @@ -137,13 +139,13 @@ bool Set7zFileAttrib(const QString &filename, uint32 fileAttributes) { if (S_ISREG(stat_info.st_mode)) { - chmod(name, stat_info.st_mode & mask); + chmod(name.c_str(), stat_info.st_mode & mask); } else if (S_ISDIR(stat_info.st_mode)) { // user/7za must be able to create files in this directory stat_info.st_mode |= (S_IRUSR | S_IWUSR | S_IXUSR); - chmod(name, stat_info.st_mode & mask); + chmod(name.c_str(), stat_info.st_mode & mask); } } } @@ -156,7 +158,7 @@ bool Set7zFileAttrib(const QString &filename, uint32 fileAttributes) // octal!, clear write permission bits stat_info.st_mode &= ~0222; - chmod(name, stat_info.st_mode & mask); + chmod(name.c_str(), stat_info.st_mode & mask); } #endif From 999fd9d3aaf204dc26c1ae8caa8ae414603d2d7b Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 15 Oct 2016 17:13:51 +0200 Subject: [PATCH 4/4] Changed: Install shorcuts in Applications instead of /Applications --HG-- branch : develop --- .../tools/client/ryzom_installer/src/configfile.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index 1ec7364cc..20accba68 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -307,7 +307,16 @@ QString CConfigFile::getDesktopDirectory() const QString CConfigFile::getMenuDirectory() const { - return QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation) + "/" + QApplication::applicationName(); + QString applicationLocation; + +#ifdef O_OS_MAC + // QStandardPaths::ApplicationsLocation returns read-only location so fix it, will be installed in ~/Applications + applicationLocation = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/Applications"; +#else + applicationLocation = QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation); +#endif + + return applicationLocation + "/" + QApplication::applicationName(); } bool CConfigFile::has64bitsOS()