← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcpp-plugin-sdk-cpp/SpellPlugin] Rev 21: reset the spellchecker after a new dico install

 

------------------------------------------------------------
revno: 21
committer: poy <poy@xxxxxxxxxx>
branch nick: SpellPlugin
timestamp: Mon 2013-04-29 21:39:43 +0200
message:
  reset the spellchecker after a new dico install
modified:
  src/GUI.cpp
  src/Plugin.cpp
  src/Plugin.h


--
lp:~dcplusplus-team/dcpp-plugin-sdk-cpp/SpellPlugin
https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-cpp/SpellPlugin

Your team Dcplusplus-team is subscribed to branch lp:~dcplusplus-team/dcpp-plugin-sdk-cpp/SpellPlugin.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-cpp/SpellPlugin/+edit-subscription
=== modified file 'src/GUI.cpp'
--- src/GUI.cpp	2013-04-29 18:55:39 +0000
+++ src/GUI.cpp	2013-04-29 19:39:43 +0000
@@ -18,6 +18,7 @@
 
 #include "stdafx.h"
 #include "GUI.h"
+#include "Plugin.h"
 
 #include <pluginsdk/Config.h>
 #include <pluginsdk/Util.h>
@@ -165,5 +166,7 @@
 	copy(path);
 	Config::setConfig("DicPath", Util::fromT(path).c_str());
 
+	Plugin::initSpell();
+
 	window->close(true);
 }

=== modified file 'src/Plugin.cpp'
--- src/Plugin.cpp	2013-04-29 18:55:39 +0000
+++ src/Plugin.cpp	2013-04-29 19:39:43 +0000
@@ -170,7 +170,8 @@
 }
 
 void Plugin::initSpell() {
-	spell.reset(new Hunspell(Config::getConfig("AffPath").c_str(), Config::getConfig("DicPath").c_str()));
+	instance->spell.reset(new Hunspell(Config::getConfig("AffPath").c_str(), Config::getConfig("DicPath").c_str()));
+	instance->cache.clear();
 }
 
 namespace { bool isSep(int c) {

=== modified file 'src/Plugin.h'
--- src/Plugin.h	2013-04-29 18:55:39 +0000
+++ src/Plugin.h	2013-04-29 19:39:43 +0000
@@ -35,6 +35,8 @@
 public:
 	static Bool DCAPI main(PluginState state, DCCorePtr core, dcptr_t);
 
+	static void initSpell();
+
 private:
 	Plugin();
 	~Plugin();
@@ -45,7 +47,6 @@
 
 	static LRESULT CALLBACK CallWndProc(int code, WPARAM wParam, LPARAM lParam);
 
-	void initSpell();
 	vector<pair<string, vector<string>>> spellcheck(const string& s);
 
 	unique_ptr<Hunspell> spell;