SVN_SILENT Renamed tilingMode to tilingEnabled to better convey its boolean-ness

svn path=/trunk/KDE/kdebase/workspace/; revision=1123140
This commit is contained in:
Nikhil Marathe 2010-05-05 12:09:49 +00:00
parent 70c9e98c41
commit a2a7891789
7 changed files with 29 additions and 29 deletions

View file

@ -260,7 +260,7 @@ void Workspace::setActiveClient( Client* c, allowed_t )
if( effects ) if( effects )
static_cast<EffectsHandlerImpl*>(effects)->windowActivated( active_client ? active_client->effectWindow() : NULL ); static_cast<EffectsHandlerImpl*>(effects)->windowActivated( active_client ? active_client->effectWindow() : NULL );
if( tilingMode() ) if( tilingEnabled() )
notifyWindowActivated( active_client ); notifyWindowActivated( active_client );
--set_active_client_recursion; --set_active_client_recursion;
} }

View file

@ -2816,7 +2816,7 @@ void Client::finishMoveResize( bool cancel )
leaveMoveResize(); leaveMoveResize();
if( workspace()->tilingMode() ) if( workspace()->tilingEnabled() )
{ {
if( wasResize ) if( wasResize )
workspace()->notifyWindowResizeDone( this, moveResizeGeom, initialMoveResizeGeom, cancel ); 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()) if( isResize())
{ {
// query layout for supported resize mode // query layout for supported resize mode
if( workspace()->tilingMode() ) if( workspace()->tilingEnabled() )
{ {
mode = workspace()->supportedTilingResizeMode( this, mode ); mode = workspace()->supportedTilingResizeMode( this, mode );
} }
@ -3085,7 +3085,7 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root )
case PositionCenter: case PositionCenter:
// exception for tiling // exception for tiling
// Center means no resizing allowed // Center means no resizing allowed
if( workspace()->tilingMode() ) if( workspace()->tilingEnabled() )
{ {
finishMoveResize( false ); finishMoveResize( false );
buttonDown = false; buttonDown = false;
@ -3308,7 +3308,7 @@ void Client::performMoveResize()
} }
else else
{ {
if( !workspace()->tilingMode() ) if( !workspace()->tilingEnabled() )
setGeometry( moveResizeGeom ); setGeometry( moveResizeGeom );
positionGeometryTip(); positionGeometryTip();
} }

8
sm.cpp
View file

@ -85,11 +85,11 @@ void Workspace::storeSession( KConfig* config, SMSavePhase phase )
if( phase == SMSavePhase2 || phase == SMSavePhase2Full ) if( phase == SMSavePhase2 || phase == SMSavePhase2Full )
{ {
cg.writeEntry( "tiling", tilingMode() ); cg.writeEntry( "tiling", tilingEnabled() );
if( tilingMode() ) if( tilingEnabled() )
{ {
kDebug(1212) << "Tiling was ON"; kDebug(1212) << "Tiling was ON";
setTilingMode( false ); setTilingEnabled( false );
} }
} }
@ -180,7 +180,7 @@ void Workspace::loadSessionInfo()
session.clear(); session.clear();
KConfigGroup cg(kapp->sessionConfig(), "Session"); KConfigGroup cg(kapp->sessionConfig(), "Session");
setTilingMode( cg.readEntry( "tiling", false ) ); setTilingEnabled( cg.readEntry( "tiling", false ) );
int count = cg.readEntry( "count",0 ); int count = cg.readEntry( "count",0 );
int active_client = cg.readEntry( "active",0 ); int active_client = cg.readEntry( "active",0 );

View file

@ -35,17 +35,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace KWin 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; if( tilingEnabled() == tiling ) return;
tilingMode_ = tiling; tilingEnabled_ = tiling;
if( tilingMode_ ) if( tilingEnabled_ )
{ {
tilingLayouts.resize( numberOfDesktops() + 1 ); tilingLayouts.resize( numberOfDesktops() + 1 );
foreach( Client *c, stackingOrder() ) foreach( Client *c, stackingOrder() )
@ -62,15 +62,15 @@ void Workspace::setTilingMode( bool tiling )
void Workspace::slotToggleTiling() void Workspace::slotToggleTiling()
{ {
if ( tilingMode() ) if ( tilingEnabled() )
{ {
setTilingMode( false ); setTilingEnabled( false );
QString message = i18n( "Tiling Disabled" ); QString message = i18n( "Tiling Disabled" );
KNotification::event( "tilingdisabled", message, QPixmap(), NULL, KNotification::CloseOnTimeout, KComponentData( "kwin" ) ); KNotification::event( "tilingdisabled", message, QPixmap(), NULL, KNotification::CloseOnTimeout, KComponentData( "kwin" ) );
} }
else else
{ {
setTilingMode( true ); setTilingEnabled( true );
QString message = i18n( "Tiling Enabled" ); QString message = i18n( "Tiling Enabled" );
KNotification::event( "tilingenabled", message, QPixmap(), NULL, KNotification::CloseOnTimeout, KComponentData( "kwin" ) ); 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; if( c->desktop() < 0 || c->desktop() >= tilingLayouts.size() ) return;
kDebug(1212) << "Now tiling " << c->caption(); kDebug(1212) << "Now tiling " << c->caption();
if( !tilingMode() || !tileable(c) ) if( !tilingEnabled() || !tileable(c) )
return; return;
Tile *t = new Tile( c, clientArea( PlacementArea, c ) ); Tile *t = new Tile( c, clientArea( PlacementArea, c ) );
@ -144,7 +144,7 @@ void Workspace::belowCursor()
Tile* Workspace::getNiceTile() const Tile* Workspace::getNiceTile() const
{ {
if( !tilingMode() ) return NULL; if( !tilingEnabled() ) return NULL;
if( !tilingLayouts.value( activeClient()->desktop() ) ) return NULL; if( !tilingLayouts.value( activeClient()->desktop() ) ) return NULL;
return tilingLayouts[ activeClient()->desktop() ]->findTile( activeClient() ); return tilingLayouts[ activeClient()->desktop() ]->findTile( activeClient() );

View file

@ -668,7 +668,7 @@ void Workspace::performWindowOperation( Client* c, Options::WindowOperation op )
if ( !c ) if ( !c )
return; return;
if( tilingMode() if( tilingEnabled()
&& ( op == Options::MaximizeOp && ( op == Options::MaximizeOp
|| op == Options::HMaximizeOp || op == Options::HMaximizeOp
|| op == Options::VMaximizeOp || op == Options::VMaximizeOp

View file

@ -96,7 +96,7 @@ Workspace::Workspace( bool restore )
, desktopGrid_( new int[2] ) , desktopGrid_( new int[2] )
, currentDesktop_( 0 ) , currentDesktop_( 0 )
, desktopLayoutDynamicity_( false ) , desktopLayoutDynamicity_( false )
, tilingMode_( false ) , tilingEnabled_( false )
// Unsorted // Unsorted
, active_popup( NULL ) , active_popup( NULL )
, active_popup_client( NULL ) , active_popup_client( NULL )
@ -473,7 +473,7 @@ void Workspace::init()
CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr ); CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr );
// Enable/disable tiling // Enable/disable tiling
setTilingMode( options->tilingOn ); setTilingEnabled( options->tilingOn );
// SELI TODO: This won't work with unreasonable focus policies, // SELI TODO: This won't work with unreasonable focus policies,
// and maybe in rare cases also if the selected client doesn't // 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 ); tab_box->nextPrev( true );
Q_ASSERT( clients.contains( c ) || desktops.contains( c )); Q_ASSERT( clients.contains( c ) || desktops.contains( c ));
if( tilingMode() && tilingLayouts.value(c->desktop()) ) if( tilingEnabled() && tilingLayouts.value(c->desktop()) )
{ {
removeTile( c ); removeTile( c );
} }
@ -1151,7 +1151,7 @@ void Workspace::slotReconfigure()
discardUsedWindowRules( *it, false ); discardUsedWindowRules( *it, false );
} }
setTilingMode( options->tilingOn ); setTilingEnabled( options->tilingOn );
// just so that we reset windows in the right manner, 'activate' the current active window // just so that we reset windows in the right manner, 'activate' the current active window
notifyWindowActivated( activeClient() ); notifyWindowActivated( activeClient() );
rootInfo->setSupported( NET::WM2FrameOverlap, mgr->factory()->supports( AbilityExtendIntoClientArea ) ); rootInfo->setSupported( NET::WM2FrameOverlap, mgr->factory()->supports( AbilityExtendIntoClientArea ) );
@ -1421,7 +1421,7 @@ bool Workspace::setCurrentDesktop( int new_desktop )
{ {
int old_desktop = movingClient->desktop(); int old_desktop = movingClient->desktop();
movingClient->setDesktop( new_desktop ); movingClient->setDesktop( new_desktop );
if( tilingMode() ) if( tilingEnabled() )
{ {
notifyWindowDesktopChanged( movingClient, old_desktop ); notifyWindowDesktopChanged( movingClient, old_desktop );
} }

View file

@ -174,8 +174,8 @@ class Workspace : public QObject, public KDecorationDefines
//------------------------------------------------- //-------------------------------------------------
// Tiling // Tiling
public: public:
bool tilingMode() const; bool tilingEnabled() const;
void setTilingMode( bool tiling ); void setTilingEnabled( bool tiling );
void updateAllTiles(); void updateAllTiles();
void notifyWindowResize( Client *c, const QRect &moveResizeGeom, const QRect &orig ); void notifyWindowResize( Client *c, const QRect &moveResizeGeom, const QRect &orig );
void notifyWindowMove( 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_; int currentDesktop_;
bool desktopLayoutDynamicity_; bool desktopLayoutDynamicity_;
bool tilingMode_; bool tilingEnabled_;
QVector<TilingLayout *> tilingLayouts; QVector<TilingLayout *> tilingLayouts;
//------------------------------------------------- //-------------------------------------------------