| 154 | } |
| 155 | |
| 156 | bool CorePrivate::initialize(Core::Setup mode, const QString& session ) |
| 157 | { |
| 158 | m_mode=mode; |
| 159 | |
| 160 | qCDebug(SHELL) << "Creating controllers"; |
| 161 | |
| 162 | if( !sessionController ) |
| 163 | { |
| 164 | sessionController = new SessionController(m_core); |
| 165 | } |
| 166 | if( !workingSetController && !(mode & Core::NoUi) ) |
| 167 | { |
| 168 | workingSetController = new WorkingSetController(); |
| 169 | } |
| 170 | qCDebug(SHELL) << "Creating ui controller"; |
| 171 | if( !uiController ) |
| 172 | { |
| 173 | uiController = new UiController(m_core); |
| 174 | } |
| 175 | qCDebug(SHELL) << "Creating plugin controller"; |
| 176 | |
| 177 | if( !pluginController ) |
| 178 | { |
| 179 | pluginController = new PluginController(m_core); |
| 180 | const auto pluginInfos = pluginController->allPluginInfos(); |
| 181 | if (pluginInfos.isEmpty()) { |
| 182 | const auto errorMessage = i18n( |
| 183 | "<p>Could not find any plugins during startup.<br/>" |
| 184 | "Please make sure QT_PLUGIN_PATH is set correctly.</p>" |
| 185 | "Refer to <a href=" |
| 186 | "\"https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source#Set_up_the_runtime_environment\"" |
| 187 | ">this article</a> for more information."); |
| 188 | if (mode & Core::NoUi) { |
| 189 | qCCritical(SHELL) << errorMessage; |
| 190 | } else { |
| 191 | QMessageBox::critical(nullptr, i18nc("@title:window", "No Plugins Found"), errorMessage, |
| 192 | QMessageBox::Abort, QMessageBox::Abort); |
| 193 | } |
| 194 | qCWarning(SHELL) << "Could not find any plugins, aborting"; |
| 195 | return false; |
| 196 | } |
| 197 | } |
| 198 | if( !partController && !(mode & Core::NoUi)) |
| 199 | { |
| 200 | partController = new PartController(m_core, uiController->defaultMainWindow()); |
| 201 | } |
| 202 | |
| 203 | if( !projectController ) |
| 204 | { |
| 205 | projectController = new ProjectController(m_core); |
| 206 | } |
| 207 | |
| 208 | if( !documentController ) |
| 209 | { |
| 210 | documentController = new DocumentController(m_core); |
| 211 | } |
| 212 | |
| 213 | if( !languageController ) |