From a2a78917898f86216726030db3bebc2702bbca74 Mon Sep 17 00:00:00 2001 From: Nikhil Marathe Date: Wed, 5 May 2010 12:09:49 +0000 Subject: [PATCH] SVN_SILENT Renamed tilingMode to tilingEnabled to better convey its boolean-ness svn path=/trunk/KDE/kdebase/workspace/; revision=1123140 --- activation.cpp | 2 +- geometry.cpp | 8 ++++---- sm.cpp | 8 ++++---- tiling.cpp | 22 +++++++++++----------- useractions.cpp | 2 +- workspace.cpp | 10 +++++----- workspace.h | 6 +++--- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/activation.cpp b/activation.cpp index bea853d570..9785b9ac24 100644 --- a/activation.cpp +++ b/activation.cpp @@ -260,7 +260,7 @@ void Workspace::setActiveClient( Client* c, allowed_t ) if( effects ) static_cast(effects)->windowActivated( active_client ? active_client->effectWindow() : NULL ); - if( tilingMode() ) + if( tilingEnabled() ) notifyWindowActivated( active_client ); --set_active_client_recursion; } diff --git a/geometry.cpp b/geometry.cpp index 08f1167daa..34ace6376d 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2816,7 +2816,7 @@ void Client::finishMoveResize( bool cancel ) leaveMoveResize(); - if( workspace()->tilingMode() ) + if( workspace()->tilingEnabled() ) { if( wasResize ) workspace()->notifyWindowResizeDone( this, moveResizeGeom, initialMoveResizeGeom, cancel ); @@ -3045,7 +3045,7 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root ) if( isResize()) { // query layout for supported resize mode - if( workspace()->tilingMode() ) + if( workspace()->tilingEnabled() ) { mode = workspace()->supportedTilingResizeMode( this, mode ); } @@ -3085,7 +3085,7 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root ) case PositionCenter: // exception for tiling // Center means no resizing allowed - if( workspace()->tilingMode() ) + if( workspace()->tilingEnabled() ) { finishMoveResize( false ); buttonDown = false; @@ -3308,7 +3308,7 @@ void Client::performMoveResize() } else { - if( !workspace()->tilingMode() ) + if( !workspace()->tilingEnabled() ) setGeometry( moveResizeGeom ); positionGeometryTip(); } diff --git a/sm.cpp b/sm.cpp index 5e8ec2440e..9b7fbd54f2 100644 --- a/sm.cpp +++ b/sm.cpp @@ -85,11 +85,11 @@ void Workspace::storeSession( KConfig* config, SMSavePhase phase ) if( phase == SMSavePhase2 || phase == SMSavePhase2Full ) { - cg.writeEntry( "tiling", tilingMode() ); - if( tilingMode() ) + cg.writeEntry( "tiling", tilingEnabled() ); + if( tilingEnabled() ) { kDebug(1212) << "Tiling was ON"; - setTilingMode( false ); + setTilingEnabled( false ); } } @@ -180,7 +180,7 @@ void Workspace::loadSessionInfo() session.clear(); KConfigGroup cg(kapp->sessionConfig(), "Session"); - setTilingMode( cg.readEntry( "tiling", false ) ); + setTilingEnabled( cg.readEntry( "tiling", false ) ); int count = cg.readEntry( "count",0 ); int active_client = cg.readEntry( "active",0 ); diff --git a/tiling.cpp b/tiling.cpp index bc781c75be..a9561e3d59 100644 --- a/tiling.cpp +++ b/tiling.cpp @@ -35,17 +35,17 @@ along with this program. If not, see . namespace KWin { -bool Workspace::tilingMode() const +bool Workspace::tilingEnabled() const { - return tilingMode_; + return tilingEnabled_; } -void Workspace::setTilingMode( bool tiling ) +void Workspace::setTilingEnabled( bool tiling ) { - if( tilingMode() == tiling ) return; - tilingMode_ = tiling; + if( tilingEnabled() == tiling ) return; + tilingEnabled_ = tiling; - if( tilingMode_ ) + if( tilingEnabled_ ) { tilingLayouts.resize( numberOfDesktops() + 1 ); foreach( Client *c, stackingOrder() ) @@ -62,15 +62,15 @@ void Workspace::setTilingMode( bool tiling ) void Workspace::slotToggleTiling() { - if ( tilingMode() ) + if ( tilingEnabled() ) { - setTilingMode( false ); + setTilingEnabled( false ); QString message = i18n( "Tiling Disabled" ); KNotification::event( "tilingdisabled", message, QPixmap(), NULL, KNotification::CloseOnTimeout, KComponentData( "kwin" ) ); } else { - setTilingMode( true ); + setTilingEnabled( true ); QString message = i18n( "Tiling Enabled" ); KNotification::event( "tilingenabled", message, QPixmap(), NULL, KNotification::CloseOnTimeout, KComponentData( "kwin" ) ); } @@ -84,7 +84,7 @@ void Workspace::createTile( Client *c ) if( c->desktop() < 0 || c->desktop() >= tilingLayouts.size() ) return; kDebug(1212) << "Now tiling " << c->caption(); - if( !tilingMode() || !tileable(c) ) + if( !tilingEnabled() || !tileable(c) ) return; Tile *t = new Tile( c, clientArea( PlacementArea, c ) ); @@ -144,7 +144,7 @@ void Workspace::belowCursor() Tile* Workspace::getNiceTile() const { - if( !tilingMode() ) return NULL; + if( !tilingEnabled() ) return NULL; if( !tilingLayouts.value( activeClient()->desktop() ) ) return NULL; return tilingLayouts[ activeClient()->desktop() ]->findTile( activeClient() ); diff --git a/useractions.cpp b/useractions.cpp index c98b9d4773..8bc3eb3b48 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -668,7 +668,7 @@ void Workspace::performWindowOperation( Client* c, Options::WindowOperation op ) if ( !c ) return; - if( tilingMode() + if( tilingEnabled() && ( op == Options::MaximizeOp || op == Options::HMaximizeOp || op == Options::VMaximizeOp diff --git a/workspace.cpp b/workspace.cpp index 7656a4a9bc..b0169b1983 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -96,7 +96,7 @@ Workspace::Workspace( bool restore ) , desktopGrid_( new int[2] ) , currentDesktop_( 0 ) , desktopLayoutDynamicity_( false ) - , tilingMode_( false ) + , tilingEnabled_( false ) // Unsorted , active_popup( NULL ) , active_popup_client( NULL ) @@ -473,7 +473,7 @@ void Workspace::init() CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr ); // Enable/disable tiling - setTilingMode( options->tilingOn ); + setTilingEnabled( options->tilingOn ); // SELI TODO: This won't work with unreasonable focus policies, // and maybe in rare cases also if the selected client doesn't @@ -660,7 +660,7 @@ void Workspace::removeClient( Client* c, allowed_t ) tab_box->nextPrev( true ); Q_ASSERT( clients.contains( c ) || desktops.contains( c )); - if( tilingMode() && tilingLayouts.value(c->desktop()) ) + if( tilingEnabled() && tilingLayouts.value(c->desktop()) ) { removeTile( c ); } @@ -1151,7 +1151,7 @@ void Workspace::slotReconfigure() discardUsedWindowRules( *it, false ); } - setTilingMode( options->tilingOn ); + setTilingEnabled( options->tilingOn ); // just so that we reset windows in the right manner, 'activate' the current active window notifyWindowActivated( activeClient() ); rootInfo->setSupported( NET::WM2FrameOverlap, mgr->factory()->supports( AbilityExtendIntoClientArea ) ); @@ -1421,7 +1421,7 @@ bool Workspace::setCurrentDesktop( int new_desktop ) { int old_desktop = movingClient->desktop(); movingClient->setDesktop( new_desktop ); - if( tilingMode() ) + if( tilingEnabled() ) { notifyWindowDesktopChanged( movingClient, old_desktop ); } diff --git a/workspace.h b/workspace.h index 368443b079..2da55bc8a1 100644 --- a/workspace.h +++ b/workspace.h @@ -174,8 +174,8 @@ class Workspace : public QObject, public KDecorationDefines //------------------------------------------------- // Tiling public: - bool tilingMode() const; - void setTilingMode( bool tiling ); + bool tilingEnabled() const; + void setTilingEnabled( bool tiling ); void updateAllTiles(); void notifyWindowResize( Client *c, const QRect &moveResizeGeom, const QRect &orig ); void notifyWindowMove( Client *c, const QRect &moveResizeGeom, const QRect &orig ); @@ -305,7 +305,7 @@ class Workspace : public QObject, public KDecorationDefines int currentDesktop_; bool desktopLayoutDynamicity_; - bool tilingMode_; + bool tilingEnabled_; QVector tilingLayouts; //-------------------------------------------------