mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
generic: fix indentation compiler warnings
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
321f77298f
commit
8024c8cbec
7 changed files with 102 additions and 106 deletions
|
@ -1211,7 +1211,7 @@ QString memberMutatorBody( CfgEntry *e, const CfgConfig &cfg )
|
|||
else
|
||||
out << enumName(e->param()) << "::enumToString[i]";
|
||||
|
||||
out << " )";
|
||||
out << " )";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -261,8 +261,9 @@ bool KStringHandler::isUtf8( const char *buf )
|
|||
following = 4;
|
||||
} else if ((c & 0x02) == 0) { /* 1111110x */
|
||||
following = 5;
|
||||
} else
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (n = 0; n < following; ++n) {
|
||||
i++;
|
||||
|
|
|
@ -116,18 +116,18 @@ void KPageWidget::removePage( KPageWidgetItem *item )
|
|||
void KPageWidget::setCurrentPage( KPageWidgetItem *item )
|
||||
{
|
||||
const QModelIndex index = d_func()->model()->index(item);
|
||||
if ( !index.isValid() )
|
||||
return;
|
||||
if ( !index.isValid() )
|
||||
return;
|
||||
|
||||
KPageView::setCurrentPage( index );
|
||||
KPageView::setCurrentPage( index );
|
||||
}
|
||||
|
||||
KPageWidgetItem* KPageWidget::currentPage() const
|
||||
{
|
||||
const QModelIndex index = KPageView::currentPage();
|
||||
const QModelIndex index = KPageView::currentPage();
|
||||
|
||||
if ( !index.isValid() )
|
||||
return 0;
|
||||
if ( !index.isValid() )
|
||||
return 0;
|
||||
|
||||
return d_func()->model()->item(index);
|
||||
}
|
||||
|
|
|
@ -507,7 +507,7 @@ void KPageWidgetModel::removePage( KPageWidgetItem *item )
|
|||
if ( parentPageItem != d->rootItem )
|
||||
index = createIndex( row, 0, parentPageItem );
|
||||
|
||||
beginRemoveRows(index, pageItem->row(), pageItem->row());
|
||||
beginRemoveRows(index, pageItem->row(), pageItem->row());
|
||||
|
||||
parentPageItem->removeChild( pageItem->row() );
|
||||
delete pageItem;
|
||||
|
@ -534,7 +534,7 @@ QModelIndex KPageWidgetModel::index( const KPageWidgetItem *item ) const
|
|||
if ( !item )
|
||||
return QModelIndex();
|
||||
|
||||
const PageItem *pageItem = d_func()->rootItem->findChild(item);
|
||||
const PageItem *pageItem = d_func()->rootItem->findChild(item);
|
||||
if ( !pageItem ) {
|
||||
return QModelIndex();
|
||||
}
|
||||
|
|
|
@ -867,7 +867,7 @@ QRect KWindowSystem::workArea( const QList<WId>& exclude, int desktop )
|
|||
// windows are cached here.
|
||||
NETStrut strut;
|
||||
QList< KWindowSystemPrivate::StrutData >::Iterator it2 = s_d->strutWindows.begin();
|
||||
for( ; it2 != s_d->strutWindows.end(); ++it2 )
|
||||
for( ; it2 != s_d->strutWindows.end(); ++it2 ) {
|
||||
if( (*it2).window == *it1 )
|
||||
break;
|
||||
|
||||
|
@ -885,8 +885,10 @@ QRect KWindowSystem::workArea( const QList<WId>& exclude, int desktop )
|
|||
|
||||
if( !(info.desktop() == desktop || info.desktop() == NETWinInfo::OnAllDesktops) )
|
||||
continue;
|
||||
} else
|
||||
} else {
|
||||
continue; // not a strut window
|
||||
}
|
||||
}
|
||||
|
||||
QRect r = all;
|
||||
if ( strut.left > 0 )
|
||||
|
|
|
@ -404,46 +404,40 @@ KBookmark KBookmarkContextMenu::bookmark() const
|
|||
|
||||
void KBookmarkMenu::slotBookmarksChanged( const QString & groupAddress )
|
||||
{
|
||||
kDebug(7043)<<"KBookmarkMenu::slotBookmarksChanged( "<<groupAddress;
|
||||
if ( groupAddress == m_parentAddress )
|
||||
{
|
||||
//kDebug(7043) << "KBookmarkMenu::slotBookmarksChanged -> setting m_bDirty on " << groupAddress;
|
||||
m_bDirty = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Iterate recursively into child menus
|
||||
for ( QList<KBookmarkMenu *>::iterator it = m_lstSubMenus.begin(), end = m_lstSubMenus.end() ;
|
||||
it != end ; ++it ) {
|
||||
(*it)->slotBookmarksChanged( groupAddress );
|
||||
kDebug(7043)<<"KBookmarkMenu::slotBookmarksChanged( "<<groupAddress;
|
||||
if ( groupAddress == m_parentAddress ) {
|
||||
//kDebug(7043) << "KBookmarkMenu::slotBookmarksChanged -> setting m_bDirty on " << groupAddress;
|
||||
m_bDirty = true;
|
||||
} else {
|
||||
// Iterate recursively into child menus
|
||||
foreach ( KBookmarkMenu *it, m_lstSubMenus ) {
|
||||
it->slotBookmarksChanged( groupAddress );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KBookmarkMenu::clear()
|
||||
{
|
||||
qDeleteAll( m_lstSubMenus );
|
||||
m_lstSubMenus.clear();
|
||||
qDeleteAll( m_lstSubMenus );
|
||||
m_lstSubMenus.clear();
|
||||
|
||||
for ( QList<QAction *>::iterator it = m_actions.begin(), end = m_actions.end() ;
|
||||
it != end ; ++it )
|
||||
{
|
||||
m_parentMenu->removeAction(*it);
|
||||
delete *it;
|
||||
}
|
||||
foreach ( QAction *it, m_actions ) {
|
||||
m_parentMenu->removeAction(it);
|
||||
delete it;
|
||||
}
|
||||
|
||||
m_parentMenu->clear();
|
||||
m_actions.clear();
|
||||
m_parentMenu->clear();
|
||||
m_actions.clear();
|
||||
}
|
||||
|
||||
void KBookmarkMenu::refill()
|
||||
{
|
||||
//kDebug(7043) << "KBookmarkMenu::refill()";
|
||||
if(m_bIsRoot)
|
||||
addActions();
|
||||
fillBookmarks();
|
||||
if(!m_bIsRoot)
|
||||
addActions();
|
||||
//kDebug(7043) << "KBookmarkMenu::refill()";
|
||||
if(m_bIsRoot)
|
||||
addActions();
|
||||
fillBookmarks();
|
||||
if(!m_bIsRoot)
|
||||
addActions();
|
||||
}
|
||||
|
||||
void KBookmarkMenu::addOpenInTabs()
|
||||
|
@ -481,8 +475,8 @@ void KBookmarkMenu::addAddBookmarksList()
|
|||
|
||||
void KBookmarkMenu::addAddBookmark()
|
||||
{
|
||||
if( !m_pOwner || !m_pOwner->enableOption(KBookmarkOwner::ShowAddBookmark) )
|
||||
return;
|
||||
if( !m_pOwner || !m_pOwner->enableOption(KBookmarkOwner::ShowAddBookmark) )
|
||||
return;
|
||||
|
||||
if (d->addAddBookmark == 0) {
|
||||
d->addAddBookmark = m_actionCollection->addAction(
|
||||
|
@ -499,13 +493,13 @@ void KBookmarkMenu::addAddBookmark()
|
|||
|
||||
void KBookmarkMenu::addEditBookmarks()
|
||||
{
|
||||
if( ( m_pOwner && !m_pOwner->enableOption(KBookmarkOwner::ShowEditBookmark) ) )
|
||||
return;
|
||||
if( ( m_pOwner && !m_pOwner->enableOption(KBookmarkOwner::ShowEditBookmark) ) )
|
||||
return;
|
||||
|
||||
KAction * m_paEditBookmarks = m_actionCollection->addAction(KStandardAction::EditBookmarks, "edit_bookmarks",
|
||||
KAction * m_paEditBookmarks = m_actionCollection->addAction(KStandardAction::EditBookmarks, "edit_bookmarks",
|
||||
m_pManager, SLOT(slotEditBookmarks()));
|
||||
m_parentMenu->addAction(m_paEditBookmarks);
|
||||
m_paEditBookmarks->setHelpText( i18n( "Edit your bookmark collection in a separate window" ) );
|
||||
m_parentMenu->addAction(m_paEditBookmarks);
|
||||
m_paEditBookmarks->setHelpText( i18n( "Edit your bookmark collection in a separate window" ) );
|
||||
}
|
||||
|
||||
void KBookmarkMenu::addNewFolder()
|
||||
|
|
|
@ -249,33 +249,33 @@ KCMultiDialog::~KCMultiDialog()
|
|||
void KCMultiDialog::slotDefaultClicked()
|
||||
{
|
||||
Q_D(KCMultiDialog);
|
||||
const KPageWidgetItem *item = currentPage();
|
||||
if ( !item )
|
||||
return;
|
||||
const KPageWidgetItem *item = currentPage();
|
||||
if ( !item )
|
||||
return;
|
||||
|
||||
for ( int i = 0; i < d->modules.count(); ++i ) {
|
||||
if ( d->modules[ i ].item == item ) {
|
||||
d->modules[ i ].kcm->defaults();
|
||||
for ( int i = 0; i < d->modules.count(); ++i ) {
|
||||
if ( d->modules[ i ].item == item ) {
|
||||
d->modules[ i ].kcm->defaults();
|
||||
d->_k_clientChanged();
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KCMultiDialog::slotUser1Clicked()
|
||||
{
|
||||
const KPageWidgetItem *item = currentPage();
|
||||
if ( !item )
|
||||
return;
|
||||
const KPageWidgetItem *item = currentPage();
|
||||
if ( !item )
|
||||
return;
|
||||
|
||||
Q_D(KCMultiDialog);
|
||||
for ( int i = 0; i < d->modules.count(); ++i ) {
|
||||
if ( d->modules[ i ].item == item ) {
|
||||
d->modules[ i ].kcm->load();
|
||||
for ( int i = 0; i < d->modules.count(); ++i ) {
|
||||
if ( d->modules[ i ].item == item ) {
|
||||
d->modules[ i ].kcm->load();
|
||||
d->_k_clientChanged();
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool KCMultiDialogPrivate::moduleSave(KCModuleProxy *module)
|
||||
|
@ -321,7 +321,7 @@ void KCMultiDialogPrivate::apply()
|
|||
|
||||
void KCMultiDialog::slotApplyClicked()
|
||||
{
|
||||
setButtonFocus( Apply );
|
||||
setButtonFocus( Apply );
|
||||
|
||||
d_func()->apply();
|
||||
}
|
||||
|
@ -329,55 +329,55 @@ void KCMultiDialog::slotApplyClicked()
|
|||
|
||||
void KCMultiDialog::slotOkClicked()
|
||||
{
|
||||
setButtonFocus( Ok );
|
||||
setButtonFocus( Ok );
|
||||
|
||||
d_func()->apply();
|
||||
accept();
|
||||
accept();
|
||||
}
|
||||
|
||||
void KCMultiDialog::slotHelpClicked()
|
||||
{
|
||||
const KPageWidgetItem *item = currentPage();
|
||||
if ( !item )
|
||||
return;
|
||||
const KPageWidgetItem *item = currentPage();
|
||||
if ( !item )
|
||||
return;
|
||||
|
||||
Q_D(KCMultiDialog);
|
||||
QString docPath;
|
||||
for ( int i = 0; i < d->modules.count(); ++i ) {
|
||||
if ( d->modules[ i ].item == item ) {
|
||||
docPath = d->modules[ i ].kcm->moduleInfo().docPath();
|
||||
break;
|
||||
QString docPath;
|
||||
for ( int i = 0; i < d->modules.count(); ++i ) {
|
||||
if ( d->modules[ i ].item == item ) {
|
||||
docPath = d->modules[ i ].kcm->moduleInfo().docPath();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#warning this can make use of KToolInvocation::invokeHelp()
|
||||
KUrl docUrl( KUrl( "help:/" ), docPath );
|
||||
KToolInvocation::invokeBrowser( docUrl.url() );
|
||||
KUrl docUrl( KUrl( "help:/" ), docPath );
|
||||
KToolInvocation::invokeBrowser( docUrl.url() );
|
||||
}
|
||||
|
||||
|
||||
KPageWidgetItem* KCMultiDialog::addModule( const QString& path, const QStringList& args )
|
||||
{
|
||||
QString complete = path;
|
||||
QString complete = path;
|
||||
|
||||
if ( !path.endsWith( QLatin1String(".desktop") ) )
|
||||
complete += ".desktop";
|
||||
if ( !path.endsWith( QLatin1String(".desktop") ) )
|
||||
complete += ".desktop";
|
||||
|
||||
KService::Ptr service = KService::serviceByStorageId( complete );
|
||||
KService::Ptr service = KService::serviceByStorageId( complete );
|
||||
|
||||
return addModule( KCModuleInfo( service ), 0, args );
|
||||
return addModule( KCModuleInfo( service ), 0, args );
|
||||
}
|
||||
|
||||
KPageWidgetItem* KCMultiDialog::addModule( const KCModuleInfo& moduleInfo,
|
||||
KPageWidgetItem *parentItem, const QStringList& args )
|
||||
{
|
||||
if ( !moduleInfo.service() )
|
||||
return 0;
|
||||
if ( !moduleInfo.service() )
|
||||
return 0;
|
||||
|
||||
//KAuthorized::authorizeControlModule( moduleInfo.service()->menuId() ) is
|
||||
//checked in noDisplay already
|
||||
if ( moduleInfo.service()->noDisplay() )
|
||||
return 0;
|
||||
//KAuthorized::authorizeControlModule( moduleInfo.service()->menuId() ) is
|
||||
//checked in noDisplay already
|
||||
if ( moduleInfo.service()->noDisplay() )
|
||||
return 0;
|
||||
|
||||
KCModuleProxy *kcm = new KCModuleProxy(moduleInfo, 0, args);
|
||||
|
||||
|
@ -440,31 +440,30 @@ KPageWidgetItem* KCMultiDialog::addModule( const KCModuleInfo& moduleInfo,
|
|||
connect(kcm->realModule(), SIGNAL(rootOnlyMessageChanged(bool,QString)), this, SLOT(_k_updateHeader(bool,QString)));
|
||||
|
||||
Q_D(KCMultiDialog);
|
||||
KCMultiDialogPrivate::CreatedModule cm;
|
||||
cm.kcm = kcm;
|
||||
cm.item = item;
|
||||
cm.componentNames = moduleInfo.service()->property( "X-KDE-ParentComponents" ).toStringList();
|
||||
d->modules.append( cm );
|
||||
KCMultiDialogPrivate::CreatedModule cm;
|
||||
cm.kcm = kcm;
|
||||
cm.item = item;
|
||||
cm.componentNames = moduleInfo.service()->property( "X-KDE-ParentComponents" ).toStringList();
|
||||
d->modules.append( cm );
|
||||
|
||||
if ( d->modules.count() == 1 || updateCurrentPage )
|
||||
{
|
||||
setCurrentPage( item );
|
||||
d->_k_clientChanged();
|
||||
}
|
||||
return item;
|
||||
if ( d->modules.count() == 1 || updateCurrentPage ) {
|
||||
setCurrentPage( item );
|
||||
d->_k_clientChanged();
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
void KCMultiDialog::clear()
|
||||
{
|
||||
Q_D(KCMultiDialog);
|
||||
kDebug( 710 ) ;
|
||||
kDebug( 710 ) ;
|
||||
|
||||
for ( int i = 0; i < d->modules.count(); ++i ) {
|
||||
removePage( d->modules[ i ].item );
|
||||
delete d->modules[ i ].kcm;
|
||||
}
|
||||
for ( int i = 0; i < d->modules.count(); ++i ) {
|
||||
removePage( d->modules[ i ].item );
|
||||
delete d->modules[ i ].kcm;
|
||||
}
|
||||
|
||||
d->modules.clear();
|
||||
d->modules.clear();
|
||||
|
||||
d->_k_clientChanged();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue