KWin::Application holdes a KSharedConfigPtr with the config
This allows the integration tests to provide their own configuration as they need it. Setting the configuration should be done before invoking start()icc-effect-5.14.5
parent
2636aad5c3
commit
1f7daa934d
|
@ -75,6 +75,7 @@ target_link_libraries( testXcbWrapper
|
|||
Qt5::Test
|
||||
Qt5::X11Extras
|
||||
Qt5::Widgets
|
||||
KF5::ConfigCore
|
||||
KF5::WindowSystem
|
||||
XCB::XCB
|
||||
)
|
||||
|
@ -86,6 +87,7 @@ if (XCB_ICCCM_FOUND)
|
|||
target_link_libraries( testXcbSizeHints
|
||||
Qt5::Test
|
||||
Qt5::X11Extras
|
||||
KF5::ConfigCore
|
||||
KF5::WindowSystem
|
||||
XCB::XCB
|
||||
XCB::ICCCM
|
||||
|
@ -106,6 +108,7 @@ target_link_libraries( testXcbWindow
|
|||
Qt5::Test
|
||||
Qt5::X11Extras
|
||||
Qt5::Widgets
|
||||
KF5::ConfigCore
|
||||
KF5::WindowSystem
|
||||
XCB::XCB
|
||||
)
|
||||
|
|
9
main.cpp
9
main.cpp
|
@ -150,6 +150,7 @@ Application::Application(Application::OperationMode mode, int &argc, char **argv
|
|||
: QApplication(argc, argv)
|
||||
, m_eventFilter(new XcbEventFilter())
|
||||
, m_configLock(false)
|
||||
, m_config()
|
||||
, m_operationMode(mode)
|
||||
{
|
||||
qRegisterMetaType<Options::WindowOperation>("Options::WindowOperation");
|
||||
|
@ -184,11 +185,13 @@ void Application::start()
|
|||
{
|
||||
setQuitOnLastWindowClosed(false);
|
||||
|
||||
KSharedConfig::Ptr config = KSharedConfig::openConfig();
|
||||
if (!config->isImmutable() && m_configLock) {
|
||||
if (!m_config) {
|
||||
m_config = KSharedConfig::openConfig();
|
||||
}
|
||||
if (!m_config->isImmutable() && m_configLock) {
|
||||
// TODO: This shouldn't be necessary
|
||||
//config->setReadOnly( true );
|
||||
config->reparseConfiguration();
|
||||
m_config->reparseConfiguration();
|
||||
}
|
||||
|
||||
crashChecking();
|
||||
|
|
9
main.h
9
main.h
|
@ -27,6 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include <KSelectionWatcher>
|
||||
#include <KSelectionOwner>
|
||||
#include <KSharedConfig>
|
||||
// Qt
|
||||
#include <QApplication>
|
||||
#include <QAbstractNativeEventFilter>
|
||||
|
@ -76,6 +77,13 @@ public:
|
|||
|
||||
void setConfigLock(bool lock);
|
||||
|
||||
KSharedConfigPtr config() const {
|
||||
return m_config;
|
||||
}
|
||||
void setConfig(KSharedConfigPtr config) {
|
||||
m_config = config;
|
||||
}
|
||||
|
||||
void start();
|
||||
/**
|
||||
* @brief The operation mode used by KWin.
|
||||
|
@ -209,6 +217,7 @@ private:
|
|||
void crashChecking();
|
||||
QScopedPointer<XcbEventFilter> m_eventFilter;
|
||||
bool m_configLock;
|
||||
KSharedConfigPtr m_config;
|
||||
OperationMode m_operationMode;
|
||||
xcb_timestamp_t m_x11Time = XCB_TIME_CURRENT_TIME;
|
||||
xcb_window_t m_rootWindow = XCB_WINDOW_NONE;
|
||||
|
|
|
@ -21,6 +21,7 @@ target_link_libraries( testTabBoxClientModel
|
|||
Qt5::Quick
|
||||
Qt5::Test
|
||||
Qt5::X11Extras
|
||||
KF5::ConfigCore
|
||||
KF5::I18n
|
||||
KF5::Package
|
||||
KF5::WindowSystem
|
||||
|
@ -50,6 +51,7 @@ target_link_libraries( testTabBoxHandler
|
|||
Qt5::Quick
|
||||
Qt5::Test
|
||||
Qt5::X11Extras
|
||||
KF5::ConfigCore
|
||||
KF5::I18n
|
||||
KF5::Package
|
||||
KF5::WindowSystem
|
||||
|
|
|
@ -7,7 +7,7 @@ endif()
|
|||
# next target
|
||||
set(screenedgeshowtest_SRCS screenedgeshowtest.cpp)
|
||||
add_executable(screenedgeshowtest ${screenedgeshowtest_SRCS})
|
||||
target_link_libraries(screenedgeshowtest Qt5::Widgets Qt5::X11Extras KF5::WindowSystem ${XCB_XCB_LIBRARY})
|
||||
target_link_libraries(screenedgeshowtest Qt5::Widgets Qt5::X11Extras KF5::ConfigCore KF5::WindowSystem ${XCB_XCB_LIBRARY})
|
||||
|
||||
if (KF5Wayland_FOUND)
|
||||
add_definitions(-DSOURCE_DIR="${KWIN_SOURCE_DIR}")
|
||||
|
|
Loading…
Reference in New Issue