diff options
-rw-r--r-- | SwifTools/SpellCheckerFactory.cpp | 8 | ||||
-rw-r--r-- | Swift/Controllers/Chat/ChatControllerBase.cpp | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/SwifTools/SpellCheckerFactory.cpp b/SwifTools/SpellCheckerFactory.cpp index d068d90..428e1a5 100644 --- a/SwifTools/SpellCheckerFactory.cpp +++ b/SwifTools/SpellCheckerFactory.cpp @@ -22,18 +22,20 @@ namespace Swift { SpellCheckerFactory::SpellCheckerFactory() { } -SpellChecker* SpellCheckerFactory::createSpellChecker(const std::string& dictFile) { #ifdef HAVE_HUNSPELL +SpellChecker* SpellCheckerFactory::createSpellChecker(const std::string& dictFile) { std::string affixFile(dictFile); boost::replace_all(affixFile, ".dic", ".aff"); if ((boost::filesystem::exists(dictFile)) && (boost::filesystem::exists(affixFile))) { return new HunspellChecker(affixFile.c_str(), dictFile.c_str()); } // If dictionaries don't exist disable the checker + return NULL; +} #elif defined(SWIFTEN_PLATFORM_MACOSX) +SpellChecker* SpellCheckerFactory::createSpellChecker(const std::string& /*dictFile*/) { return new MacOSXChecker(); -#endif - return NULL; } +#endif } diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp index ad7f76a..39ec8c3 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.cpp +++ b/Swift/Controllers/Chat/ChatControllerBase.cpp @@ -65,8 +65,8 @@ void ChatControllerBase::createDayChangeTimer() { if (timerFactory_) { boost::posix_time::ptime now = boost::posix_time::second_clock::local_time(); boost::posix_time::ptime midnight(now.date() + boost::gregorian::days(1)); - long millisecondsUntilMidnight = (midnight - now).total_milliseconds(); - dateChangeTimer_ = boost::shared_ptr<Timer>(timerFactory_->createTimer(boost::numeric_cast<int>(millisecondsUntilMidnight))); + int millisecondsUntilMidnight = boost::numeric_cast<int>((midnight - now).total_milliseconds()); + dateChangeTimer_ = boost::shared_ptr<Timer>(timerFactory_->createTimer(millisecondsUntilMidnight)); dateChangeTimer_->onTick.connect(boost::bind(&ChatControllerBase::handleDayChangeTick, this)); dateChangeTimer_->start(); } |