Branch 'kolab/integration/4.13.0' - 3 commits - akonadi/contact akonadi/tagmodel.h akonadi/tagmodel_p.cpp akonadi/tagwidget.cpp akonadi/tagwidget.h
Christian Mollekopf
mollekopf at kolabsys.com
Mon Jan 12 18:46:59 CET 2015
akonadi/contact/contactgroupexpandjob.cpp | 2 +-
akonadi/contact/contactgroupexpandjob.h | 1 +
akonadi/tagmodel.h | 3 +++
akonadi/tagmodel_p.cpp | 4 ++++
akonadi/tagwidget.cpp | 6 ++++--
akonadi/tagwidget.h | 2 --
6 files changed, 13 insertions(+), 5 deletions(-)
New commits:
commit 1af6714811abc31fb2ecd202d074c279e1b36f2b
Author: Sandro Knauà <knauss at kolabsys.com>
Date: Mon Jan 12 14:29:19 2015 +0100
Make contactgroupexpandjob async.
Normally all Jobs should be async if you use them with start.
KOLAB: #4212
diff --git a/akonadi/contact/contactgroupexpandjob.cpp b/akonadi/contact/contactgroupexpandjob.cpp
index 6f2da31..2ef2603 100644
--- a/akonadi/contact/contactgroupexpandjob.cpp
+++ b/akonadi/contact/contactgroupexpandjob.cpp
@@ -155,7 +155,7 @@ void ContactGroupExpandJob::start()
searchJob->setLimit( 1 );
connect( searchJob, SIGNAL(result(KJob*)), this, SLOT(searchResult(KJob*)) );
} else {
- d->resolveGroup();
+ QMetaObject::invokeMethod(this, "resolveGroup", Qt::QueuedConnection);
}
}
diff --git a/akonadi/contact/contactgroupexpandjob.h b/akonadi/contact/contactgroupexpandjob.h
index 4891415..1ee90ac 100644
--- a/akonadi/contact/contactgroupexpandjob.h
+++ b/akonadi/contact/contactgroupexpandjob.h
@@ -104,6 +104,7 @@ class AKONADI_CONTACT_EXPORT ContactGroupExpandJob : public KJob
class Private;
Private* const d;
+ Q_PRIVATE_SLOT( d, void resolveGroup() )
Q_PRIVATE_SLOT( d, void fetchResult( KJob* ) )
Q_PRIVATE_SLOT( d, void searchResult( KJob* ) )
//@endcond
commit c066b76154f6c89018fde7be0f93ec08a255250c
Author: Sandro Knauà <knauss at kolabsys.com>
Date: Mon Jan 12 14:45:54 2015 +0100
tagmodel reflect when it is populated
A execution of ItemFetchJob can take some time, so the model should
reflect, when it is usable aka populated. So the TagWidget for example can update
it's view, when all tags are fetched.
Till now the FetchJob was fast enough, that I didn't saw the problem in
uncompleted tag lists, but I can imagine it could be a problem with a
big pile of tags.
diff --git a/akonadi/tagmodel.h b/akonadi/tagmodel.h
index 74f1d31..0e200a7 100644
--- a/akonadi/tagmodel.h
+++ b/akonadi/tagmodel.h
@@ -74,6 +74,9 @@ protected:
TagModel(Monitor *recorder, TagModelPrivate *dd, QObject *parent = 0);
+Q_SIGNALS:
+ void populated();
+
private:
virtual bool insertRows(int, int, const QModelIndex& = QModelIndex());
virtual bool insertColumns(int, int, const QModelIndex& = QModelIndex());
diff --git a/akonadi/tagmodel_p.cpp b/akonadi/tagmodel_p.cpp
index 0f50f0f..9f33a3b 100644
--- a/akonadi/tagmodel_p.cpp
+++ b/akonadi/tagmodel_p.cpp
@@ -210,6 +210,8 @@ void TagModelPrivate::tagsFetched(const Tag::List &tags)
void TagModelPrivate::tagsFetchDone(KJob *job)
{
+ Q_Q(TagModel);
+
if (job->error()) {
kWarning() << job->errorString();
return;
@@ -219,4 +221,6 @@ void TagModelPrivate::tagsFetchDone(KJob *job)
kWarning() << "Fetched all tags from server, but there are still" << mPendingTags.count() << "orphan tags";
return;
}
+
+ emit q->populated();
}
diff --git a/akonadi/tagwidget.cpp b/akonadi/tagwidget.cpp
index 8735767..f234700 100644
--- a/akonadi/tagwidget.cpp
+++ b/akonadi/tagwidget.cpp
@@ -62,6 +62,7 @@ TagWidget::TagWidget(QWidget *parent)
layout->setStretch(0, 10);
connect(editButton, SIGNAL(clicked()), SLOT(editTags()));
+ connect(d->mModel, SIGNAL(populated()), SLOT(updateView()));
}
TagWidget::~TagWidget()
diff --git a/akonadi/tagwidget.h b/akonadi/tagwidget.h
index e7f4003..fc3b75f 100644
--- a/akonadi/tagwidget.h
+++ b/akonadi/tagwidget.h
@@ -51,8 +51,6 @@ Q_SIGNALS:
private Q_SLOTS:
void editTags();
-
-private:
void updateView();
private:
commit b1e86b23b63fec058e42a706fa35c13ebe23635b
Author: Sandro Knauà <knauss at kolabsys.com>
Date: Mon Jan 12 14:38:54 2015 +0100
Event editor tags in categories field empty
KSqueezedTextLabel has a problem when it comes to resizing. everytime
the window was resized, the text was cleared out. That's why it is empty
at startup, too. Cause at this point the end size isn't set. As a
workaround, we now use a simple QLabel.
QLabel has the disatvantage, that it resizes to its content, so the
widget grows if the content grows. And so the window. With wordwrap=true
multiple lines are allowed, that fits a little bit better, but all in
all this is not a good solution.
The proper solution is to fix KSqueezedTextLabel.
KOLAB: 4177
diff --git a/akonadi/tagwidget.cpp b/akonadi/tagwidget.cpp
index 0a3d31b..8735767 100644
--- a/akonadi/tagwidget.cpp
+++ b/akonadi/tagwidget.cpp
@@ -28,9 +28,9 @@
#include <kicon.h>
#include <klocalizedstring.h>
-#include <ksqueezedtextlabel.h>
#include <QHBoxLayout>
+#include <QLabel>
#include <QToolButton>
using namespace Akonadi;
@@ -50,7 +50,8 @@ TagWidget::TagWidget(QWidget *parent)
d->mModel = new Akonadi::TagModel(monitor, this);
QHBoxLayout *layout = new QHBoxLayout(this);
- d->mTagLabel = new KSqueezedTextLabel;
+ d->mTagLabel = new QLabel;
+ d->mTagLabel->setWordWrap(true);
d->mTagLabel->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
layout->addWidget(d->mTagLabel);
More information about the commits
mailing list