Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Unmaintained
KDE Pim
Commits
a95a1b30
Commit
a95a1b30
authored
Oct 16, 2013
by
Laurent Montel
😁
Browse files
Fix Bug 178077 - notes are not updated in kontact overview
FIXED-IN: 4.12 BUG: 178077
parent
53df4f4c
Changes
6
Hide whitespace changes
Inline
Side-by-side
kontact/plugins/knotes/knotes_part.cpp
View file @
a95a1b30
...
...
@@ -45,12 +45,12 @@ using namespace KCal;
#include <QMenu>
KNotesPart
::
KNotesPart
(
QObject
*
parent
)
KNotesPart
::
KNotesPart
(
KNotesResourceManager
*
manager
,
QObject
*
parent
)
:
KParts
::
ReadOnlyPart
(
parent
),
mNotesWidget
(
new
KNotesWidget
(
this
)
),
mNoteTip
(
new
KNoteTip
(
mNotesWidget
->
notesView
()
)
),
mNoteEditDlg
(
0
),
mManager
(
new
KNotesResourceM
anager
()
)
mManager
(
m
anager
)
{
(
void
)
new
KNotesAdaptor
(
this
);
QDBusConnection
::
sessionBus
().
registerObject
(
QLatin1String
(
"/KNotes"
),
this
);
...
...
@@ -146,8 +146,6 @@ KNotesPart::KNotesPart( QObject *parent )
this
,
SLOT
(
createNote
(
KCal
::
Journal
*
))
);
connect
(
mManager
,
SIGNAL
(
sigDeregisteredNote
(
KCal
::
Journal
*
)),
this
,
SLOT
(
killNote
(
KCal
::
Journal
*
))
);
// read the notes
mManager
->
load
();
}
...
...
@@ -155,9 +153,6 @@ KNotesPart::~KNotesPart()
{
delete
mNoteTip
;
mNoteTip
=
0
;
delete
mManager
;
mManager
=
0
;
}
void
KNotesPart
::
requestToolTip
(
const
QModelIndex
&
index
)
...
...
kontact/plugins/knotes/knotes_part.h
View file @
a95a1b30
...
...
@@ -43,7 +43,7 @@ class KNotesPart : public KParts::ReadOnlyPart
Q_OBJECT
public:
explicit
KNotesPart
(
QObject
*
parent
=
0
);
explicit
KNotesPart
(
KNotesResourceManager
*
manager
,
QObject
*
parent
=
0
);
~
KNotesPart
();
bool
openFile
();
...
...
kontact/plugins/knotes/knotes_plugin.cpp
View file @
a95a1b30
...
...
@@ -20,6 +20,7 @@
#include "knotes_plugin.h"
#include "knotes_part.h"
#include "knotes/resource/resourcemanager.h"
#include "summarywidget.h"
#include "kdepim-version.h"
...
...
@@ -51,6 +52,7 @@ EXPORT_KONTACT_PLUGIN( KNotesPlugin, knotes )
KNotesPlugin
::
KNotesPlugin
(
KontactInterface
::
Core
*
core
,
const
QVariantList
&
)
:
KontactInterface
::
Plugin
(
core
,
core
,
"knotes"
),
mAboutData
(
0
)
{
mManager
=
new
KNotesResourceManager
();
setComponentData
(
KontactPluginFactory
::
componentData
()
);
KAction
*
action
=
...
...
@@ -81,6 +83,7 @@ KNotesPlugin::KNotesPlugin( KontactInterface::Core *core, const QVariantList & )
KNotesPlugin
::~
KNotesPlugin
()
{
delete
mManager
;
}
QString
KNotesPlugin
::
tipFile
()
const
...
...
@@ -93,12 +96,12 @@ QString KNotesPlugin::tipFile() const
KParts
::
ReadOnlyPart
*
KNotesPlugin
::
createPart
()
{
return
new
KNotesPart
(
this
);
return
new
KNotesPart
(
mManager
,
this
);
}
KontactInterface
::
Summary
*
KNotesPlugin
::
createSummaryWidget
(
QWidget
*
parentWidget
)
{
return
new
KNotesSummaryWidget
(
this
,
parentWidget
);
return
new
KNotesSummaryWidget
(
mManager
,
this
,
parentWidget
);
}
const
KAboutData
*
KNotesPlugin
::
aboutData
()
const
...
...
kontact/plugins/knotes/knotes_plugin.h
View file @
a95a1b30
...
...
@@ -24,7 +24,7 @@
#define KNOTES_PLUGIN_H
#include <KontactInterface/Plugin>
class
KNotesResourceManager
;
class
KNotesPlugin
:
public
KontactInterface
::
Plugin
{
Q_OBJECT
...
...
@@ -51,6 +51,7 @@ class KNotesPlugin : public KontactInterface::Plugin
private:
mutable
KAboutData
*
mAboutData
;
KNotesResourceManager
*
mManager
;
};
#endif
kontact/plugins/knotes/summarywidget.cpp
View file @
a95a1b30
...
...
@@ -23,6 +23,7 @@
*/
#include "summarywidget.h"
#include "knotes_plugin.h"
#include "knotes/resource/resourcemanager.h"
#include <KCal/CalendarLocal>
...
...
@@ -39,8 +40,10 @@
#include <QLabel>
#include <QVBoxLayout>
KNotesSummaryWidget
::
KNotesSummaryWidget
(
KontactInterface
::
Plugin
*
plugin
,
QWidget
*
parent
)
:
KontactInterface
::
Summary
(
parent
),
mLayout
(
0
),
mPlugin
(
plugin
)
KNotesSummaryWidget
::
KNotesSummaryWidget
(
KNotesResourceManager
*
manager
,
KNotesPlugin
*
plugin
,
QWidget
*
parent
)
:
KontactInterface
::
Summary
(
parent
),
mLayout
(
0
),
mPlugin
(
plugin
)
{
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
(
this
);
mainLayout
->
setSpacing
(
3
);
...
...
@@ -55,20 +58,15 @@ KNotesSummaryWidget::KNotesSummaryWidget( KontactInterface::Plugin *plugin, QWid
mLayout
->
setRowStretch
(
6
,
1
);
mCalendar
=
new
CalendarLocal
(
QString
::
fromLatin1
(
"UTC"
)
);
mManager
=
new
KNotesResourceManager
();
QObject
::
connect
(
m
M
anager
,
SIGNAL
(
sigRegisteredNote
(
KCal
::
Journal
*
)),
QObject
::
connect
(
manager
,
SIGNAL
(
sigRegisteredNote
(
KCal
::
Journal
*
)),
this
,
SLOT
(
addNote
(
KCal
::
Journal
*
))
);
QObject
::
connect
(
m
M
anager
,
SIGNAL
(
sigDeregisteredNote
(
KCal
::
Journal
*
)),
QObject
::
connect
(
manager
,
SIGNAL
(
sigDeregisteredNote
(
KCal
::
Journal
*
)),
this
,
SLOT
(
removeNote
(
KCal
::
Journal
*
))
);
mManager
->
load
();
updateView
();
}
KNotesSummaryWidget
::~
KNotesSummaryWidget
()
{
delete
mManager
;
}
void
KNotesSummaryWidget
::
updateView
()
...
...
kontact/plugins/knotes/summarywidget.h
View file @
a95a1b30
...
...
@@ -33,10 +33,7 @@ namespace KCal {
}
using
namespace
KCal
;
namespace
KontactInterface
{
class
Plugin
;
}
class
KNotesPlugin
;
class
KNotesResourceManager
;
class
QGridLayout
;
class
QLabel
;
...
...
@@ -45,7 +42,7 @@ class KNotesSummaryWidget : public KontactInterface::Summary
{
Q_OBJECT
public:
KNotesSummaryWidget
(
KontactInterface
::
Plugin
*
plugin
,
QWidget
*
parent
);
KNotesSummaryWidget
(
KNotesResourceManager
*
manager
,
KNotes
Plugin
*
plugin
,
QWidget
*
parent
);
~
KNotesSummaryWidget
();
void
updateSummary
(
bool
force
=
false
)
...
...
@@ -70,7 +67,7 @@ class KNotesSummaryWidget : public KontactInterface::Summary
QGridLayout
*
mLayout
;
QList
<
QLabel
*>
mLabels
;
K
ontactInterface
::
Plugin
*
mPlugin
;
K
Notes
Plugin
*
mPlugin
;
KNotesResourceManager
*
mManager
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment