From 27d13ea5fbca9fbef389b07eaa25b035e6187865 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Sun, 15 Nov 2009 09:39:50 +0000 Subject: [PATCH] Fix compile on 64-bit systems. svn path=/trunk/KDE/kdebase/workspace/; revision=1049438 --- bridge.cpp | 6 +++--- bridge.h | 4 ++-- clients/oxygen/oxygenclient.cpp | 2 +- clients/tabstrip/tabstripdecoration.cpp | 2 +- kcmkwin/kwindecoration/preview.cpp | 4 ++-- kcmkwin/kwindecoration/preview.h | 4 ++-- lib/kcommondecoration.cpp | 4 ++-- lib/kcommondecoration.h | 4 ++-- lib/kdecoration.cpp | 4 ++-- lib/kdecoration.h | 4 ++-- lib/kdecorationbridge.h | 4 ++-- sm.cpp | 4 +++- 12 files changed, 24 insertions(+), 22 deletions(-) diff --git a/bridge.cpp b/bridge.cpp index 176d1b53a0..9db92a601a 100644 --- a/bridge.cpp +++ b/bridge.cpp @@ -218,10 +218,10 @@ QList< ClientGroupItem > Bridge::clientGroupItems() const return c->clientGroup()->items(); } -int Bridge::itemId( int index ) +long Bridge::itemId( int index ) { const ClientList list = c->clientGroup()->clients(); - return reinterpret_cast( list.at( index )); + return reinterpret_cast( list.at( index )); } int Bridge::visibleClientGroupItem() @@ -239,7 +239,7 @@ void Bridge::moveItemInClientGroup( int index, int before ) c->clientGroup()->move( index, before ); } -void Bridge::moveItemToClientGroup( int itemId, int before ) +void Bridge::moveItemToClientGroup( long itemId, int before ) { Client* item = reinterpret_cast( itemId ); c->workspace()->moveItemToClientGroup( item->clientGroup(), item->clientGroup()->indexOfClient( item ), diff --git a/bridge.h b/bridge.h index 169f34d843..b467e8f6bf 100644 --- a/bridge.h +++ b/bridge.h @@ -80,11 +80,11 @@ class Bridge : public KDecorationBridgeUnstable // Window tabbing virtual bool isClientGroupActive(); virtual QList< ClientGroupItem > clientGroupItems() const; - virtual int itemId( int index ); + virtual long itemId( int index ); virtual int visibleClientGroupItem(); virtual void setVisibleClientGroupItem( int index ); virtual void moveItemInClientGroup( int index, int before ); - virtual void moveItemToClientGroup( int itemId, int before ); + virtual void moveItemToClientGroup( long itemId, int before ); virtual void removeFromClientGroup( int index, const QRect& newGeom ); virtual void closeClientGroupItem( int index ); virtual void closeAllInClientGroup(); diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index 68e4255582..a78d63bd5b 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -1616,7 +1616,7 @@ namespace Oxygen setForceActive( true ); int itemClicked( OxygenClient::itemClicked( point, true ) ); - int source = QString( groupData->data( clientGroupItemDragMimeType() ) ).toInt(); + long source = QString( groupData->data( clientGroupItemDragMimeType() ) ).toLong(); moveItemToClientGroup( source, itemClicked ); } diff --git a/clients/tabstrip/tabstripdecoration.cpp b/clients/tabstrip/tabstripdecoration.cpp index ee8df3c7c7..82bace1b09 100644 --- a/clients/tabstrip/tabstripdecoration.cpp +++ b/clients/tabstrip/tabstripdecoration.cpp @@ -380,7 +380,7 @@ bool TabstripDecoration::dropEvent( QDropEvent* e ) } else { - int source = QString( group_data->data( clientGroupItemDragMimeType() ) ).toInt(); + long source = QString( group_data->data( clientGroupItemDragMimeType() ) ).toLong(); moveItemToClientGroup( source, itemClicked( point, true )); } return true; diff --git a/kcmkwin/kwindecoration/preview.cpp b/kcmkwin/kwindecoration/preview.cpp index 058426d529..8ed5d8fdf7 100644 --- a/kcmkwin/kwindecoration/preview.cpp +++ b/kcmkwin/kwindecoration/preview.cpp @@ -480,7 +480,7 @@ QList< ClientGroupItem > KDecorationPreviewBridge::clientGroupItems() const active ? "Active Window" : "Inactive Window", icon() ); } -int KDecorationPreviewBridge::itemId( int ) +long KDecorationPreviewBridge::itemId( int ) { return 0; } @@ -498,7 +498,7 @@ void KDecorationPreviewBridge::moveItemInClientGroup( int, int ) { } -void KDecorationPreviewBridge::moveItemToClientGroup( int, int ) +void KDecorationPreviewBridge::moveItemToClientGroup( long, int ) { } diff --git a/kcmkwin/kwindecoration/preview.h b/kcmkwin/kwindecoration/preview.h index cee3d03d09..7ebbdb2990 100644 --- a/kcmkwin/kwindecoration/preview.h +++ b/kcmkwin/kwindecoration/preview.h @@ -119,11 +119,11 @@ class KDecorationPreviewBridge // Window tabbing virtual bool isClientGroupActive(); virtual QList< ClientGroupItem > clientGroupItems() const; - virtual int itemId( int index ); + virtual long itemId( int index ); virtual int visibleClientGroupItem(); virtual void setVisibleClientGroupItem( int index ); virtual void moveItemInClientGroup( int index, int before ); - virtual void moveItemToClientGroup( int itemId, int before ); + virtual void moveItemToClientGroup( long itemId, int before ); virtual void removeFromClientGroup( int index, const QRect& newGeom ); virtual void closeClientGroupItem( int index ); virtual void closeAllInClientGroup(); diff --git a/lib/kcommondecoration.cpp b/lib/kcommondecoration.cpp index 470948bcd5..c62283ebd4 100644 --- a/lib/kcommondecoration.cpp +++ b/lib/kcommondecoration.cpp @@ -1291,7 +1291,7 @@ QList< ClientGroupItem > KCommonDecorationUnstable::clientGroupItems() const return static_cast( decoration() )->clientGroupItems(); } -int KCommonDecorationUnstable::itemId( int index ) +long KCommonDecorationUnstable::itemId( int index ) { return static_cast( decoration() )->itemId( index ); } @@ -1311,7 +1311,7 @@ void KCommonDecorationUnstable::moveItemInClientGroup( int index, int before ) static_cast( decoration() )->moveItemInClientGroup( index, before ); } -void KCommonDecorationUnstable::moveItemToClientGroup( int itemId, int before ) +void KCommonDecorationUnstable::moveItemToClientGroup( long itemId, int before ) { static_cast( decoration() )->moveItemToClientGroup( itemId, before ); } diff --git a/lib/kcommondecoration.h b/lib/kcommondecoration.h index 0af3385923..815186a4ec 100644 --- a/lib/kcommondecoration.h +++ b/lib/kcommondecoration.h @@ -384,11 +384,11 @@ class KWIN_EXPORT KCommonDecorationUnstable // Window tabbing bool isClientGroupActive(); QList< ClientGroupItem > clientGroupItems() const; - int itemId( int index ); + long itemId( int index ); int visibleClientGroupItem(); void setVisibleClientGroupItem( int index ); void moveItemInClientGroup( int index, int before ); - void moveItemToClientGroup( int itemId, int before = -1 ); + void moveItemToClientGroup( long itemId, int before = -1 ); void removeFromClientGroup( int index, const QRect& newGeom = QRect() ); void closeClientGroupItem( int index ); void closeAllInClientGroup(); diff --git a/lib/kdecoration.cpp b/lib/kdecoration.cpp index b2d53b6746..99e25116fe 100644 --- a/lib/kdecoration.cpp +++ b/lib/kdecoration.cpp @@ -415,7 +415,7 @@ QList< ClientGroupItem > KDecorationUnstable::clientGroupItems() const return static_cast< KDecorationBridgeUnstable* >( bridge_ )->clientGroupItems(); } -int KDecorationUnstable::itemId( int index ) +long KDecorationUnstable::itemId( int index ) { return static_cast< KDecorationBridgeUnstable* >( bridge_ )->itemId( index ); } @@ -435,7 +435,7 @@ void KDecorationUnstable::moveItemInClientGroup( int index, int before ) static_cast< KDecorationBridgeUnstable* >( bridge_ )->moveItemInClientGroup( index, before ); } -void KDecorationUnstable::moveItemToClientGroup( int itemId, int before ) +void KDecorationUnstable::moveItemToClientGroup( long itemId, int before ) { static_cast< KDecorationBridgeUnstable* >( bridge_ )->moveItemToClientGroup( itemId, before ); } diff --git a/lib/kdecoration.h b/lib/kdecoration.h index 4ee173f32f..e306c5232f 100644 --- a/lib/kdecoration.h +++ b/lib/kdecoration.h @@ -939,7 +939,7 @@ class KWIN_EXPORT KDecorationUnstable * Returns a unique identifier for the client at index \p index of the client group list. * \see moveItemToClientGroup() */ - int itemId( int index ); + long itemId( int index ); /** * Returns the list index of the currently visible client in this group. */ @@ -959,7 +959,7 @@ class KWIN_EXPORT KDecorationUnstable * moveItemInClientGroup() instead. * \see itemId() */ - void moveItemToClientGroup( int itemId, int before = -1 ); + void moveItemToClientGroup( long itemId, int before = -1 ); /** * Remove the client at index \p index from the group. If \p newGeom is set then the client * will move and resize to the specified geometry, otherwise it will stay where the group diff --git a/lib/kdecorationbridge.h b/lib/kdecorationbridge.h index fb48f88b9d..ef7b73894a 100644 --- a/lib/kdecorationbridge.h +++ b/lib/kdecorationbridge.h @@ -98,11 +98,11 @@ class KWIN_EXPORT KDecorationBridgeUnstable // Window tabbing virtual bool isClientGroupActive() = 0; virtual QList< ClientGroupItem > clientGroupItems() const = 0; - virtual int itemId( int index ) = 0; + virtual long itemId( int index ) = 0; virtual int visibleClientGroupItem() = 0; virtual void setVisibleClientGroupItem( int index ) = 0; virtual void moveItemInClientGroup( int index, int before ) = 0; - virtual void moveItemToClientGroup( int itemId, int before ) = 0; + virtual void moveItemToClientGroup( long itemId, int before ) = 0; virtual void removeFromClientGroup( int index, const QRect& newGeom ) = 0; virtual void closeClientGroupItem( int index ) = 0; virtual void closeAllInClientGroup() = 0; diff --git a/sm.cpp b/sm.cpp index c28a7a0282..7404fafd38 100644 --- a/sm.cpp +++ b/sm.cpp @@ -129,7 +129,9 @@ void Workspace::storeSession( KConfig* config, SMSavePhase phase ) cg.writeEntry( QString("stackingOrder")+n, unconstrained_stacking_order.indexOf( c )); int group = 0; if( c->clientGroup() ) - group = c->clientGroup()->clients().count() > 1 ? (int) c->clientGroup() : 0; + group = c->clientGroup()->clients().count() > 1 ? + // KConfig doesn't support long so we need to live with less precision on 64-bit systems + static_cast( reinterpret_cast( c->clientGroup() )) : 0; cg.writeEntry( QString("clientGroup")+n, group ); } }