@ -19,7 +19,7 @@
*
*/
# include < qdir.h>
# include < t qdir.h>
# include <kconfig.h>
# include <ksimpleconfig.h>
@ -57,7 +57,7 @@ static KInstance *instance = NULL;
typedef struct _ConfigFiles
{
KSimpleConfig * main ;
QString profile ;
T QString profile ;
KConfig * kwin ;
KConfig * global ;
Bool modified ;
@ -82,9 +82,9 @@ SpecialOptionType;
struct _SpecialOption
{
QString settingName ;
QString pluginName ;
QString kdeName ;
T QString settingName ;
T QString pluginName ;
T QString kdeName ;
bool global ;
SpecialOptionType type ;
}
@ -95,8 +95,8 @@ const specialOptions[] =
{ " lower_window_key " , CORE_NAME , " Window Lower " , true , OptionKey } ,
{ " toggle_window_maximized_key " , CORE_NAME , " Window Maximize " , true , OptionKey } ,
{ " minimize_window_key " , CORE_NAME , " Window Minimize " , true , OptionKey } ,
{ " toggle_window_maximized_horizontally_key " , CORE_NAME , " Window Maximize Horizontal" , true , OptionKey } ,
{ " toggle_window_maximized_vertically_key " , CORE_NAME , " Window Maximize Vertical" , true , OptionKey } ,
{ " toggle_window_maximized_horizontally_key " , CORE_NAME , " Window Maximize Qt:: Horizontal" , true , OptionKey } ,
{ " toggle_window_maximized_vertically_key " , CORE_NAME , " Window Maximize Qt:: Vertical" , true , OptionKey } ,
{ " show_desktop_key " , CORE_NAME , " Toggle Showing Desktop " , true , OptionKey } ,
{ " window_menu_key " , CORE_NAME , " Window Operations Menu " , true , OptionKey } ,
{ " toggle_window_shaded_key " , CORE_NAME , " Window Shade " , true , OptionKey } ,
@ -199,11 +199,11 @@ const specialOptions[] =
# define N_SOPTIONS (sizeof (specialOptions) / sizeof (struct _SpecialOption))
static void
createFile ( QString name )
createFile ( T QString name )
{
if ( ! QFile: : exists ( name ) )
if ( ! T QFile: : exists ( name ) )
{
QFile file ( name ) ;
T QFile file ( name ) ;
file . open ( IO_WriteOnly | IO_Append ) ;
file . close ( ) ;
}
@ -234,7 +234,7 @@ isIntegratedOption (CCSSetting *setting)
for ( unsigned int i = 0 ; i < N_SOPTIONS ; i + + )
{
if ( setting - > name = = specialOptions [ i ] . settingName & &
QString ( setting - > parent - > name ) = = specialOptions [ i ] . pluginName )
T QString ( setting - > parent - > name ) = = specialOptions [ i ] . pluginName )
return true ;
}
@ -305,7 +305,7 @@ readIntegratedOption (CCSSetting *setting)
for ( unsigned int i = 0 ; i < N_SOPTIONS ; i + + )
{
if ( setting - > name = = specialOptions [ i ] . settingName & &
QString ( setting - > parent - > name ) = = specialOptions [ i ] . pluginName )
T QString ( setting - > parent - > name ) = = specialOptions [ i ] . pluginName )
{
option = i ;
break ;
@ -363,7 +363,7 @@ readIntegratedOption (CCSSetting *setting)
else if ( specialOptions [ option ] . settingName = = " mode " & &
specialOptions [ option ] . pluginName = = " resize " )
{
QString mode = cFiles - > kwin - > readEntry ( " ResizeMode " ) ;
T QString mode = cFiles - > kwin - > readEntry ( " ResizeMode " ) ;
int imode = - 1 ;
int result = 0 ;
@ -521,7 +521,7 @@ readIntegratedOption (CCSSetting *setting)
else if ( specialOptions [ option ] . settingName = = " mode " & &
specialOptions [ option ] . pluginName = = " place " )
{
QString mode = cFiles - > kwin - > readEntry ( " Placement " ) ;
T QString mode = cFiles - > kwin - > readEntry ( " Placement " ) ;
int result = 0 ;
@ -566,7 +566,7 @@ getSettingIsReadOnly (CCSSetting *setting)
for ( unsigned int i = 0 ; i < N_SOPTIONS ; i + + )
{
if ( setting - > name = = specialOptions [ i ] . settingName & &
QString ( setting - > parent - > name ) = = specialOptions [ i ] . pluginName )
T QString ( setting - > parent - > name ) = = specialOptions [ i ] . pluginName )
{
option = i ;
break ;
@ -612,21 +612,21 @@ getExistingProfiles (CCSContext *)
if ( ! instance )
instance = new KInstance ( " ccs-backend-kconfig " ) ;
QDir dir ( KGlobal : : dirs ( ) - > saveLocation ( " config " , QString: : null , false ) ,
T QDir dir ( KGlobal : : dirs ( ) - > saveLocation ( " config " , TQString( ) , false ) ,
" compizrc.* " ) ;
QStringList files = dir . entryList ( ) ;
T QStringList files = dir . entryList ( ) ;
CCSStringList ret = NULL ;
QStringList: : iterator it ;
T QStringList: : iterator it ;
for ( it = files . begin ( ) ; it ! = files . end ( ) ; it + + )
{
QString str = ( * it ) ;
T QString str = ( * it ) ;
if ( str . length ( ) > 9 )
{
QString profile = str . right ( str . length ( ) - 9 ) ;
T QString profile = str . right ( str . length ( ) - 9 ) ;
if ( ! profile . isEmpty ( ) )
ret = ccsStringListAppend ( ret , strdup ( profile . ascii ( ) ) ) ;
@ -643,13 +643,13 @@ readSetting (CCSContext *c,
KSimpleConfig * cfg = cFiles - > main ;
QString key ( setting - > name ) ;
QString group ( setting - > parent - > name ) ;
T QString key ( setting - > name ) ;
T QString group ( setting - > parent - > name ) ;
if ( setting - > isScreen )
{
group + = " _screen " ;
group + = QString: : number ( setting - > screenNum ) ;
group + = T QString: : number ( setting - > screenNum ) ;
}
else
group + = " _display " ;
@ -697,7 +697,7 @@ readSetting (CCSContext *c,
case TypeColor :
{
QString str = cfg - > readEntry ( key ) ;
T QString str = cfg - > readEntry ( key ) ;
CCSSettingColorValue color ;
int c [ 4 ] ;
@ -721,12 +721,12 @@ readSetting (CCSContext *c,
case TypeBool :
{
QValueList< int > list = cfg - > readIntListEntry ( key ) ;
T QValueList< int > list = cfg - > readIntListEntry ( key ) ;
Bool * array = new Bool [ list . count ( ) ] ;
int i = 0 ;
QValueList< int > : : iterator it ;
T QValueList< int > : : iterator it ;
for ( it = list . begin ( ) ; it ! = list . end ( ) ; it + + )
{
@ -745,12 +745,12 @@ readSetting (CCSContext *c,
case TypeInt :
{
QValueList< int > list = cfg - > readIntListEntry ( key ) ;
T QValueList< int > list = cfg - > readIntListEntry ( key ) ;
int * array = new int [ list . count ( ) ] ;
int i = 0 ;
QValueList< int > : : iterator it ;
T QValueList< int > : : iterator it ;
for ( it = list . begin ( ) ; it ! = list . end ( ) ; it + + )
{
@ -769,7 +769,7 @@ readSetting (CCSContext *c,
case TypeString :
{
QStringList list = cfg - > readListEntry ( key ) ;
T QStringList list = cfg - > readListEntry ( key ) ;
if ( ! list . count ( ) )
break ;
@ -778,7 +778,7 @@ readSetting (CCSContext *c,
int i = 0 ;
QStringList: : iterator it ;
T QStringList: : iterator it ;
for ( it = list . begin ( ) ; it ! = list . end ( ) ; it + + )
{
@ -802,7 +802,7 @@ readSetting (CCSContext *c,
case TypeMatch :
{
QStringList list = cfg - > readListEntry ( key ) ;
T QStringList list = cfg - > readListEntry ( key ) ;
if ( ! list . count ( ) )
break ;
@ -811,7 +811,7 @@ readSetting (CCSContext *c,
int i = 0 ;
QStringList: : iterator it ;
T QStringList: : iterator it ;
for ( it = list . begin ( ) ; it ! = list . end ( ) ; it + + )
{
@ -835,12 +835,12 @@ readSetting (CCSContext *c,
case TypeFloat :
{
QStringList list = cfg - > readListEntry ( key ) ;
T QStringList list = cfg - > readListEntry ( key ) ;
float * array = new float [ list . count ( ) ] ;
int i = 0 ;
QStringList: : iterator it ;
T QStringList: : iterator it ;
for ( it = list . begin ( ) ; it ! = list . end ( ) ; it + + )
{
@ -859,13 +859,13 @@ readSetting (CCSContext *c,
case TypeColor :
{
QStringList list = cfg - > readListEntry ( key ) ;
T QStringList list = cfg - > readListEntry ( key ) ;
CCSSettingColorValue * array =
new CCSSettingColorValue [ list . count ( ) ] ;
int i = 0 ;
QStringList: : iterator it ;
T QStringList: : iterator it ;
for ( it = list . begin ( ) ; it ! = list . end ( ) ; it + + )
{
@ -894,12 +894,12 @@ readSetting (CCSContext *c,
case TypeKey :
{
QStringList list = cfg - > readListEntry ( key ) ;
T QStringList list = cfg - > readListEntry ( key ) ;
CCSSettingValue * val = NULL ;
CCSSettingValueList l = NULL ;
QStringList: : iterator it ;
T QStringList: : iterator it ;
for ( it = list . begin ( ) ; it ! = list . end ( ) ; it + + )
{
@ -919,12 +919,12 @@ readSetting (CCSContext *c,
break ;
case TypeButton :
{
QStringList list = cfg - > readListEntry ( key ) ;
T QStringList list = cfg - > readListEntry ( key ) ;
CCSSettingValue * val = NULL ;
CCSSettingValueList l = NULL ;
QStringList: : iterator it ;
T QStringList: : iterator it ;
for ( it = list . begin ( ) ; it ! = list . end ( ) ; it + + )
{
@ -944,12 +944,12 @@ readSetting (CCSContext *c,
break ;
case TypeEdge :
{
QStringList list = cfg - > readListEntry ( key ) ;
T QStringList list = cfg - > readListEntry ( key ) ;
CCSSettingValue * val = NULL ;
CCSSettingValueList l = NULL ;
QStringList: : iterator it ;
T QStringList: : iterator it ;
for ( it = list . begin ( ) ; it ! = list . end ( ) ; it + + )
{
@ -966,12 +966,12 @@ readSetting (CCSContext *c,
break ;
case TypeBell :
{
QValueList< int > list = cfg - > readIntListEntry ( key ) ;
T QValueList< int > list = cfg - > readIntListEntry ( key ) ;
CCSSettingValue * val = NULL ;
CCSSettingValueList l = NULL ;
QValueList< int > : : iterator it ;
T QValueList< int > : : iterator it ;
for ( it = list . begin ( ) ; it ! = list . end ( ) ; it + + )
{
@ -993,7 +993,7 @@ readSetting (CCSContext *c,
case TypeKey :
{
QString str = cfg - > readEntry ( key ) ;
T QString str = cfg - > readEntry ( key ) ;
CCSSettingKeyValue value ;
@ -1004,7 +1004,7 @@ readSetting (CCSContext *c,
break ;
case TypeButton :
{
QString str = cfg - > readEntry ( key ) ;
T QString str = cfg - > readEntry ( key ) ;
CCSSettingButtonValue value ;
@ -1015,7 +1015,7 @@ readSetting (CCSContext *c,
break ;
case TypeEdge :
{
QString str = cfg - > readEntry ( key ) ;
T QString str = cfg - > readEntry ( key ) ;
unsigned int value ;
@ -1118,7 +1118,7 @@ writeIntegratedOption (CCSSetting *setting)
for ( unsigned int i = 0 ; i < N_SOPTIONS ; i + + )
{
if ( setting - > name = = specialOptions [ i ] . settingName & &
QString ( setting - > parent - > name ) = = specialOptions [ i ] . pluginName )
T QString ( setting - > parent - > name ) = = specialOptions [ i ] . pluginName )
{
option = i ;
break ;
@ -1150,8 +1150,8 @@ writeIntegratedOption (CCSSetting *setting)
if ( specialOptions [ option ] . settingName = = " click_to_focus " )
{
QString mode = cFiles - > kwin - > readEntry ( " FocusPolicy " ) ;
QString val = " ClickToFocus " ;
T QString mode = cFiles - > kwin - > readEntry ( " FocusPolicy " ) ;
T QString val = " ClickToFocus " ;
Bool bVal ;
if ( ! ccsGetBool ( setting , & bVal ) )
@ -1178,8 +1178,8 @@ writeIntegratedOption (CCSSetting *setting)
if ( specialOptions [ option ] . settingName = = " mode " & &
specialOptions [ option ] . pluginName = = " resize " )
{
QString mode = cFiles - > kwin - > readEntry ( " ResizeMode " ) ;
QString val = " Opaque " ;
T QString mode = cFiles - > kwin - > readEntry ( " ResizeMode " ) ;
T QString val = " Opaque " ;
int iVal ;
if ( ccsGetInt ( setting , & iVal ) & & ( iVal = = 1 | | iVal = = 2 ) )
{
@ -1396,13 +1396,13 @@ writeSetting (CCSContext *c,
{
KSimpleConfig * cfg = cFiles - > main ;
QString key ( setting - > name ) ;
QString group ( setting - > parent - > name ) ;
T QString key ( setting - > name ) ;
T QString group ( setting - > parent - > name ) ;
if ( setting - > isScreen )
{
group + = " _screen " ;
group + = QString: : number ( setting - > screenNum ) ;
group + = T QString: : number ( setting - > screenNum ) ;
}
else
group + = " _display " ;
@ -1477,7 +1477,7 @@ writeSetting (CCSContext *c,
color . color . blue / 256 ,
color . color . alpha / 256 ) ;
cfg - > writeEntry ( key , QString ( tmp ) ) ;
cfg - > writeEntry ( key , T QString ( tmp ) ) ;
}
break ;
@ -1488,7 +1488,7 @@ writeSetting (CCSContext *c,
case TypeBool :
{
QValueList< int > list ;
T QValueList< int > list ;
CCSSettingValueList l ;
if ( ! ccsGetList ( setting , & l ) )
@ -1506,7 +1506,7 @@ writeSetting (CCSContext *c,
case TypeInt :
{
QValueList< int > list ;
T QValueList< int > list ;
CCSSettingValueList l ;
if ( ! ccsGetList ( setting , & l ) )
@ -1524,7 +1524,7 @@ writeSetting (CCSContext *c,
case TypeString :
{
QStringList list ;
T QStringList list ;
CCSSettingValueList l ;
if ( ! ccsGetList ( setting , & l ) )
@ -1542,7 +1542,7 @@ writeSetting (CCSContext *c,
case TypeMatch :
{
QStringList list ;
T QStringList list ;
CCSSettingValueList l ;
if ( ! ccsGetList ( setting , & l ) )
@ -1560,7 +1560,7 @@ writeSetting (CCSContext *c,
case TypeFloat :
{
QStringList list ;
T QStringList list ;
CCSSettingValueList l ;
if ( ! ccsGetList ( setting , & l ) )
@ -1568,7 +1568,7 @@ writeSetting (CCSContext *c,
while ( l )
{
list . append ( QString: : number ( l - > data - > value . asFloat ) ) ;
list . append ( T QString: : number ( l - > data - > value . asFloat ) ) ;
l = l - > next ;
}
@ -1578,7 +1578,7 @@ writeSetting (CCSContext *c,
case TypeColor :
{
QStringList list ;
T QStringList list ;
CCSSettingValueList l ;
if ( ! ccsGetList ( setting , & l ) )
@ -1594,7 +1594,7 @@ writeSetting (CCSContext *c,
l - > data - > value . asColor . array . array [ 2 ] / 256 ,
l - > data - > value . asColor . array . array [ 3 ] / 256 ) ;
list . append ( QString ( tmp ) ) ;
list . append ( T QString ( tmp ) ) ;
l = l - > next ;
}
@ -1603,7 +1603,7 @@ writeSetting (CCSContext *c,
break ;
case TypeKey :
{
QStringList list ;
T QStringList list ;
CCSSettingValueList l ;
if ( ! ccsGetList ( setting , & l ) )
@ -1611,7 +1611,7 @@ writeSetting (CCSContext *c,
while ( l )
{
QString str ;
T QString str ;
char * val ;
val = ccsKeyBindingToString ( & l - > data - > value . asKey ) ;
@ -1627,7 +1627,7 @@ writeSetting (CCSContext *c,
break ;
case TypeButton :
{
QStringList list ;
T QStringList list ;
CCSSettingValueList l ;
if ( ! ccsGetList ( setting , & l ) )
@ -1635,7 +1635,7 @@ writeSetting (CCSContext *c,
while ( l )
{
QString str ;
T QString str ;
char * val ;
val = ccsButtonBindingToString (
& l - > data - > value . asButton ) ;
@ -1652,7 +1652,7 @@ writeSetting (CCSContext *c,
break ;
case TypeEdge :
{
QStringList list ;
T QStringList list ;
CCSSettingValueList l ;
if ( ! ccsGetList ( setting , & l ) )
@ -1660,7 +1660,7 @@ writeSetting (CCSContext *c,
while ( l )
{
QString str ;
T QString str ;
char * val ;
val = ccsEdgesToString ( l - > data - > value . asEdge ) ;
@ -1676,7 +1676,7 @@ writeSetting (CCSContext *c,
break ;
case TypeBell :
{
QValueList< int > list ;
T QValueList< int > list ;
CCSSettingValueList l ;
if ( ! ccsGetList ( setting , & l ) )
@ -1764,7 +1764,7 @@ readInit (CCSContext *c)
if ( cFiles - > profile ! = ccsGetProfile ( c ) )
{
QString configName ( " compizrc " ) ;
T QString configName ( " compizrc " ) ;
if ( ccsGetProfile ( c ) & & strlen ( ccsGetProfile ( c ) ) )
{
@ -1775,8 +1775,8 @@ readInit (CCSContext *c)
delete cFiles - > main ;
QString wFile = KGlobal : : dirs ( ) - > saveLocation ( " config " ,
QString: : null , false ) + configName ;
T QString wFile = KGlobal : : dirs ( ) - > saveLocation ( " config " ,
TQString( ) , false ) + configName ;
createFile ( wFile ) ;
cFiles - > main = new KSimpleConfig ( configName ) ;
@ -1800,7 +1800,7 @@ writeInit (CCSContext *c)
if ( cFiles - > profile ! = ccsGetProfile ( c ) )
{
QString configName ( " compizrc " ) ;
T QString configName ( " compizrc " ) ;
if ( ccsGetProfile ( c ) & & strlen ( ccsGetProfile ( c ) ) )
{
@ -1811,8 +1811,8 @@ writeInit (CCSContext *c)
delete cFiles - > main ;
QString wFile = KGlobal : : dirs ( ) - > saveLocation ( " config " ,
QString: : null , false ) + configName ;
T QString wFile = KGlobal : : dirs ( ) - > saveLocation ( " config " ,
TQString( ) , false ) + configName ;
createFile ( wFile ) ;
@ -1840,7 +1840,7 @@ writeDone (CCSContext *)
DCOPClient * client = kapp - > dcopClient ( ) ;
if ( ! client - > isAttached ( ) )
client - > attach ( ) ;
client - > send ( " kwin " , " KWinInterface " , " reconfigure() " , " " ) ;
client - > send ( " kwin " , " KWinInterface " , " reconfigure() " , TQString ( " " ) ) ;
cFiles - > modified = false ;
}
ccsEnableFileWatch ( cFiles - > watch ) ;
@ -1857,7 +1857,7 @@ init (CCSContext *c)
cFiles = new ConfigFiles ;
QString configName ( " compizrc " ) ;
T QString configName ( " compizrc " ) ;
if ( ccsGetProfile ( c ) & & strlen ( ccsGetProfile ( c ) ) )
{
@ -1866,8 +1866,8 @@ init (CCSContext *c)
cFiles - > profile = ccsGetProfile ( c ) ;
}
QString wFile = KGlobal : : dirs ( ) - > saveLocation ( " config " ,
QString: : null , false ) + configName ;
T QString wFile = KGlobal : : dirs ( ) - > saveLocation ( " config " ,
TQString( ) , false ) + configName ;
createFile ( wFile ) ;
@ -1881,11 +1881,11 @@ init (CCSContext *c)
cFiles - > watch = ccsAddFileWatch ( wFile . ascii ( ) , TRUE , reload , ( void * ) c ) ;
wFile = KGlobal : : dirs ( ) - > saveLocation ( " config " ,
QString: : null , false ) + " kwinrc " ;
TQString( ) , false ) + " kwinrc " ;
cFiles - > kwinWatch = ccsAddFileWatch ( wFile . ascii ( ) , TRUE , reload ,
( void * ) c ) ;
wFile = KGlobal : : dirs ( ) - > saveLocation ( " config " ,
QString: : null , false ) + " kdeglobals " ;
TQString( ) , false ) + " kdeglobals " ;
cFiles - > globalWatch = ccsAddFileWatch ( wFile . ascii ( ) , TRUE , reload ,
( void * ) c ) ;
@ -1922,8 +1922,8 @@ static Bool
deleteProfile ( CCSContext * ,
char * profile )
{
QString file ( KGlobal : : dirs ( ) - > saveLocation ( " config " ,
QString: : null , false ) ) ;
T QString file ( KGlobal : : dirs ( ) - > saveLocation ( " config " ,
TQString( ) , false ) ) ;
file + = " compizrc " ;
if ( profile & & strlen ( profile ) )
@ -1932,8 +1932,8 @@ deleteProfile (CCSContext *,
file + = profile ;
}
if ( QFile: : exists ( file ) )
return QFile: : remove ( file ) ;
if ( T QFile: : exists ( file ) )
return T QFile: : remove ( file ) ;
return FALSE ;
}