Changeset View
Changeset View
Standalone View
Standalone View
src/quickaddons/configmodule.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | |||||
48 | public: | 48 | public: | ||
49 | ConfigModulePrivate(ConfigModule *module): | 49 | ConfigModulePrivate(ConfigModule *module): | ||
50 | _q(module), | 50 | _q(module), | ||
51 | _qmlObject(nullptr), | 51 | _qmlObject(nullptr), | ||
52 | _buttons(ConfigModule::Help | ConfigModule::Default | ConfigModule::Apply), | 52 | _buttons(ConfigModule::Help | ConfigModule::Default | ConfigModule::Apply), | ||
53 | _about(nullptr), | 53 | _about(nullptr), | ||
54 | _useRootOnlyMessage(false), | 54 | _useRootOnlyMessage(false), | ||
55 | _needsAuthorization(false), | 55 | _needsAuthorization(false), | ||
56 | _needsSave(false) | 56 | _needsSave(false), | ||
57 | _representsDefaults(false) | ||||
57 | { | 58 | { | ||
58 | } | 59 | } | ||
59 | 60 | | |||
60 | void authStatusChanged(int status); | 61 | void authStatusChanged(int status); | ||
61 | 62 | | |||
62 | ConfigModule *_q; | 63 | ConfigModule *_q; | ||
63 | KDeclarative::QmlObject *_qmlObject; | 64 | KDeclarative::QmlObject *_qmlObject; | ||
64 | ConfigModule::Buttons _buttons; | 65 | ConfigModule::Buttons _buttons; | ||
65 | const KAboutData *_about; | 66 | const KAboutData *_about; | ||
66 | QString _rootOnlyMessage; | 67 | QString _rootOnlyMessage; | ||
67 | QString _quickHelp; | 68 | QString _quickHelp; | ||
68 | QString _errorString; | 69 | QString _errorString; | ||
69 | QList<QQuickItem *> subPages; | 70 | QList<QQuickItem *> subPages; | ||
70 | int _columnWidth = -1; | 71 | int _columnWidth = -1; | ||
71 | int currentIndex = 0; | 72 | int currentIndex = 0; | ||
72 | bool _useRootOnlyMessage : 1; | 73 | bool _useRootOnlyMessage : 1; | ||
73 | 74 | | |||
74 | bool _needsAuthorization : 1; | 75 | bool _needsAuthorization : 1; | ||
75 | bool _needsSave :1; | 76 | bool _needsSave :1; | ||
77 | bool _representsDefaults :1; | ||||
76 | QString _authActionName; | 78 | QString _authActionName; | ||
77 | 79 | | |||
78 | static QHash<QObject *, ConfigModule *> s_rootObjects; | 80 | static QHash<QObject *, ConfigModule *> s_rootObjects; | ||
79 | }; | 81 | }; | ||
80 | 82 | | |||
81 | QHash<QObject *, ConfigModule *> ConfigModulePrivate::s_rootObjects = QHash<QObject *, ConfigModule *>(); | 83 | QHash<QObject *, ConfigModule *> ConfigModulePrivate::s_rootObjects = QHash<QObject *, ConfigModule *>(); | ||
82 | 84 | | |||
83 | 85 | | |||
▲ Show 20 Lines • Show All 374 Lines • ▼ Show 20 Line(s) | 454 | { | |||
458 | emit needsSaveChanged(); | 460 | emit needsSaveChanged(); | ||
459 | } | 461 | } | ||
460 | 462 | | |||
461 | bool ConfigModule::needsSave() | 463 | bool ConfigModule::needsSave() | ||
462 | { | 464 | { | ||
463 | return d->_needsSave; | 465 | return d->_needsSave; | ||
464 | } | 466 | } | ||
465 | 467 | | |||
468 | void ConfigModule::setRepresentsDefaults(bool defaults) | ||||
469 | { | ||||
470 | if (defaults == d->_representsDefaults) { | ||||
471 | return; | ||||
472 | } | ||||
473 | | ||||
474 | d->_representsDefaults = defaults; | ||||
475 | emit representsDefaultsChanged(); | ||||
476 | } | ||||
477 | | ||||
478 | bool ConfigModule::representsDefaults() | ||||
479 | { | ||||
480 | return d->_representsDefaults; | ||||
481 | } | ||||
482 | | ||||
466 | } | 483 | } | ||
467 | 484 | | |||
468 | #include "moc_configmodule.cpp" | 485 | #include "moc_configmodule.cpp" | ||
469 | 486 | |