Skip to content

Commit

Permalink
Text to speech (Mudlet#1893)
Browse files Browse the repository at this point in the history
* Removed duplicate clear event handlers call

* Revert back to dev version. 3.3 here we go!

* Adds saveWindowLayout() call to AutoSaveOnExit processing.

* Edbee editor implementation (Mudlet#985)

* Added a frame to edbee so it looks nicer

* Got utf8 module to load (Mudlet#1074) (update packaging!)

* Modified tooltip for Save and Save Profile to clearly indicate their keyboard shortcuts

* Added: shortcut for delete action in editor (Mudlet#1084)

* shortcut added for delete action

* Removed redundant edbee config related code (Mudlet#1091)

* Delete TScriptEditorManager.h

* Delete TScriptEditorManager.cpp

* BugFix: import some fixes by "Zolder" from Mudlet (Realms of Legends) fork

import: some Zoilder fixes from the MudletRL fork:
* in TBuffer::translateToPlainText(...): make some MXP related code execute
  only if Host::mFORCE_MXP_NEGOTIATION_OFF is NOT set as well as another
  condition.
* in TBuffer::wrap(...): change a for(...) {...} loop termination condition
  be a "<" rather than a "<=" test - which sounds like an "off-by-one"
  error fix-up.
* In TTextEdit:updateScreenView(): revise code that seems to prevent the
  width of a "main" console being set too small and NOT written to the
  "parent" Host::mScreenWidth variable - the original modification
  removed such a restriction completely, but I have just lowered the
  minimum from 100 to 40 and ensured it is always stored both in the local
  "main" console and to the parent record in the Host class for that
  console.
* In TTextEdit::drawForeground(...): revise the behaviour *I think* when
  at the point where a console "split" becomes unnecessary...

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Cut down on the length of some variable names (Mudlet#1086)

* Clarified use of QLatin1String

* Adding GCC 5 for C++14 requirement (Mudlet#1098)

* Fixed "reset map colors" button to work (Mudlet#1049)

* Fixed "reset map colors" button to work

That's a 5 year old bug out of the way!

* Change travis configuration to use installed gcc-5 (Mudlet#1108)

* Change travis configuration to use installed gcc-5

* Fixes Mudlet#1104 (Mudlet#1109)

Thanks to Rick for his prompt response on this

* Fixed typo in GeyserLabel.lua

Per Mudlet#1112

* Fix locale to C

Enforce uniform locale so scripts don't get tripped up on number representation differences (. vs ,)

* IRC client update of UI and logic (Mudlet#1072)

* Add Communi Model & Util libs

* Full refactor of IRC Client code & UI

This retains the primary functions of the old IRC client but adds many
more new IRC commands by default. The UI is slightly more organized and
interactive now.

* Adds QPointer to IRC Dialog pointer variable.

* Update Lua `sendIrc()` slightly.

* Added /msg command, Input History, and updated display colors.

Input History stores a total of 8 previously entered commands the user
can cycle through using the Up Arrow key.
The previously include /msg command has been added again.
Colors of some messages have been updated for (relatively) easier
distinction of message lines.

* Updated channel handling.

* Fix CMake builds

Things needed to fix CMake builds:
- communi CMake builds needed `include_directories` explicitly specified
- more MOC calls in communi
- more explicit dependencies to MOC files in communi
- ircmessageformatter must be compiled into mudlet

* IRC3 with more Lua features (Mudlet#1087)

Changes IRC client to run with settings given per-profile, making the IRC client more visible and configurable within Lua.   
This adds configuration options to the settings window in the "Special Options" tab for configuring an IRC client on the host profile which opens the settings window.   
See the PR summary comment for details on available Lua functions and IRC Client commands.

* Add a Code of Conduct (Mudlet#1110)

* Create CODE_OF_CONDUCT.md

* Fix for the QMake warnings caused by the IRC library includes.

* Finished formatting all filed & added braces (Mudlet#1115)

* Finished formatting all filed & added braces

* Re-enabled map load on profile load (Mudlet#1118)

* Re-enabled map load on profile load - disabling it broke scripts that relied on map data w/o the map open

* updated assignments.

* Event-based gamepad functionality (Mudlet#1106)

* Add theme switching to code editor (Mudlet#1095)

* Fix more Toolbar & Button bugs (Mudlet#1080) (Mudlet#1090)

* Fix bugs with Buttons & Toolbars.

- Fixed change detection for location, orienation, and CSS data.
- Buttons are not rendered unless they are part of a group,
Toolbar/Menu.
- ToolBars whos locations are changed now hide their previous TToolBar
or TEasyButtonBar instance as needed.

* Fix Buttons being left behind when parent toolbar is deleted.
Also allows TAction to use QPointer<T>

* Update old sourceforge page links (Mudlet#1132) (Mudlet#1134)

* Fixed blank command separator to not separate as people expect

* Replaced isTempKey, isTempAlias, etc with isTemporary (Mudlet#1102)

* also pushed isFolder() and setIsFolder() to the parent Tree class

* Give meaning to encodings (Mudlet#1107)

* Delete dev_README

Deleted outdated dev_README file.

It also didn't seem to be used all that often, else people would have raised the fact that it's outdated...

* Update travis to use Qt 5.9 for compiling (Mudlet#1141)

* Re-add single QT 5.6 build job

Since we want to keep sure that the minimal Qt version is still compilable (currently we need at least 5.6), we add a single job for that version.

* Refactor: rename QMake project/sub-project files (Mudlet#1103)

* refactor: rename QMake project/sub-project files

It is down right confusing having several project files in the Qt IDE
which are all labelled "src" - this commit renames the main project file
from "src.pro" to "mudlet.pro" and also renames:
* the lua_yajl module from src.pri to lua_yajl.pri
* the luazip module from src.pri to luazip.pri
it also:
* adds a new communi.pri file (see below)

I also took the liberty of renaming the project resource file from:
* mudlet_alpha.qrc to mudlet.qrc (we are well past the alpha stage now!)
and sorting a couple of items into the right order.

By creating a local project file 3rdparty/communi/communi.pri it is
possible to group the three separate but related communi libraries into
one - as it happens the effective content of the new file is identical to
that of the communi libraries own libcommuni/src/src.pri but it has some
notes on how the portion of the upstream library that we are using was
picked out of there; how to identify the effect version and how to
(hopefully) recreate things if upstream gets revised in the future!

By not using the upstream "src.pri"/"src.pro" files we avoid the confusion
of having a generic "src" project in the Mudlet project as a whole and it
is clearly identify-able as a file from the Mudlet project rather than the
sub-project that it pulls into the whole thing...

There is an minor nuisance side-effect in that having the main project
src.pro file open in a Qt Creator IDE or stored in a session will get
confused when this commit takes effect as the file will disappear from
the repository - it will be necessary to close the project and open the
new src/mudlet.pro project file (and possibly re-enter the build steps)
- OTOH the main project will now be identified as "mudlet" in Creator
rather than the previous "src". 😄

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Removed accidental debug echo left in (Mudlet#1151)

* initialize int nIrcPort with dlgIRC::DefaultHostPort value. (Mudlet#1153)

* Removes false from sendIrc() return, ignores command filtering status (Mudlet#1154)

* Removes false from sendIrc() return, ignores command filtering status (not used).

* Remove punctuation from lua messages

* Improved layout of IRC preferences (Mudlet#1152)

* Fix get map events (Mudlet#1120)

* Adapt addMapEvent error messages to current standard
* Fix getMapEvents()
The function now returns a proper indexed table of objects that each describe
a map event.

* Add missing call to set Editor as editable. (Mudlet#1159)

* Fixed tab indent to be two spaces again

* Fixed getComputerEncoding in case no key found

It'll now return the original value passed - it's way better than returning the wrong value.

* Add linux ci deployment (Mudlet#1128)

* Modify files needed for CI deployment of linux builds

* Syntax fix in .travis.yml

* tar the CI AppImages as well

* Add lua sqlite runtime dependency

* Unset LD variable for linuxdeployqt

* Bugfix: unset LD_LIBRARY_PATH in every codepath

* Test: install appmenu-qt5 for global menus

* Revert 781ef97 (Install appmenu-qt5)

The issue was that the first AppImage used Qt 5.6.2 instead of Qt 5.9 (which is how 3.2 was built and how it is build now after merging development in)

* Remove manager again (Mudlet#1163)

* Improved map load output to be condensed down if it's all successful (Mudlet#1117)

OK! Would be happy to see that in as well for maps that take a while to load (>1s).

* Re-enable search highlighting (Mudlet#1096)

* Remove mainwindow statusbar (Mudlet#1162)

* Replaced statustips with tooltips in the mapper menu

* Removed statusbar

* Tagging 3.3.0

* Initial QTextToSpeech additions

* Further TTS additions and bugfixes

* Wrapping TTS functions in #ifdefs for QT_TTS_LIB

* Missing #ifdefs

* More misplaced #ifdef lines for TTS functions

* More QT_TTS_LIB ifs

* Adding QTextToSpeech to cmake lists

* Various TTS updates

* Adding GetState to TLuaInterpreter.h

* Minor fixes

* Tts temporary fixes

* Exchanging toLatin1 with toUtf8

* Fix cmake TTS module includesion

* Install Qt 5.9 TTS module on linux

* Use Qt provided definition for enabled modules

We don't need (and possibly don't want) to provide our own definition for when a module is enabled. Let's use the Qt provided definition instead.

* Output confirmation messages of enabled Qt modules

* Use upper case "Gamepad" in output

* ttsClearQueue crash fix

* Fix for global speech events

* Whitespace replacement

* Various minor fixes

* More minor fixes.

* Cleanup: make CMakeList.txt have uniform indenting and adjust CMake message

The minimum versions of the Qt TextToSpeech and Gamepad reported in the
CMake project files needed tweaking.

I have also tried to regularise the indentation in the Mudlet CMake project
files to standardise on 2 spaces.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Reformat: clean up code-loyout of new TTS TLuaInterpreter code

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* BugFix: fixup a switch() in (int) TLuaInterpreter::ttsGetState(lua_State*)

This switch was missing "break;" on all the cases and must have been
defective without them - for all but the last case extra strings would have
been pushed onto the lua stack but as the return value was 1 they may have
been discarded...

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Enable Qt 5.9 Windows builds for testing

* Deploy Qt 5.9 builds for testing

* Fixing double-events for queueing purposes

* Added missing symbol

* Added missing symbol

* Updating tts events to globals and adding voice

* Create TTSValues.lua

* Adding TTSValues to LuaGlobal

* Adding TTSValues to Mudlet project

* Update CMakeLists.txt

* Update TTSValues.lua

* Update Qt to 5.10 for trusty

This is needed to hopefully have some TTS backend plugins in Linux

* Queueing and crash fixes

* Renaming tts funcs

* Renaming internal functions

* Adding functions for retrieving settings

* Fixing typo

* Making ttsGetState public

* Improve error messages for ttsGetCurrentLine()

It can be incredibly frustrating to just get a boolean back as an error message when you don't know what is going on

* Update error message to be consistent with the new style

* Aligned error messages to be consistent with the new style

* Fix ttsClearQueue to return nil+error, not actually error on invalid index

* Minor code formatting

* Floats to doubles

* Update documentation links
  • Loading branch information
jgh713 authored and vadi2 committed Jan 12, 2019
1 parent f9792f7 commit 34cf653
Show file tree
Hide file tree
Showing 10 changed files with 725 additions and 113 deletions.
27 changes: 14 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ addons:
apt:
sources: &add-sources
- sourceline: 'ppa:beineri/opt-qt571-trusty'
- sourceline: 'ppa:beineri/opt-qt593-trusty'
- sourceline: 'ppa:beineri/opt-qt-5.10.1-trusty'
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- sourceline: 'ppa:ondrej/php'
packages: &common-packages
Expand Down Expand Up @@ -56,49 +56,50 @@ matrix:
compiler: gcc
env:
- Q_OR_C_MAKE=qmake
QT_VERSION=59
QT_VERSION=510
addons:
apt:
sources: *add-sources
packages: &qt59-packages
packages: &qt510-packages
- *common-packages
- qt59base
- qt59multimedia
- qt59tools
- qt59gamepad
- qt510base
- qt510multimedia
- qt510tools
- qt510gamepad
- qt510speech

- os: linux
compiler: gcc
env:
- Q_OR_C_MAKE=cmake
QT_VERSION=59
QT_VERSION=510
addons:
apt:
sources: *add-sources
packages:
- *qt59-packages
- *qt510-packages

- os: linux
compiler: clang
env:
- Q_OR_C_MAKE=qmake
QT_VERSION=59
QT_VERSION=510
addons:
apt:
sources: *add-sources
packages:
- *qt59-packages
- *qt510-packages

- os: linux
compiler: clang
env:
- Q_OR_C_MAKE=cmake
QT_VERSION=59
QT_VERSION=510
addons:
apt:
sources: *add-sources
packages:
- *qt59-packages
- *qt510-packages

- os: linux
compiler: gcc
Expand Down
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ endif()
# something else or not even exist).
set(FONT_TEST $ENV{WITH_FONTS})
if(DEFINED FONT_TEST)
string(TOUPPER ${FONT_TEST} FONT_TEST)
string(TOUPPER ${FONT_TEST} FONT_TEST)
else()
# Set the CMake variable to the default if it (as a result of WITH_FONTS not
# existing) has not been defined, without the if(DEFINED ...) string(...)
# errors out - and so may further tests on the variable...
set(FONT_TEST "YES")
# Set the CMake variable to the default if it (as a result of WITH_FONTS not
# existing) has not been defined, without the if(DEFINED ...) string(...)
# errors out - and so may further tests on the variable...
set(FONT_TEST "YES")
endif()
if(FONT_TEST STREQUAL "NO")
option(USE_FONTS "Include Deja Vu and Ubuntu fonts in the executable" OFF)
Expand Down Expand Up @@ -214,10 +214,10 @@ endif()

file(GLOB_RECURSE lua_files RELATIVE "${CMAKE_HOME_DIRECTORY}/src/mudlet-lua/lua/" "${CMAKE_HOME_DIRECTORY}/src/mudlet-lua/lua/*.lua")
list(LENGTH lua_files lua_file_count)
if(lua_file_count EQUAL 25)
if(lua_file_count EQUAL 26)
message(STATUS "Found Mudlet & Geyser lua files")
else()
message(WARNING "Found ${lua_file_count} Mudlet & Geyser lua files but 25 were expected:")
message(WARNING "Found ${lua_file_count} Mudlet & Geyser lua files but 26 were expected:")
foreach(lua_file ${lua_files})
message(STATUS " ${lua_file}")
endforeach(lua_file)
Expand Down
147 changes: 82 additions & 65 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
set(mudlet_RCCS mudlet.qrc)

if(USE_FONTS)
set(mudlet_fonts_RCCS mudlet_fonts.qrc)
add_definitions(-DINCLUDE_FONTS)
set(mudlet_fonts_RCCS mudlet_fonts.qrc)
add_definitions(-DINCLUDE_FONTS)
endif()

set(mudlet_SRCS
Expand Down Expand Up @@ -102,29 +102,28 @@ set(mudlet_SRCS

# This is for compiled UI files, not those used at runtime though the resource file.
set(mudlet_UIS
ui/about_dialog.ui
ui/actions_main_area.ui
ui/aliases_main_area.ui
ui/color_trigger.ui
ui/composer.ui
ui/connection_profiles.ui
ui/dlgPackageExporter.ui
ui/irc.ui
ui/keybindings_main_area.ui
ui/main_window.ui
ui/mapper.ui
ui/notes_editor.ui
ui/profile_preferences.ui
ui/room_exits.ui
ui/scripts_main_area.ui
ui/source_editor_area.ui
ui/system_message_area.ui
ui/timers_main_area.ui
ui/triggers_main_area.ui
ui/trigger_editor.ui
ui/trigger_pattern_edit.ui
ui/vars_main_area.ui
)
ui/about_dialog.ui
ui/actions_main_area.ui
ui/aliases_main_area.ui
ui/color_trigger.ui
ui/composer.ui
ui/connection_profiles.ui
ui/dlgPackageExporter.ui
ui/irc.ui
ui/keybindings_main_area.ui
ui/main_window.ui
ui/mapper.ui
ui/notes_editor.ui
ui/profile_preferences.ui
ui/room_exits.ui
ui/scripts_main_area.ui
ui/source_editor_area.ui
ui/system_message_area.ui
ui/timers_main_area.ui
ui/triggers_main_area.ui
ui/trigger_editor.ui
ui/trigger_pattern_edit.ui
ui/vars_main_area.ui)

set(mudlet_MOC_HDRS
ctelnet.h
Expand Down Expand Up @@ -341,10 +340,23 @@ find_package(Qt5 5.7 REQUIRED COMPONENTS Core Multimedia Network OpenGL UiTools
# This is not present before Qt 5.7:
find_package(Qt5 COMPONENTS Gamepad QUIET)

# This is not present before Qt 5.9:
find_package(Qt5 COMPONENTS TextToSpeech QUIET)

if (Qt5Core_VERSION VERSION_LESS 5.7)
message(FATAL_ERROR "Mudlet requires Qt 5.7 or later, yours is ${Qt5Core_VERSION}")
elif(Qt5Core_VERSION VERSION_LESS 5.9)
# Qt Gamepad was a Technology Preview in 5.7
# Qt Gamepad was a Technology Preview 2 in 5.8
# Qt Speech (or at least the TTS part) was a Technology Preview in 5.8
message(WARNING "Qt version: ${Qt5Core_VERSION} - Gamepad and TextToSpeech may not be supported, as officially they requires 5.9 and 5.10 respectively")
elif(Qt5Core_VERSION VERSION_LESS 5.10)
# Qt Speech (or at least the TTS part) was a Technology Preview 2 in 5.9, now supported on Mingw
# Qt Gamepad was officially released in 5.9
message(WARNING "Qt version: ${Qt5Core_VERSION} - TextToSpeech may not be supported, officially it requires 5.10")
else()
message(STATUS "Qt version: ${Qt5Core_VERSION}")
# Qt Speech (or at least the TTS part) was officially release in 5.10
message(STATUS "Qt version: ${Qt5Core_VERSION}")
endif()

message(STATUS "Using ${CMAKE_CXX_COMPILER_ID} compiler")
Expand Down Expand Up @@ -397,8 +409,8 @@ find_package(Boost 1.44 COMPONENTS graph)
add_definitions(-DAPP_VERSION="${APP_VERSION}" -DAPP_BUILD="${APP_BUILD}" -DAPP_TARGET="${APP_TARGET}")

if(UNIX)
set(LUA_DEFAULT_DIR "${CMAKE_INSTALL_PREFIX}/share/mudlet/lua")
set(LCF_DIR "${CMAKE_INSTALL_PREFIX}/share/mudlet/lua/lcf")
set(LUA_DEFAULT_DIR "${CMAKE_INSTALL_PREFIX}/share/mudlet/lua")
set(LCF_DIR "${CMAKE_INSTALL_PREFIX}/share/mudlet/lua/lcf")
endif(UNIX)

# Define a preprocessor symbol with the default fallback location from which
Expand Down Expand Up @@ -427,49 +439,53 @@ include_directories(
${PUGIXML_INCLUDE_DIR}
)

if(Qt5TextToSpeech_FOUND)
add_definitions(${Qt5TextToSpeech_DEFINITIONS})
include_directories(${Qt5TextToSpeech_INCLUDE_DIRS})
message(STATUS "Using TextToSpeech module")
endif(Qt5TextToSpeech_FOUND)

if(Qt5Gamepad_FOUND)
add_definitions(${Qt5Gamepad_DEFINITIONS})
include_directories(${Qt5Gamepad_INCLUDE_DIRS})
message(STATUS "Using Gamepad module")
add_definitions(${Qt5Gamepad_DEFINITIONS})
include_directories(${Qt5Gamepad_INCLUDE_DIRS})
message(STATUS "Using Gamepad module")
endif(Qt5Gamepad_FOUND)

# Need to use the plural variables as there can be more than ONE directory to specify:
if(PC_ZIP_FOUND)
include_directories( ${PC_ZIP_INCLUDE_DIRS} )
include_directories( ${PC_ZIP_INCLUDE_DIRS} )
else()
include_directories( ${ZIP_INCLUDE_DIRS} )
include_directories( ${ZIP_INCLUDE_DIRS} )
endif()

include_directories( ${ZLIB_INCLUDE_DIR} )

QT5_WRAP_UI(mudlet_UIS_H ${mudlet_UIS})
QT5_WRAP_CPP(mudlet_MOC_SRCS ${mudlet_MOC_HDRS})
if(USE_FONTS)
QT5_ADD_RESOURCES(mudlet_RCC_SRCS ${mudlet_RCCS} ${mudlet_fonts_RCCS})
QT5_ADD_RESOURCES(mudlet_RCC_SRCS ${mudlet_RCCS} ${mudlet_fonts_RCCS})
else()
QT5_ADD_RESOURCES(mudlet_RCC_SRCS ${mudlet_RCCS})
QT5_ADD_RESOURCES(mudlet_RCC_SRCS ${mudlet_RCCS})
endif()

if(WIN32)
add_executable(mudlet WIN32
${mudlet_SRCS}
${mudlet_MOC_SRCS}
${mudlet_RCC_SRCS}
${mudlet_HDRS}
${mudlet_UIS_H}
${mudlet_MOC_HDRS}
${mudlet_LUA_FILES}
)
add_executable(mudlet WIN32
${mudlet_SRCS}
${mudlet_MOC_SRCS}
${mudlet_RCC_SRCS}
${mudlet_HDRS}
${mudlet_UIS_H}
${mudlet_MOC_HDRS}
${mudlet_LUA_FILES})
else()
add_executable(mudlet
${mudlet_SRCS}
${mudlet_MOC_SRCS}
${mudlet_RCC_SRCS}
${mudlet_HDRS}
${mudlet_UIS_H}
${mudlet_MOC_HDRS}
${mudlet_LUA_FILES}
)
add_executable(mudlet
${mudlet_SRCS}
${mudlet_MOC_SRCS}
${mudlet_RCC_SRCS}
${mudlet_HDRS}
${mudlet_UIS_H}
${mudlet_MOC_HDRS}
${mudlet_LUA_FILES})
endif()

target_link_libraries(mudlet
Expand All @@ -491,19 +507,22 @@ target_link_libraries(mudlet
edbee-lib
)

if(Qt5TextToSpeech_FOUND)
target_link_libraries(mudlet ${Qt5TextToSpeech_LIBRARIES})
endif(Qt5TextToSpeech_FOUND)

if(USE_UPDATER)
target_link_libraries(mudlet
dblsqd)
target_link_libraries(mudlet dblsqd)
endif(USE_UPDATER)

if(Qt5Gamepad_FOUND)
target_link_libraries(mudlet ${Qt5Gamepad_LIBRARIES})
target_link_libraries(mudlet ${Qt5Gamepad_LIBRARIES})
endif(Qt5Gamepad_FOUND)

if(PC_ZIP_FOUND)
target_link_libraries(mudlet ${PC_ZIP_LIBRARIES})
target_link_libraries(mudlet ${PC_ZIP_LIBRARIES})
else()
target_link_libraries(mudlet ${ZIP_LIBRARIES})
target_link_libraries(mudlet ${ZIP_LIBRARIES})
endif()

if(WIN32)
Expand All @@ -512,16 +531,14 @@ if(WIN32)
endif()

if(APPLE)
target_link_libraries(mudlet
luazip
)
target_link_libraries(mudlet luazip)

if(USE_UPDATER)
target_link_libraries(mudlet
cocoa-qt-glue
"-framework Sparkle"
"-framework AppKit"
"-F${CMAKE_HOME_DIRECTORY}/3rdparty/cocoapods/Pods/Sparkle")
cocoa-qt-glue
"-framework Sparkle"
"-framework AppKit"
"-F${CMAKE_HOME_DIRECTORY}/3rdparty/cocoapods/Pods/Sparkle")
endif(USE_UPDATER)
endif()

Expand Down
6 changes: 4 additions & 2 deletions src/HostManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ void HostManager::postIrcMessage(QString a, QString b, QString c)
// send out the events to the other hosts in a predictable and consistent order
// and so that no one host gets an unfair advantage when emitting events. The
// sending profile host does NOT get the event!
void HostManager::postInterHostEvent(const Host* pHost, const TEvent& event)
// Note: Optional forceGlobal allows passing a null pointer as pHost, and will raise
// an event for all profiles.
void HostManager::postInterHostEvent(const Host* pHost, const TEvent& event, const bool forceGlobal)
{
if (!pHost) {
if (!pHost && !forceGlobal) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/HostManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class HostManager
bool addHost(QString name, QString port, QString login, QString pass);
bool deleteHost(QString);
void postIrcMessage(QString, QString, QString);
void postInterHostEvent(const Host*, const TEvent&);
void postInterHostEvent(const Host*, const TEvent&, const bool = false);

private:
QReadWriteLock mPoolReadWriteLock; // Was QMutex, but we needed to allow concurrent read access
Expand Down
Loading

0 comments on commit 34cf653

Please sign in to comment.