View | Details | Raw Unified | Return to bug 155250
Collapse All | Expand All

(-)kwin/kcmkwin/kwinrules/main.cpp.sav (+5 lines)
Lines 50-55 Link Here
50
static void saveRules( const QValueList< Rules* >& rules )
50
static void saveRules( const QValueList< Rules* >& rules )
51
    {
51
    {
52
    KConfig cfg( "kwinrulesrc" );
52
    KConfig cfg( "kwinrulesrc" );
53
    QStringList groups = cfg.groupList();
54
    for( QStringList::ConstIterator it = groups.begin();
55
         it != groups.end();
56
         ++it )
57
        cfg.deleteGroup( *it );
53
    cfg.setGroup( "General" );
58
    cfg.setGroup( "General" );
54
    cfg.writeEntry( "count", rules.count());
59
    cfg.writeEntry( "count", rules.count());
55
    int i = 1;
60
    int i = 1;
(-)kwin/kcmkwin/kwinrules/ruleslist.cpp.sav (+5 lines)
Lines 172-177 Link Here
172
void KCMRulesList::save()
172
void KCMRulesList::save()
173
    {
173
    {
174
    KConfig cfg( "kwinrulesrc" );
174
    KConfig cfg( "kwinrulesrc" );
175
    QStringList groups = cfg.groupList();
176
    for( QStringList::ConstIterator it = groups.begin();
177
         it != groups.end();
178
         ++it )
179
        cfg.deleteGroup( *it );
175
    cfg.setGroup( "General" );
180
    cfg.setGroup( "General" );
176
    cfg.writeEntry( "count", rules.count());
181
    cfg.writeEntry( "count", rules.count());
177
    int i = 1;
182
    int i = 1;
(-)kwin/data/Makefile.am.sav (-4 / +9 lines)
Lines 1-11 Link Here
1
kconf_PROGRAMS = kwin_update_window_settings
1
kconf_PROGRAMS = kwin_update_window_settings kwin_update_default_rules
2
kconfdir = $(libdir)/kconf_update_bin
2
kconfdir = $(libdir)/kconf_update_bin
3
3
4
kwin_update_window_settings_SOURCES = update_window_settings.cpp
4
kwin_update_window_settings_SOURCES = update_window_settings.cpp
5
6
kwin_update_window_settings_LDADD   = $(LIB_KDECORE) $(KDE_RPATH)
5
kwin_update_window_settings_LDADD   = $(LIB_KDECORE) $(KDE_RPATH)
7
kwin_update_window_settings_LDFLAGS = $(all_libraries)
6
kwin_update_window_settings_LDFLAGS = $(all_libraries)
8
7
8
kwin_update_default_rules_SOURCES = update_default_rules.cpp
9
kwin_update_default_rules_LDADD   = $(LIB_KDECORE) $(KDE_RPATH)
10
kwin_update_default_rules_LDFLAGS = $(all_libraries)
11
9
INCLUDES = $(all_includes)
12
INCLUDES = $(all_includes)
10
13
11
METASOURCES = AUTO
14
METASOURCES = AUTO
Lines 14-20 Link Here
14
sound_DATA = pop.wav
17
sound_DATA = pop.wav
15
18
16
update_DATA = kwin.upd kwinsticky.upd kwiniconify.upd kwin3_plugin.upd kwin_focus1.upd \
19
update_DATA = kwin.upd kwinsticky.upd kwiniconify.upd kwin3_plugin.upd kwin_focus1.upd \
17
        kwinupdatewindowsettings.upd kwin_focus2.upd
20
        kwinupdatewindowsettings.upd kwin_focus2.upd kwin_fsp_workarounds_1.upd
18
update_SCRIPTS = pluginlibFix.pl kwin3_plugin.pl kwin_focus1.sh kwin_focus2.sh
21
update_SCRIPTS = pluginlibFix.pl kwin3_plugin.pl kwin_focus1.sh kwin_focus2.sh
19
20
updatedir = $(kde_datadir)/kconf_update
22
updatedir = $(kde_datadir)/kconf_update
23
24
kwin_default_rules_DATA = fsp_workarounds_1
25
kwin_default_rulesdir = $(kde_datadir)/kwin/default_rules
(-)kwin/data/update_default_rules.cpp.sav (+56 lines)
Line 0 Link Here
1
/*****************************************************************
2
 KWin - the KDE window manager
3
 This file is part of the KDE project.
4
5
Copyright (C) 2005 Lubos Lunak <l.lunak@kde.org>
6
7
You can Freely distribute this program under the GNU General Public
8
License. See the file "COPYING" for the exact licensing terms.
9
******************************************************************/
10
11
// read addtional window rules and add them to kwinrulesrc
12
13
#include <dcopclient.h>
14
#include <kconfig.h>
15
#include <kdebug.h>
16
#include <kinstance.h>
17
#include <kstandarddirs.h>
18
19
int main( int argc, char* argv[] )
20
    {
21
    if( argc != 2 )
22
        return 1;
23
    KInstance inst( "kwin_update_default_rules" );
24
    QString file = locate( "data", QString( "kwin/default_rules/" ) + argv[ 1 ] );
25
    if( file.isEmpty())
26
        {
27
        kdWarning() << "File " << argv[ 1 ] << " not found!" << endl;
28
        return 1;
29
        }
30
    KConfig src_cfg( file );
31
    KConfig dest_cfg( "kwinrulesrc" );
32
    src_cfg.setGroup( "General" );
33
    dest_cfg.setGroup( "General" );
34
    int count = src_cfg.readNumEntry( "count", 0 );
35
    int pos = dest_cfg.readNumEntry( "count", 0 );
36
    for( int group = 1;
37
         group <= count;
38
         ++group )
39
        {
40
        QMap< QString, QString > entries = src_cfg.entryMap( QString::number( group ));
41
        ++pos;
42
        dest_cfg.deleteGroup( QString::number( pos ));
43
        dest_cfg.setGroup( QString::number( pos ));
44
        for( QMap< QString, QString >::ConstIterator it = entries.begin();
45
             it != entries.end();
46
             ++it )
47
            dest_cfg.writeEntry( it.key(), *it );
48
        }
49
    dest_cfg.setGroup( "General" );
50
    dest_cfg.writeEntry( "count", pos );
51
    src_cfg.sync();
52
    dest_cfg.sync();
53
    DCOPClient client;
54
    client.attach();
55
    client.send("kwin*", "", "reconfigure()", "");
56
    }
(-)kwin/data/fsp_workarounds_1.sav (+42 lines)
Line 0 Link Here
1
[1]
2
description=(Default) Disable focus stealing prevention for OopenOffice.org 2.0
3
fsplevel=0
4
fsplevelrule=2
5
wmclass=vclsalframe openoffice.org 2.0
6
wmclasscomplete=true
7
wmclassmatch=1
8
9
[2]
10
description=(Default) Disable focus stealing prevention for Mozilla
11
fsplevel=0
12
fsplevelrule=2
13
wmclass=mozilla-bin
14
wmclasscomplete=false
15
wmclassmatch=1
16
17
[3]
18
description=(Default) Disable focus stealing prevention for Firefox
19
fsplevel=0
20
fsplevelrule=2
21
wmclass=firefox-bin
22
wmclasscomplete=false
23
wmclassmatch=1
24
25
[4]
26
description=(Default) Disable focus stealing prevention for Thunderbird
27
fsplevel=0
28
fsplevelrule=2
29
wmclass=thunderbird-bin
30
wmclasscomplete=false
31
wmclassmatch=1
32
33
[5]
34
description=(Default) Disable focus stealing prevention for XV
35
fsplevel=0
36
fsplevelrule=2
37
wmclass=^xv .*
38
wmclasscomplete=true
39
wmclassmatch=3
40
41
[General]
42
count=5
(-)kwin/data/kwin_fsp_workarounds_1.upd.sav (+8 lines)
Line 0 Link Here
1
Id=kde351
2
# the file is intentionally a dummy, as the binary will update kwinrulesrc,
3
# file kwinrules_update will just remember it has been done
4
File=kwinrules_update
5
Group=Dummy
6
Options=overwrite
7
ScriptArguments=fsp_workarounds_1
8
Script=kwin_update_default_rules
(-)kwin/rules.cpp.sav (+5 lines)
Lines 973-978 Link Here
973
    {
973
    {
974
    rulesUpdatedTimer.stop();
974
    rulesUpdatedTimer.stop();
975
    KConfig cfg( "kwinrulesrc" );
975
    KConfig cfg( "kwinrulesrc" );
976
    QStringList groups = cfg.groupList();
977
    for( QStringList::ConstIterator it = groups.begin();
978
         it != groups.end();
979
         ++it )
980
        cfg.deleteGroup( *it );
976
    cfg.setGroup( "General" );
981
    cfg.setGroup( "General" );
977
    cfg.writeEntry( "count", rules.count());
982
    cfg.writeEntry( "count", rules.count());
978
    int i = 1;
983
    int i = 1;

Return to bug 155250