From b48963b904e4e8fdc2948738f463a3d4b9df2ab1 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Sat, 12 Apr 2014 20:40:43 -0700 Subject: [PATCH] Make it compile and work in GCC / Linux --- Sources/Plasma/CoreLib/hsThread_Unix.cpp | 2 +- Sources/Plasma/CoreLib/plFileSystem.cpp | 2 +- Sources/Tools/plLocalizationEditor/CMakeLists.txt | 1 + Sources/Tools/plLocalizationEditor/plEditDlg.cpp | 8 +++----- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Sources/Plasma/CoreLib/hsThread_Unix.cpp b/Sources/Plasma/CoreLib/hsThread_Unix.cpp index 1e298282..786ced38 100644 --- a/Sources/Plasma/CoreLib/hsThread_Unix.cpp +++ b/Sources/Plasma/CoreLib/hsThread_Unix.cpp @@ -307,8 +307,8 @@ hsSemaphore::~hsSemaphore() status = sem_close(fPSema); } else { status = sem_destroy(fPSema); + delete fPSema; } - delete fPSema; hsThrowIfOSErr(status); #else int status = ::pthread_cond_destroy(&fPCond); diff --git a/Sources/Plasma/CoreLib/plFileSystem.cpp b/Sources/Plasma/CoreLib/plFileSystem.cpp index 61341c78..eb395efa 100644 --- a/Sources/Plasma/CoreLib/plFileSystem.cpp +++ b/Sources/Plasma/CoreLib/plFileSystem.cpp @@ -394,7 +394,7 @@ std::vector plFileSystem::ListDir(const plFileName &path, const char continue; } - if (pattern && pattern[0] && fnmatch(pattern, de->d_name, 0)) + if (pattern && pattern[0] && fnmatch(pattern, de->d_name, 0) == 0) contents.push_back(dir_name); else if (!pattern || !pattern[0]) contents.push_back(dir_name); diff --git a/Sources/Tools/plLocalizationEditor/CMakeLists.txt b/Sources/Tools/plLocalizationEditor/CMakeLists.txt index f9d139f9..0882ce44 100644 --- a/Sources/Tools/plLocalizationEditor/CMakeLists.txt +++ b/Sources/Tools/plLocalizationEditor/CMakeLists.txt @@ -39,6 +39,7 @@ set(plLocalizationEditor_UIC_SOURCES qt5_wrap_ui(plLocalizationEditor_UIC ${plLocalizationEditor_UIC_SOURCES}) # For generated ui_*.h files +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_executable(plLocalizationEditor WIN32 ${plLocalizationEditor_HEADERS} diff --git a/Sources/Tools/plLocalizationEditor/plEditDlg.cpp b/Sources/Tools/plLocalizationEditor/plEditDlg.cpp index 462d9e90..686ed0a0 100644 --- a/Sources/Tools/plLocalizationEditor/plEditDlg.cpp +++ b/Sources/Tools/plLocalizationEditor/plEditDlg.cpp @@ -54,16 +54,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include -#define ABOUT_TEXT R"(plLocalizationEditor -A basic editor for Plasma 21 localization resource files -Copyright (C) 2004 Cyan Worlds, Inc.)" - static void IAboutDialog(QWidget *parent) { QDialog dlg(parent); QLabel *image = new QLabel(&dlg); image->setPixmap(QPixmap(":/icon1.ico")); - QLabel *text = new QLabel(QObject::tr(ABOUT_TEXT), &dlg); + QLabel *text = new QLabel(QObject::tr(R"(plLocalizationEditor +A basic editor for Plasma 21 localization resource files +Copyright (C) 2004 Cyan Worlds, Inc.)"), &dlg); QPushButton *ok = new QPushButton(QObject::tr("OK"), &dlg); ok->setDefault(true);