Changeset View
Changeset View
Standalone View
Standalone View
core/ModuleView.cpp
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Line(s) | 169 | if ( !KAuthorized::authorizeControlModule( module->service()->menuId() ) ) { | |||
---|---|---|---|---|---|
170 | qWarning() << "Not authorised to load module" ; | 170 | qWarning() << "Not authorised to load module" ; | ||
171 | return; | 171 | return; | ||
172 | } | 172 | } | ||
173 | if( module->service()->noDisplay() ) { | 173 | if( module->service()->noDisplay() ) { | ||
174 | return; | 174 | return; | ||
175 | } | 175 | } | ||
176 | 176 | | |||
177 | // Create the scroller | 177 | // Create the scroller | ||
178 | QScrollArea * moduleScroll = new QScrollArea( this ); | 178 | QScrollArea * moduleScroll = new QScrollArea( this ); | ||
davidedmundson: why? | |||||
179 | // Prepare the scroll area | 179 | // Prepare the scroll area | ||
180 | moduleScroll->setWidgetResizable( true ); | 180 | moduleScroll->setWidgetResizable( true ); | ||
181 | moduleScroll->setFrameStyle( QFrame::NoFrame ); | 181 | moduleScroll->setFrameStyle( QFrame::NoFrame ); | ||
182 | moduleScroll->viewport()->setAutoFillBackground( false ); | 182 | moduleScroll->viewport()->setAutoFillBackground( false ); | ||
183 | // Create the page | 183 | // Create the page | ||
184 | KPageWidgetItem *page = new KPageWidgetItem( moduleScroll, module->moduleName() ); | 184 | KPageWidgetItem *page = new KPageWidgetItem( moduleScroll, module->moduleName() ); | ||
185 | // Provide information to the users | 185 | // Provide information to the users | ||
186 | 186 | | |||
Show All 27 Lines | 206 | { | |||
214 | 214 | | |||
215 | if( !moduleInfo ) { | 215 | if( !moduleInfo ) { | ||
216 | // Seems like we have some form of a race condition going on here... | 216 | // Seems like we have some form of a race condition going on here... | ||
217 | return; | 217 | return; | ||
218 | } | 218 | } | ||
219 | 219 | | |||
220 | page->setHeader( moduleInfo->comment() ); | 220 | page->setHeader( moduleInfo->comment() ); | ||
221 | page->setIcon( QIcon::fromTheme( moduleInfo->icon() ) ); | 221 | page->setIcon( QIcon::fromTheme( moduleInfo->icon() ) ); | ||
222 | //HACK: not much other ways to detect is a qml kcm | ||||
davidedmundson: we could add a property on KCModule that KCModuleQml sets | |||||
223 | if (moduleProxy->realModule()->inherits("KCModuleQml")) { | ||||
224 | page->setHeaderVisible(false); | ||||
225 | } | ||||
222 | if( light ) { | 226 | if( light ) { | ||
223 | return; | 227 | return; | ||
224 | } | 228 | } | ||
225 | 229 | | |||
226 | if( moduleProxy && moduleProxy->realModule()->useRootOnlyMessage() ) { | 230 | if( moduleProxy && moduleProxy->realModule()->useRootOnlyMessage() ) { | ||
227 | page->setHeader( moduleInfo->comment() + QStringLiteral("<br><small>") + moduleProxy->realModule()->rootOnlyMessage() + QStringLiteral("</small>") ); | 231 | page->setHeader( moduleInfo->comment() + QStringLiteral("<br><small>") + moduleProxy->realModule()->rootOnlyMessage() + QStringLiteral("</small>") ); | ||
228 | page->setIcon( KDE::icon( moduleInfo->icon(), QStringList() << QStringLiteral("dialog-warning") ) ); | 232 | page->setIcon( KDE::icon( moduleInfo->icon(), QStringList() << QStringLiteral("dialog-warning") ) ); | ||
229 | } | 233 | } | ||
▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines |
why?