Changeset View
Changeset View
Standalone View
Standalone View
kcms/input/kapplymousetheme.cpp
Show All 40 Lines | 36 | { | |||
---|---|---|---|---|---|
41 | QString theme = QFile::decodeName(argv[ 1 ]); | 41 | QString theme = QFile::decodeName(argv[ 1 ]); | ||
42 | QString size = QFile::decodeName(argv[ 2 ]); | 42 | QString size = QFile::decodeName(argv[ 2 ]); | ||
43 | 43 | | |||
44 | if (!KWindowSystem::isPlatformX11()) { | 44 | if (!KWindowSystem::isPlatformX11()) { | ||
45 | qDebug() << "X11 backend not detected. Exit."; | 45 | qDebug() << "X11 backend not detected. Exit."; | ||
46 | return 2; | 46 | return 2; | ||
47 | } | 47 | } | ||
48 | 48 | | |||
49 | X11Backend backend; | 49 | X11Backend *backend = X11Backend::implementation(); | ||
50 | 50 | | |||
51 | if (!backend.isValid()) { | 51 | if (!backend->isValid()) { | ||
52 | return 2; | 52 | return 2; | ||
53 | } | 53 | } | ||
54 | 54 | | |||
55 | // Note: If you update this code, update main.cpp as well. | 55 | // Note: If you update this code, update main.cpp as well. | ||
56 | 56 | | |||
57 | // use a default value for theme only if it's not configured at all, not even in X resources | 57 | // use a default value for theme only if it's not configured at all, not even in X resources | ||
58 | if(theme.isEmpty() && backend.currentCursorTheme().isEmpty()) | 58 | if(theme.isEmpty() && backend->currentCursorTheme().isEmpty()) | ||
59 | { | 59 | { | ||
60 | theme = "breeze_cursors"; | 60 | theme = "breeze_cursors"; | ||
61 | ret = 10; // means to switch to default | 61 | ret = 10; // means to switch to default | ||
62 | } | 62 | } | ||
63 | 63 | | |||
64 | backend.applyCursorTheme(theme, size.toInt()); | 64 | backend->applyCursorTheme(theme, size.toInt()); | ||
65 | | ||||
66 | delete backend; | ||||
65 | return ret; | 67 | return ret; | ||
66 | } | 68 | } |