Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions frame/containment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ DApplet *DContainment::createApplet(const DAppletData &data)
QObject::connect(applet, &DApplet::rootObjectChanged, this, [this, applet]() {
if (auto object = applet->rootObject()) {
D_D(DContainment);
d->m_model->append(object);
d->model()->append(object);
QObject::connect(object, &QObject::destroyed, this, [this, object]() {
D_D(DContainment);
d->m_model->remove(object);
d->model()->remove(object);
});
}
});
Expand All @@ -70,7 +70,7 @@ void DContainment::removeApplet(DApplet *applet)
d->m_applets.removeOne(applet);
}
if (auto view = applet->rootObject()) {
d->m_model->remove(view);
d->model()->remove(view);
}
applet->deleteLater();
}
Expand All @@ -85,14 +85,14 @@ QList<QObject *> DContainment::appletItems()
{
D_D(DContainment);

return d->m_model->rootObjects();
return d->model()->rootObjects();
}

DAppletItemModel *DContainment::appletItemModel() const
{
D_DC(DContainment);

return d->m_model;
return d->model();
}

DApplet *DContainment::applet(const QString &id) const
Expand Down
9 changes: 7 additions & 2 deletions frame/private/containment_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ class DContainmentPrivate : public DAppletPrivate
public:
explicit DContainmentPrivate(DContainment *qq)
: DAppletPrivate(qq)
, m_model(new DAppletItemModel())
{

}
DAppletItemModel *model() const
{
if (!m_model) {
const_cast<DContainmentPrivate *>(this)->m_model = new DAppletItemModel(const_cast<DContainment *>(q_func()));
}
return m_model;
}
QList<DAppletData> groupList(const DAppletData &data) const;
QList<DApplet *> m_applets;
Expand Down
1 change: 1 addition & 0 deletions frame/qmlengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class DQmlEnginePrivate : public DObjectPrivate
static QQmlEngine *s_engine = nullptr;
if (!s_engine) {
s_engine = new QQmlEngine();
QObject::connect(s_engine, &QQmlEngine::quit, qApp, &QCoreApplication::quit);
auto paths = s_engine->importPathList();
// high priority for builtin plugin.
paths.prepend(DDE_SHELL_QML_INSTALL_DIR);
Expand Down
3 changes: 3 additions & 0 deletions panels/notification/common/dataaccessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ namespace notification {
class DataAccessor
{
public:
virtual ~DataAccessor()
{
}
virtual qint64 addEntity(const NotifyEntity &entity) { Q_UNUSED(entity); return 0; }

virtual void updateEntityProcessedType(qint64 id, int processedType) { Q_UNUSED(id); Q_UNUSED(processedType); }
Expand Down
7 changes: 7 additions & 0 deletions panels/notification/common/dbaccessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ DBAccessor::DBAccessor(const QString &key)
}
}

DBAccessor::~DBAccessor()
{
if (m_connection.isOpen()) {
m_connection.close();
}
}

DBAccessor *DBAccessor::instance()
{
static DBAccessor *instance = nullptr;
Expand Down
1 change: 1 addition & 0 deletions panels/notification/common/dbaccessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class DBAccessor : public DataAccessor
{
public:
explicit DBAccessor(const QString &key);
~DBAccessor() override;

static DBAccessor *instance();

Expand Down
2 changes: 1 addition & 1 deletion panels/notification/common/notifyentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ NotifyEntity::NotifyEntity()
}

NotifyEntity::NotifyEntity(qint64 id, const QString &appName)
: d(new NotifyData())
: NotifyEntity()
{
d->id = id;
d->appName = appName;
Expand Down
4 changes: 4 additions & 0 deletions panels/notification/server/notificationmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ NotificationManager::NotificationManager(QObject *parent)

NotificationManager::~NotificationManager()
{
if (m_persistence) {
delete m_persistence;
m_persistence = nullptr;
}
}

bool NotificationManager::registerDbusService()
Expand Down
Loading