mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-26 23:21:37 +03:00
fix #85, removing Dock crashes Latte
This commit is contained in:
parent
05163c2911
commit
72bd7a0af8
@ -41,6 +41,7 @@ target_link_libraries(
|
||||
Qt5::Qml
|
||||
Qt5::X11Extras
|
||||
KF5::I18n
|
||||
KF5::Declarative
|
||||
KF5::CoreAddons
|
||||
KF5::XmlGui
|
||||
KF5::Plasma
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <QScreen>
|
||||
|
||||
#include <KLocalizedContext>
|
||||
#include <KDeclarative/KDeclarative>
|
||||
#include <KWindowSystem>
|
||||
#include <KWindowEffects>
|
||||
|
||||
@ -76,7 +77,10 @@ void DockConfigView::init()
|
||||
setColor(Qt::transparent);
|
||||
rootContext()->setContextProperty(QStringLiteral("dock"), m_dockView);
|
||||
rootContext()->setContextProperty(QStringLiteral("dockConfig"), this);
|
||||
rootContext()->setContextObject(new KLocalizedContext(this));
|
||||
KDeclarative::KDeclarative kdeclarative;
|
||||
kdeclarative.setDeclarativeEngine(engine());
|
||||
kdeclarative.setTranslationDomain(QStringLiteral("latte-dock"));
|
||||
kdeclarative.setupBindings();
|
||||
auto source = QUrl::fromLocalFile(m_dockView->containment()->corona()->kPackage().filePath("lattedockconfigurationui"));
|
||||
setSource(source);
|
||||
syncSlideEffect();
|
||||
|
@ -83,9 +83,8 @@ DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen)
|
||||
}, Qt::DirectConnection);
|
||||
auto *dockCorona = qobject_cast<DockCorona *>(this->corona());
|
||||
|
||||
if (dockCorona) {
|
||||
if (dockCorona)
|
||||
connect(dockCorona, &DockCorona::docksCountChanged, this, &DockView::docksCountChanged);
|
||||
}
|
||||
}
|
||||
|
||||
DockView::~DockView()
|
||||
@ -115,7 +114,6 @@ void DockView::init()
|
||||
updateFormFactor();
|
||||
syncGeometry();
|
||||
});
|
||||
engine()->rootContext()->setContextObject(new KLocalizedContext(this));
|
||||
rootContext()->setContextProperty(QStringLiteral("dock"), this);
|
||||
setSource(corona()->kPackage().filePath("lattedockui"));
|
||||
setVisible(true);
|
||||
|
@ -45,9 +45,9 @@ int main(int argc, char **argv)
|
||||
{
|
||||
QQuickWindow::setDefaultAlphaBuffer(true);
|
||||
QApplication app(argc, argv);
|
||||
KLocalizedString::setApplicationDomain("latte-dock");
|
||||
app.setApplicationVersion(version);
|
||||
app.setOrganizationDomain(QStringLiteral("latte-dock"));
|
||||
KLocalizedString::setApplicationDomain("latte-dock");
|
||||
app.setApplicationName(QStringLiteral("lattedock"));
|
||||
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("latte-dock")));
|
||||
//! set pattern for debug messages
|
||||
|
Loading…
Reference in New Issue
Block a user