diff --git a/activation.cpp b/activation.cpp index 5bfa0c6f94..caae038995 100644 --- a/activation.cpp +++ b/activation.cpp @@ -677,9 +677,10 @@ void Client::demandAttention( bool set ) if( demandAttentionKNotifyTimer == NULL ) { demandAttentionKNotifyTimer = new QTimer( this ); + demandAttentionKNotifyTimer->setSingleShot( true ); connect( demandAttentionKNotifyTimer, SIGNAL( timeout()), SLOT( demandAttentionKNotify())); } - demandAttentionKNotifyTimer->start( 1000, true ); + demandAttentionKNotifyTimer->start( 1000 ); } else info->setState( set ? NET::DemandsAttention : 0, NET::DemandsAttention ); diff --git a/client.cpp b/client.cpp index b632115870..ba6b946750 100644 --- a/client.cpp +++ b/client.cpp @@ -1510,7 +1510,7 @@ static int nullErrorHandler(Display *, XErrorEvent *) */ QByteArray Client::staticWindowRole(WId w) { - return getStringProperty(w, atoms->wm_window_role).lower(); + return getStringProperty(w, atoms->wm_window_role).toLower(); } /*! @@ -1856,7 +1856,7 @@ void Client::updateOpacity() ClientList tmpGroupMembers = group()->members(); ClientList activeGroupMembers; activeGroupMembers.append(this); - tmpGroupMembers.remove(this); + tmpGroupMembers.removeAll(this); ClientList::Iterator it = tmpGroupMembers.begin(); while (it != tmpGroupMembers.end()) // search for next attached and not activated client and repeat if found @@ -1875,7 +1875,7 @@ void Client::updateOpacity() // qWarning("activated, search restarted (1)"); (*it)->setShadowSize(options->activeWindowShadowSize); activeGroupMembers.append(*it); - tmpGroupMembers.remove(it); + tmpGroupMembers.erase(it); it = tmpGroupMembers.begin(); // restart, search next client continue; } @@ -1893,7 +1893,7 @@ void Client::updateOpacity() (*it)->setOpacity(options->translucentActiveWindows, options->activeWindowOpacity); (*it)->setShadowSize(options->activeWindowShadowSize); activeGroupMembers.append(*it); - tmpGroupMembers.remove(it); + tmpGroupMembers.erase(it); it = tmpGroupMembers.begin(); // reset potential client search found = true; // qWarning("activated, search restarted (2)"); @@ -1931,7 +1931,7 @@ void Client::updateOpacity() ClientList tmpGroupMembers = group()->members(); ClientList inactiveGroupMembers; inactiveGroupMembers.append(this); - tmpGroupMembers.remove(this); + tmpGroupMembers.removeAll(this); ClientList::Iterator it = tmpGroupMembers.begin(); while ( it != tmpGroupMembers.end() ) // search for next attached and not activated client and repeat if found @@ -1950,7 +1950,7 @@ void Client::updateOpacity() (*it)->setShadowSize(options->inactiveWindowShadowSize); // qWarning("deactivated, search restarted (1)"); inactiveGroupMembers.append(*it); - tmpGroupMembers.remove(it); + tmpGroupMembers.erase(it); it = tmpGroupMembers.begin(); // restart, search next client continue; } @@ -1969,7 +1969,7 @@ void Client::updateOpacity() (*it)->setShadowSize(options->inactiveWindowShadowSize); // qWarning("deactivated, search restarted (2)"); inactiveGroupMembers.append(*it); - tmpGroupMembers.remove(it); + tmpGroupMembers.erase(it); it = tmpGroupMembers.begin(); // reset potential client search found = true; break; // skip this loop diff --git a/clients/plastik/plastikbutton.cpp b/clients/plastik/plastikbutton.cpp index 12f4e012b7..2aa1a728b2 100644 --- a/clients/plastik/plastikbutton.cpp +++ b/clients/plastik/plastikbutton.cpp @@ -52,6 +52,7 @@ PlastikButton::PlastikButton(ButtonType type, PlastikClient *parent) // no need to reset here as the button will be resetted on first resize. animTmr = new QTimer(this); + animTmr->setSingleShot(true); // single-shot connect(animTmr, SIGNAL(timeout() ), this, SLOT(animate() ) ); animProgress = 0; } @@ -128,7 +129,7 @@ void PlastikButton::animate() } else { animProgress = ANIMATIONSTEPS; } - animTmr->start(TIMERINTERVAL, true); // single-shot + animTmr->start(TIMERINTERVAL); // single-shot timer } } else { if(animProgress > 0) { @@ -137,7 +138,7 @@ void PlastikButton::animate() } else { animProgress = 0; } - animTmr->start(TIMERINTERVAL, true); // single-shot + animTmr->start(TIMERINTERVAL); // single-shot timer } } diff --git a/events.cpp b/events.cpp index 5ba372e2e9..9d6ccd979c 100644 --- a/events.cpp +++ b/events.cpp @@ -893,7 +893,8 @@ void Client::enterNotifyEvent( XCrossingEvent* e ) delete shadeHoverTimer; shadeHoverTimer = new QTimer( this ); connect( shadeHoverTimer, SIGNAL( timeout() ), this, SLOT( shadeHover() )); - shadeHoverTimer->start( options->shadeHoverInterval, true ); + shadeHoverTimer->setSingleShot( true ); + shadeHoverTimer->start( options->shadeHoverInterval ); } if ( options->focusPolicy == Options::ClickToFocus ) @@ -906,7 +907,8 @@ void Client::enterNotifyEvent( XCrossingEvent* e ) delete autoRaiseTimer; autoRaiseTimer = new QTimer( this ); connect( autoRaiseTimer, SIGNAL( timeout() ), this, SLOT( autoRaise() ) ); - autoRaiseTimer->start( options->autoRaiseInterval, true ); + autoRaiseTimer->setSingleShot( true ); + autoRaiseTimer->start( options->autoRaiseInterval ); } if ( options->focusPolicy != Options::FocusStrictlyUnderMouse && ( isDesktop() || isDock() || isTopMenu() ) ) diff --git a/group.cpp b/group.cpp index 4d1548f70e..1805cd3b44 100644 --- a/group.cpp +++ b/group.cpp @@ -100,7 +100,7 @@ void Group::removeMember( Client* member_P ) // kDebug() << "GROUPREMOVE:" << this << ":" << member_P << endl; // kDebug() << kBacktrace() << endl; Q_ASSERT( _members.contains( member_P )); - _members.remove( member_P ); + _members.removeAll( member_P ); if( _members.isEmpty()) { workspace()->removeGroup( this, Allowed ); @@ -532,7 +532,7 @@ void Client::checkGroupTransients() { if( cl == *it1 ) { // don't use removeTransient(), that would modify *it2 too - (*it2)->transients_list.remove( *it1 ); + (*it2)->transients_list.removeAll( *it1 ); continue; } } @@ -541,7 +541,7 @@ void Client::checkGroupTransients() // and should be therefore on top of *it1 // TODO This could possibly be optimized, it also requires hasTransient() to check for loops. if( (*it2)->groupTransient() && (*it1)->hasTransient( *it2, true ) && (*it2)->hasTransient( *it1, true )) - (*it2)->transients_list.remove( *it1 ); + (*it2)->transients_list.removeAll( *it1 ); // if there are already windows W1 and W2, W2 being transient for W1, and group transient W3 // is added, make it transient only for W2, not for W1, because it's already indirectly // transient for it - the indirect transiency actually shouldn't break anything, @@ -556,9 +556,9 @@ void Client::checkGroupTransients() if( (*it2)->hasTransient( *it1, false ) && (*it3)->hasTransient( *it1, false )) { if( (*it2)->hasTransient( *it3, true )) - (*it3)->transients_list.remove( *it1 ); + (*it3)->transients_list.removeAll( *it1 ); if( (*it3)->hasTransient( *it2, true )) - (*it2)->transients_list.remove( *it1 ); + (*it2)->transients_list.removeAll( *it1 ); } } } @@ -661,7 +661,7 @@ void Client::removeTransient( Client* cl ) { // kDebug() << "REMOVETRANS:" << this << ":" << cl << endl; // kDebug() << kBacktrace() << endl; - transients_list.remove( cl ); + transients_list.removeAll( cl ); // cl is transient for this, but this is going away // make cl group transient if( cl->transientFor() == this ) @@ -834,7 +834,7 @@ void Client::checkGroup( Group* set_group, bool force ) ) { // group transients in the old group are no longer transient for it if( (*it)->groupTransient() && (*it)->group() != group()) - it = transients_list.remove( it ); + it = transients_list.erase( it ); else ++it; } diff --git a/kcmkwin/kwindecoration/buttons.cpp b/kcmkwin/kwindecoration/buttons.cpp index 62ed9d4cb7..9624988b0d 100644 --- a/kcmkwin/kwindecoration/buttons.cpp +++ b/kcmkwin/kwindecoration/buttons.cpp @@ -552,12 +552,12 @@ bool ButtonDropSite::removeButton(ButtonDropSiteItem *item) { return false; // try to remove the item from the left button list - if (buttonsLeft.remove(item) >= 1) { + if (buttonsLeft.removeAll(item) >= 1) { return true; } // try to remove the item from the right button list - if (buttonsRight.remove(item) >= 1) { + if (buttonsRight.removeAll(item) >= 1) { return true; } diff --git a/popupinfo.cpp b/popupinfo.cpp index f444a609a2..16cfe4dd44 100644 --- a/popupinfo.cpp +++ b/popupinfo.cpp @@ -43,6 +43,8 @@ PopupInfo::PopupInfo( const char *name ) m_shown = false; reset(); reconfigure(); + + m_delayedHideTimer.setSingleShot(true); connect(&m_delayedHideTimer, SIGNAL(timeout()), this, SLOT(hide())); QFont f = font(); @@ -144,7 +146,7 @@ void PopupInfo::showInfo(QString infoString) raise(); m_shown = true; } - m_delayedHideTimer.start(m_delayTime, true); + m_delayedHideTimer.start(m_delayTime); } } diff --git a/rules.cpp b/rules.cpp index a441166ab4..f204facb84 100644 --- a/rules.cpp +++ b/rules.cpp @@ -331,7 +331,7 @@ bool Rules::matchWMClass( const QByteArray& match_class, const QByteArray& match { // TODO optimize? QByteArray cwmclass = wmclasscomplete ? match_name + ' ' + match_class : match_class; - if( wmclassmatch == RegExpMatch && QRegExp( wmclass ).search( cwmclass ) == -1 ) + if( wmclassmatch == RegExpMatch && QRegExp( wmclass ).indexIn( cwmclass ) == -1 ) return false; if( wmclassmatch == ExactMatch && wmclass != cwmclass ) return false; @@ -345,7 +345,7 @@ bool Rules::matchRole( const QByteArray& match_role ) const { if( windowrolematch != UnimportantMatch ) { - if( windowrolematch == RegExpMatch && QRegExp( windowrole ).search( match_role ) == -1 ) + if( windowrolematch == RegExpMatch && QRegExp( windowrole ).indexIn( match_role ) == -1 ) return false; if( windowrolematch == ExactMatch && windowrole != match_role ) return false; @@ -359,7 +359,7 @@ bool Rules::matchTitle( const QString& match_title ) const { if( titlematch != UnimportantMatch ) { - if( titlematch == RegExpMatch && QRegExp( title ).search( match_title ) == -1 ) + if( titlematch == RegExpMatch && QRegExp( title ).indexIn( match_title ) == -1 ) return false; if( titlematch == ExactMatch && title != match_title ) return false; @@ -378,7 +378,7 @@ bool Rules::matchClientMachine( const QByteArray& match_machine ) const && matchClientMachine( "localhost" )) return true; if( clientmachinematch == RegExpMatch - && QRegExp( clientmachine ).search( match_machine ) == -1 ) + && QRegExp( clientmachine ).indexIn( match_machine ) == -1 ) return false; if( clientmachinematch == ExactMatch && clientmachine != match_machine ) @@ -926,7 +926,7 @@ WindowRules Workspace::findWindowRules( const Client* c, bool ignore_temporary ) Rules* rule = *it; kDebug( 1212 ) << "Rule found:" << rule << ":" << c << endl; if( rule->isTemporary()) - it = rules.remove( it ); + it = rules.erase( it ); else ++it; ret.append( rule ); @@ -1013,7 +1013,7 @@ void Workspace::cleanupTemporaryRules() ) { if( (*it)->discardTemporary( false )) - it = rules.remove( it ); + it = rules.erase( it ); else { if( (*it)->isTemporary()) @@ -1040,7 +1040,7 @@ void Workspace::discardUsedWindowRules( Client* c, bool withdrawn ) { c->removeRule( *it ); Rules* r = *it; - it = rules.remove( it ); + it = rules.erase( it ); delete r; continue; } @@ -1053,7 +1053,8 @@ void Workspace::discardUsedWindowRules( Client* c, bool withdrawn ) void Workspace::rulesUpdated() { - rulesUpdatedTimer.start( 1000, true ); + rulesUpdatedTimer.setSingleShot( true ); + rulesUpdatedTimer.start( 1000 ); } #endif diff --git a/tabbox.cpp b/tabbox.cpp index 82663a9e78..0416a06ed1 100644 --- a/tabbox.cpp +++ b/tabbox.cpp @@ -557,7 +557,8 @@ void TabBox::delayedShow() } int delayTime = c->readEntry("DelayTime", 90); - delayedShowTimer.start(delayTime, true); + delayedShowTimer.setSingleShot(true); + delayedShowTimer.start(delayTime); } diff --git a/useractions.cpp b/useractions.cpp index ac4b3908c0..853d41667a 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -1062,7 +1062,7 @@ void Client::setShortcut( const QString& _cut ) ++it ) { QRegExp reg( "(.*\\+)\\((.*)\\)" ); - if( reg.search( *it ) > -1 ) + if( reg.indexIn( *it ) > -1 ) { QString base = reg.cap( 1 ); QString list = reg.cap( 2 ); diff --git a/workspace.cpp b/workspace.cpp index 98faf72f07..41588799d0 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -326,6 +326,9 @@ void Workspace::init() // now we know how many desktops we'll, thus, we initialise the positioning object initPositioning = new Placement(this); + reconfigureTimer.setSingleShot( true ); + updateToolWindowsTimer.setSingleShot( true ); + connect(&reconfigureTimer, SIGNAL(timeout()), this, SLOT(slotReconfigure())); connect( &updateToolWindowsTimer, SIGNAL( timeout()), this, SLOT( slotUpdateToolWindows())); @@ -560,16 +563,16 @@ void Workspace::removeClient( Client* c, allowed_t ) Notify::raise( Notify::Delete ); Q_ASSERT( clients.contains( c ) || desktops.contains( c )); - clients.remove( c ); - desktops.remove( c ); - unconstrained_stacking_order.remove( c ); - stacking_order.remove( c ); + clients.removeAll( c ); + desktops.removeAll( c ); + unconstrained_stacking_order.removeAll( c ); + stacking_order.removeAll( c ); for( int i = 1; i <= numberOfDesktops(); ++i ) - focus_chain[ i ].remove( c ); - global_focus_chain.remove( c ); - attention_chain.remove( c ); + focus_chain[ i ].removeAll( c ); + global_focus_chain.removeAll( c ); + attention_chain.removeAll( c ); if( c->isTopMenu()) removeTopMenu( c ); Group* group = findGroup( c->window()); @@ -578,7 +581,7 @@ void Workspace::removeClient( Client* c, allowed_t ) if ( c == most_recently_raised ) most_recently_raised = 0; - should_get_focus.remove( c ); + should_get_focus.removeAll( c ); Q_ASSERT( c != active_client ); if ( c == last_active_client ) last_active_client = 0; @@ -602,8 +605,8 @@ void Workspace::updateFocusChains( Client* c, FocusChainChange change ) for( int i=1; i<= numberOfDesktops(); ++i ) - focus_chain[i].remove(c); - global_focus_chain.remove( c ); + focus_chain[i].removeAll(c); + global_focus_chain.removeAll( c ); return; } if(c->desktop() == NET::OnAllDesktops) @@ -613,7 +616,7 @@ void Workspace::updateFocusChains( Client* c, FocusChainChange change ) if( i == currentDesktop() && ( change == FocusChainMakeFirst || change == FocusChainMakeLast )) { - focus_chain[ i ].remove( c ); + focus_chain[ i ].removeAll( c ); if( change == FocusChainMakeFirst ) focus_chain[ i ].append( c ); else @@ -631,7 +634,7 @@ void Workspace::updateFocusChains( Client* c, FocusChainChange change ) { if( change == FocusChainMakeFirst ) { - focus_chain[ i ].remove( c ); + focus_chain[ i ].removeAll( c ); focus_chain[ i ].append( c ); } else if( change == FocusChainMakeLast ) @@ -643,12 +646,12 @@ void Workspace::updateFocusChains( Client* c, FocusChainChange change ) focus_chain[ i ].prepend( c ); } else - focus_chain[ i ].remove( c ); + focus_chain[ i ].removeAll( c ); } } if( change == FocusChainMakeFirst ) { - global_focus_chain.remove( c ); + global_focus_chain.removeAll( c ); global_focus_chain.append( c ); } else if( change == FocusChainMakeLast ) @@ -742,7 +745,7 @@ void Workspace::updateCurrentTopMenu() // make it appear like it's been raised manually - it's in the Dock layer anyway, // and not raising it could mess up stacking order of topmenus within one application, // and thus break raising of mainclients in raiseClient() - unconstrained_stacking_order.remove( menubar ); + unconstrained_stacking_order.removeAll( menubar ); unconstrained_stacking_order.append( menubar ); } else if( !block_desktop_menubar ) @@ -851,7 +854,7 @@ void Workspace::updateToolWindows( bool also_hide ) } else // setActiveClient() is after called with NULL client, quickly followed { // by setting a new client, which would result in flickering - updateToolWindowsTimer.start( 50, true ); + updateToolWindowsTimer.start( 50 ); } } @@ -877,7 +880,7 @@ void Workspace::updateColormap() void Workspace::reconfigure() { - reconfigureTimer.start(200, true); + reconfigureTimer.start( 200 ); } @@ -1063,9 +1066,9 @@ bool Workspace::isNotManaged( const QString& title ) for ( QStringList::Iterator it = doNotManageList.begin(); it != doNotManageList.end(); ++it ) { QRegExp r( (*it) ); - if (r.search(title) != -1) + if (r.indexIn(title) != -1) { - doNotManageList.remove( it ); + doNotManageList.erase( it ); return true; } } @@ -1114,7 +1117,7 @@ void ObscuringWindows::create( Client* c ) int mask = CWSibling | CWStackMode; if( cached->count() > 0 ) { - cached->remove( obs_win = cached->first()); + cached->removeAll( obs_win = cached->first()); chngs.x = c->x(); chngs.y = c->y(); chngs.width = c->width(); @@ -1583,7 +1586,7 @@ bool Workspace::removeSystemTrayWin( WId w, bool check ) XFree( props ); } } - systemTrayWins.remove( w ); + systemTrayWins.removeAll( w ); propagateSystemTrayWins(); return true; } @@ -1963,7 +1966,8 @@ void Workspace::requestDelayFocus( Client* c ) delete delayFocusTimer; delayFocusTimer = new QTimer( this ); connect( delayFocusTimer, SIGNAL( timeout() ), this, SLOT( delayFocus() ) ); - delayFocusTimer->start( options->delayFocusInterval, true ); + delayFocusTimer->setSingleShot( true ); + delayFocusTimer->start( options->delayFocusInterval ); } void Workspace::cancelDelayFocus() @@ -2269,7 +2273,7 @@ void Workspace::removeTopMenu( Client* c ) // kDebug() << "REMOVE TOPMENU:" << c << endl; assert( c->isTopMenu()); assert( topmenus.contains( c )); - topmenus.remove( c ); + topmenus.removeAll( c ); updateCurrentTopMenu(); // TODO reduce topMenuHeight() if possible? } @@ -2506,20 +2510,20 @@ void Workspace::handleKompmgrOutput( KProcess* , char *buffer, int buflen) { QString message; QString output = QString::fromLocal8Bit( buffer, buflen ); - if (output.contains("Started",false)) + if (output.contains("Started",Qt::CaseInsensitive)) ; // don't do anything, just pass to the connection release - else if (output.contains("Can't open display",false)) + else if (output.contains("Can't open display",Qt::CaseInsensitive)) message = i18n("kompmgr failed to open the display
There is probably an invalid display entry in your ~/.xcompmgrrc.
"); - else if (output.contains("No render extension",false)) + else if (output.contains("No render extension",Qt::CaseInsensitive)) message = i18n("kompmgr cannot find the Xrender extension
You are using either an outdated or a crippled version of XOrg.
Get XOrg ≥ 6.8 from www.freedesktop.org.
"); - else if (output.contains("No composite extension",false)) + else if (output.contains("No composite extension",Qt::CaseInsensitive)) message = i18n("Composite extension not found
You must use XOrg ≥ 6.8 for translucency and shadows to work.
Additionally, you need to add a new section to your X config file:
" "Section \"Extensions\"
" "Option \"Composite\" \"Enable\"
" "EndSection
"); - else if (output.contains("No damage extension",false)) + else if (output.contains("No damage extension",Qt::CaseInsensitive)) message = i18n("Damage extension not found
You must use XOrg ≥ 6.8 for translucency and shadows to work.
"); - else if (output.contains("No XFixes extension",false)) + else if (output.contains("No XFixes extension",Qt::CaseInsensitive)) message = i18n("XFixes extension not found
You must use XOrg ≥ 6.8 for translucency and shadows to work.
"); else return; //skip others // kompmgr startup failed or succeeded, release connection