Commit 075affac authored by Pablo Rauzy's avatar Pablo Rauzy Committed by Christoph Cullmann
Browse files

avoid using a static member in case in might confuse things when unloading and reloading the plugin

parent d1004534
......@@ -71,10 +71,9 @@ KeyboardMacrosPlugin::~KeyboardMacrosPlugin()
QObject *KeyboardMacrosPlugin::createView(KTextEditor::MainWindow *mainWindow)
{
// avoid reloading macros from storage when creating a new mainWindow from an existing instance
static bool namedMacrosLoaded = false;
if (!namedMacrosLoaded) {
if (!m_namedMacrosLoaded) {
loadNamedMacros();
namedMacrosLoaded = true;
m_namedMacrosLoaded = true;
}
QPointer<KeyboardMacrosPluginView> pluginView = new KeyboardMacrosPluginView(this, mainWindow);
m_pluginViews.append(pluginView);
......
......@@ -49,6 +49,7 @@ class KeyboardMacrosPlugin : public KTextEditor::Plugin
Macro m_tape;
Macro m_macro;
QString m_storage;
bool m_namedMacrosLoaded = false;
QMap<QString, Macro> m_namedMacros;
QSet<QString> m_wipedMacros;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment