| 163 | } |
| 164 | |
| 165 | void GM_Manager::unloadPlugin() |
| 166 | { |
| 167 | // Save settings |
| 168 | QSettings settings(m_settingsPath + QSL("/extensions.ini"), QSettings::IniFormat); |
| 169 | settings.beginGroup(QSL("GreaseMonkey")); |
| 170 | settings.setValue(QSL("enabled"), m_enabled); |
| 171 | settings.setValue(QSL("disabledScripts"), m_disabledScripts); |
| 172 | settings.endGroup(); |
| 173 | |
| 174 | delete m_settings.data(); |
| 175 | |
| 176 | // Remove icons from all windows |
| 177 | QHashIterator<BrowserWindow*, GM_Icon*> it(m_windows); |
| 178 | while (it.hasNext()) { |
| 179 | it.next(); |
| 180 | mainWindowDeleted(it.key()); |
| 181 | } |
| 182 | |
| 183 | unloadScripts(); |
| 184 | |
| 185 | for (GM_Script *gmScript : std::as_const(m_scripts)) { |
| 186 | delete gmScript; |
| 187 | } |
| 188 | m_scripts.clear(); |
| 189 | m_contextMenuScripts.clear(); |
| 190 | } |
| 191 | |
| 192 | bool GM_Manager::isEnabled() const |
| 193 | { |