Hello community,
here is the log from the commit of package fate for openSUSE:Factory checked in at 2017-06-24 08:34:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fate (Old)
and /work/SRC/openSUSE:Factory/.fate.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fate"
Sat Jun 24 08:34:43 2017 rev:7 rq:505866 version:1.6.0.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/fate/fate.changes 2017-06-09 15:57:32.894476419 +0200
+++ /work/SRC/openSUSE:Factory/.fate.new/fate.changes 2017-06-24 08:34:58.731938395 +0200
@@ -1,0 +2,6 @@
+Fri Jun 23 11:03:19 UTC 2017 - jplack@suse.com
+
+- bugfix release 1.6.0.1
+ * bsc#1044954 FATE crashes on selected feature in query (TumbleWeed only)
+
+-------------------------------------------------------------------
Old:
----
fate-20170608-ebd3ef1b.tar.bz2
New:
----
fate-20170623-c1270a95.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ fate.spec ++++++
--- /var/tmp/diff_new_pack.QXazOn/_old 2017-06-24 08:34:59.235867138 +0200
+++ /var/tmp/diff_new_pack.QXazOn/_new 2017-06-24 08:34:59.239866572 +0200
@@ -17,8 +17,8 @@
%define baseversion 1.6
-%define patchlevel .0
-%define snapshot 20170608-ebd3ef1b
+%define patchlevel .0.1
+%define snapshot 20170623-c1270a95
Name: fate
Version: %{baseversion}%{patchlevel}
Release: 0
++++++ fate-20170608-ebd3ef1b.tar.bz2 -> fate-20170623-c1270a95.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/fate/editor/actoreditor.cpp new/fate-20170623-c1270a95/src/fate/editor/actoreditor.cpp
--- old/fate-20170608-ebd3ef1b/src/fate/editor/actoreditor.cpp 2017-06-08 14:56:14.815453970 +0200
+++ new/fate-20170623-c1270a95/src/fate/editor/actoreditor.cpp 2017-06-23 13:02:00.417130362 +0200
@@ -189,21 +189,18 @@
}
void
-ActorEditor::setRoleAndPerson(const QString &userid, const QString& email, const QString &fullname, const QString& role)
+ActorEditor::setActor(const FeatureData::Actor &actor)
{
- editUsername->setText(userid);
- editEmail->setText(email);
- editFullname->setText(fullname);
- slotEmailChanged(email);
- cmbRole->setCurrentRole(role);
+ if (actor.isPersonValid())
+ buttonGroup2->setTitle(tr2i18n("Edit Actor", 0));
- slotEnableOkButton();
-}
+ editUsername->setText(actor.userid);
+ editEmail->setText(actor.email);
+ editFullname->setText(actor.fullName);
+ slotEmailChanged(actor.email);
+ cmbRole->setCurrentRole(actor.roleId);
-void
-ActorEditor::setActor(const FeatureData::Actor &actor)
-{
- setRoleAndPerson(actor.userid, actor.email, actor.fullName, actor.roleId);
+ slotEnableOkButton();
}
void
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/fate/editor/actoreditor.h new/fate-20170623-c1270a95/src/fate/editor/actoreditor.h
--- old/fate-20170608-ebd3ef1b/src/fate/editor/actoreditor.h 2017-06-08 14:56:14.815453970 +0200
+++ new/fate-20170623-c1270a95/src/fate/editor/actoreditor.h 2017-06-23 13:02:00.417130362 +0200
@@ -45,7 +45,6 @@
QString email() const;
QString username() const;
QString fullname() const;
- void setRoleAndPerson(const QString &userid, const QString &email, const QString &fullname, const QString &role);
void clear();
bool isValidEmail(const QString& mail);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/fate/editor/actoreditordialogbase.ui new/fate-20170623-c1270a95/src/fate/editor/actoreditordialogbase.ui
--- old/fate-20170608-ebd3ef1b/src/fate/editor/actoreditordialogbase.ui 2017-06-08 14:56:14.815453970 +0200
+++ new/fate-20170623-c1270a95/src/fate/editor/actoreditordialogbase.ui 2017-06-23 13:02:00.417130362 +0200
@@ -17,7 +17,7 @@
<item row="0" column="0">
<widget class="QGroupBox" name="buttonGroup2">
<property name="title">
- <string>Edit Actor</string>
+ <string>Add Actor</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/fate/editor/actorlistedit.cpp new/fate-20170623-c1270a95/src/fate/editor/actorlistedit.cpp
--- old/fate-20170608-ebd3ef1b/src/fate/editor/actorlistedit.cpp 2017-06-08 14:56:14.815453970 +0200
+++ new/fate-20170623-c1270a95/src/fate/editor/actorlistedit.cpp 2017-06-23 13:02:00.417130362 +0200
@@ -231,7 +231,7 @@
FeatureData::Actor::List *actors = actorItem->actors();
FeatureData::Actor &actor = actors->first(); // here edit always the first in the list
- dlg.setRoleAndPerson(actor.userid, actor.email, actor.fullName, actor.roleId);
+ dlg.setActor(actor);
if (dlg.exec() != QDialog::Accepted)
return;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/fate/editor/featureview.cpp new/fate-20170623-c1270a95/src/fate/editor/featureview.cpp
--- old/fate-20170608-ebd3ef1b/src/fate/editor/featureview.cpp 2017-06-08 14:56:14.819453990 +0200
+++ new/fate-20170623-c1270a95/src/fate/editor/featureview.cpp 2017-06-23 13:02:00.417130362 +0200
@@ -516,17 +516,6 @@
}
}
-// TODO: this should go completely to MainView
-void FeatureView::importFeature( Feature *feature )
-{
- if (!mSimpleEditor)
- return;
-
- setFeature(feature);
- mFeatureMap->addFeature(feature);
- focusEditor();
-}
-
void FeatureView::slotCommentRequest( int inReplyTo )
{
if( mCommentDialog ) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/fate/editor/featureview.h new/fate-20170623-c1270a95/src/fate/editor/featureview.h
--- old/fate-20170608-ebd3ef1b/src/fate/editor/featureview.h 2017-06-08 14:56:14.819453990 +0200
+++ new/fate-20170623-c1270a95/src/fate/editor/featureview.h 2017-06-23 13:02:00.417130362 +0200
@@ -64,6 +64,7 @@
bool isCommentInProgress() const { return mCommentDialog; }
Feature* currentFeature();
void setReadOnly( bool readOnly );
+ void focusEditor();
protected:
bool switchToTab(QWidget *);
@@ -82,7 +83,6 @@
void editProductList();
void startECO();
void cancelECO();
- void importFeature( Feature * );
void printFeature();
void saveCurrentFeature();
void saveAllFeatures();
@@ -92,13 +92,11 @@
// display part to actively select a feature:
// it shows only _one_ feature!
void featureSelected( Feature * );
- void featureModified( Feature * );
void featureTitleChanged( Feature *, const QString & );
void showTreeRequest( const QString & );
protected:
void saveComments();
- void focusEditor();
QWidget *featureDisplay(QWidget *parent);
QWidget *commentsView(QWidget *parent);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/fate/mainview.cpp new/fate-20170623-c1270a95/src/fate/mainview.cpp
--- old/fate-20170608-ebd3ef1b/src/fate/mainview.cpp 2017-06-08 14:56:14.819453990 +0200
+++ new/fate-20170623-c1270a95/src/fate/mainview.cpp 2017-06-23 13:02:00.421130381 +0200
@@ -201,7 +201,9 @@
mFeatureListView, SLOT( updateFeature( Feature * ) ) );
connect( &mFeatureMap, SIGNAL( dataChanged() ),
SLOT( slotFeatureDataChanged() ) );
- connect( &mFeatureMap, SIGNAL( featureReloaded( Feature * ) ),
+
+ // Thinks we do not need that in the end ...
+ connect( &mFeatureMap, SIGNAL( featureChanged( Feature * ) ),
SLOT( slotFeatureReloaded( Feature * ) ) );
connect( &mFeatureMap, SIGNAL( connectionEstablished( bool ) ),
SIGNAL( connectionEstablished( bool ) ) );
@@ -209,13 +211,6 @@
// way to change the displayed feature for it
connect( &mFeatureMap, SIGNAL( currentFeatureChanged( Feature * ) ),
mFeatureView, SLOT( setFeature( Feature * ) ) );
- // TODO: clarify: can this ever happen? what does that signal mean?
- connect( &mFeatureMap, SIGNAL( currentFeatureRemoved() ),
- mFeatureView, SLOT( clear() ) );
-
- connect( mFeatureView, SIGNAL( featureModified( Feature * ) ),
- mFeatureListView, SLOT( updateFeature( Feature * ) ) );
-
connect( mFeatureListView, SIGNAL( featureSelected( Feature * ) ),
SLOT( showFeature( Feature * ) ) );
/*
@@ -439,7 +434,7 @@
StartupSequence::self()->setPrecondition( StartupSequence::StartupQueryDone,
true );
- } else if( mFeatureMap.hasModifiedFeatures() ) {
+ } else if( mFeatureMap.hasCachedModifiedFeatures() ) {
mFeatureMap.loadModifiedFeatures();
StartupSequence::self()->setPrecondition( StartupSequence::StartupQueryDone,
true );
@@ -1057,8 +1052,11 @@
if( dlg->exec() == QDialog::Accepted ) {
Feature *f = dlg->feature();
f->setModified(true);
- mFeatureView->importFeature( f );
- mFeatureListView->selectFeature( f );
+
+ mFeatureMap.addFeature(f);
+ mFeatureMap.setCurrentFeature(f);
+ mFeatureView->setFeature(f);
+ mFeatureView->focusEditor();
}
}
@@ -1074,7 +1072,7 @@
FeatureParser parser;
connect( &parser, SIGNAL(featureParsed( Feature * )),
- mFeatureView, SLOT(importFeature( Feature * )) );
+ &mFeatureMap, SLOT(addFeature( Feature * )) );
clonedFeature = new Feature;
clonedFeature->setModified(true);
@@ -1152,7 +1150,7 @@
FeatureParser parser;
connect( &parser, SIGNAL(featureParsed( Feature * )),
- mFeatureView, SLOT(importFeature( Feature * )) );
+ mFeatureView, SLOT(addFeature( Feature * )) );
KResult result = parser.parse( xml );
if ( !result ) KMessageBox::sorry( this, result.fullMessage() );
@@ -1162,8 +1160,8 @@
{
ImportBugzillaDialog dlg( ProductMap::self(), this );
- connect( &dlg, SIGNAL( featureParsed( Feature * ) ), mFeatureView,
- SLOT( importFeature( Feature * ) ) );
+ connect( &dlg, SIGNAL( featureParsed( Feature * ) ),
+ &mFeatureMap, SLOT( addFeature( Feature * ) ) );
dlg.exec();
}
@@ -1199,7 +1197,6 @@
void MainView::slotFeatureReloaded( Feature * f )
{
- f->setModified( false );
Feature *currentFeature = mFeatureView->currentFeature();
if ( !currentFeature || currentFeature->id() == f->id() ) {
showFeature( f );
@@ -1888,7 +1885,8 @@
}
if ( !f ) {
- f = mFeatureMap.firstFeature();
+ // return the first or NULL if empty
+ f = mFeatureMap.features().value(0, NULL);
if ( f ) kDebug() << k_funcinfo << "Showing first feature: " << f->id();
else kDebug() << k_funcinfo << "Unable to find first feature.";
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/fate/qxtcheckcombobox.cpp new/fate-20170623-c1270a95/src/fate/qxtcheckcombobox.cpp
--- old/fate-20170608-ebd3ef1b/src/fate/qxtcheckcombobox.cpp 2017-06-08 14:56:14.823454009 +0200
+++ new/fate-20170623-c1270a95/src/fate/qxtcheckcombobox.cpp 2017-06-23 13:02:00.421130381 +0200
@@ -54,6 +54,7 @@
if (keyEvent->key() != Qt::Key_Escape)
return true;
}
+ break;
}
case QEvent::MouseButtonPress:
containerMousePress = (receiver == qxt_p().view()->window());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/fate/relationtreeitem.cpp new/fate-20170623-c1270a95/src/fate/relationtreeitem.cpp
--- old/fate-20170608-ebd3ef1b/src/fate/relationtreeitem.cpp 2017-06-08 14:56:14.823454009 +0200
+++ new/fate-20170623-c1270a95/src/fate/relationtreeitem.cpp 2017-06-23 13:02:00.421130381 +0200
@@ -25,23 +25,18 @@
#include
#include
-SharedRelation::SharedRelation(const Relation &r, Feature *f, bool isDummy)
+SharedTreeRelation::SharedTreeRelation(const Relation &r, Feature *f, bool isDummy)
: Relation(r), mFeature(f), mDummyFeature(f == 0 || isDummy)
{
}
-SharedRelation::SharedRelation(Feature *f, bool isDummy)
-: mFeature(f), mDummyFeature(f == 0 || isDummy)
-{
-}
-
-SharedRelation::~SharedRelation()
+SharedTreeRelation::~SharedTreeRelation()
{
updateFeature(0);
}
void
-SharedRelation::updateFeature(Feature *f)
+SharedTreeRelation::updateFeature(Feature *f)
{
if (mDummyFeature && mFeature)
delete mFeature;
@@ -50,7 +45,7 @@
}
QString
-SharedRelation::property(Property id) const
+SharedTreeRelation::property(Property id) const
{
switch (id) {
case FeatureId:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/fate/relationtreeitem.h new/fate-20170623-c1270a95/src/fate/relationtreeitem.h
--- old/fate-20170608-ebd3ef1b/src/fate/relationtreeitem.h 2017-06-08 14:56:14.823454009 +0200
+++ new/fate-20170623-c1270a95/src/fate/relationtreeitem.h 2017-06-23 13:02:00.421130381 +0200
@@ -33,18 +33,17 @@
// The relation can hold a pointer to the feature it is attached
// to.
//////////////////////////////////////////////////////////////////
-class SharedRelation : public Relation, public QSharedData {
+class SharedTreeRelation : public Relation, public QSharedData {
public:
enum Property {
FeatureId,
FeatureTitle,
};
- typedef QExplicitlySharedDataPointer<SharedRelation> Pointer;
+ typedef QExplicitlySharedDataPointer<SharedTreeRelation> Pointer;
- SharedRelation(const Relation &, Feature *f = 0, bool isDummy = false);
- SharedRelation(Feature *f = 0, bool isDummy = false);
- ~SharedRelation();
+ SharedTreeRelation(const Relation &, Feature *f = 0, bool isDummy = false);
+ ~SharedTreeRelation();
Feature *feature() {
return mFeature;
@@ -61,6 +60,6 @@
bool mDummyFeature;
};
-Q_DECLARE_METATYPE(SharedRelation::Pointer);
+Q_DECLARE_METATYPE(SharedTreeRelation::Pointer);
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/fate/relationtreeview.cpp new/fate-20170623-c1270a95/src/fate/relationtreeview.cpp
--- old/fate-20170608-ebd3ef1b/src/fate/relationtreeview.cpp 2017-06-08 14:56:14.823454009 +0200
+++ new/fate-20170623-c1270a95/src/fate/relationtreeview.cpp 2017-06-23 13:02:00.421130381 +0200
@@ -255,7 +255,7 @@
void
RelationTreeView::slotItemClicked(QTreeWidgetItem *item)
{
- SharedRelation *relation;
+ SharedTreeRelation *relation;
if (!item || !(relation = nodeRelation(item)))
return;
@@ -341,21 +341,21 @@
}
void
-RelationTreeView::setNodeRelation(QTreeWidgetItem *item, SharedRelation *relation)
+RelationTreeView::setNodeRelation(QTreeWidgetItem *item, SharedTreeRelation *relation)
{
QVariant data;
- data.setValue(SharedRelation::Pointer(relation));
+ data.setValue(SharedTreeRelation::Pointer(relation));
item->setData(0, Qt::UserRole, data);
}
-SharedRelation *
+SharedTreeRelation *
RelationTreeView::nodeRelation(QTreeWidgetItem *item)
{
QVariant data = item->data(0, Qt::UserRole);
- SharedRelation *relation;
+ SharedTreeRelation *relation;
- SharedRelation::Pointer ex(data.valueSharedRelation::Pointer());
+ SharedTreeRelation::Pointer ex(data.valueSharedTreeRelation::Pointer());
if ((relation = ex.data()) == 0) {
// This tree node was created as the result of a drop operation
Relation r;
@@ -363,7 +363,7 @@
r.setTarget(item->text(0));
r.setDescription(item->text(1));
- relation = createSharedRelation(r, item->parent());
+ relation = createSharedTreeRelation(r, item->parent());
setNodeRelation(item, relation);
}
@@ -371,7 +371,7 @@
}
QTreeWidgetItem *
-RelationTreeView::addNode(QTreeWidgetItem *parent, SharedRelation *relation)
+RelationTreeView::addNode(QTreeWidgetItem *parent, SharedTreeRelation *relation)
{
QTreeWidgetItem *item;
@@ -383,18 +383,18 @@
setNodeRelation(item, relation);
- item->setText(0, relation->property(SharedRelation::FeatureId));
- item->setText(1, relation->property(SharedRelation::FeatureTitle));
+ item->setText(0, relation->property(SharedTreeRelation::FeatureId));
+ item->setText(1, relation->property(SharedTreeRelation::FeatureTitle));
item->setExpanded(true);
return item;
}
-SharedRelation *
-RelationTreeView::createSharedRelation(const Relation &relation, bool isChild)
+SharedTreeRelation *
+RelationTreeView::createSharedTreeRelation(const Relation &relation, bool isChild)
{
- SharedRelation *sharedRelation;
+ SharedTreeRelation *sharedRelation;
Feature *f = 0;
bool dummy = false;
@@ -406,11 +406,11 @@
f->setId(relation.target());
f->setTitle(i18n("Feature not loaded"));
- // make sure feature is destroyed when SharedRelation goes away
+ // make sure feature is destroyed when SharedTreeRelation goes away
dummy = true;
}
- sharedRelation = new SharedRelation(relation, f, dummy);
+ sharedRelation = new SharedTreeRelation(relation, f, dummy);
if (isChild)
sharedRelation->setType("feature/parent");
@@ -422,7 +422,7 @@
{
QTreeWidgetItem *item;
- item = addNode(parent, createSharedRelation(node.relation, parent != 0));
+ item = addNode(parent, createSharedTreeRelation(node.relation, parent != 0));
RelationTree::Node::List::const_iterator it;
for (it = node.children.begin(); it != node.children.end(); ++it)
@@ -514,7 +514,7 @@
for (int i = 0; i < mListView->topLevelItemCount(); ++i) {
QTreeWidgetItem *item = mListView->topLevelItem(i);
- SharedRelation *relation = nodeRelation(item);
+ SharedTreeRelation *relation = nodeRelation(item);
map[relation->target()] = synchNode(item, "feature", sortPosition++);
}
@@ -525,7 +525,7 @@
RelationTree::Node
RelationTreeView::synchNode(QTreeWidgetItem *item, const char *type, int sortPosition)
{
- SharedRelation *relation = nodeRelation(item);
+ SharedTreeRelation *relation = nodeRelation(item);
RelationTree::Node node;
int childPosition = 1;
@@ -571,7 +571,7 @@
isRelated = true;
}
- SharedRelation *relation = nodeRelation(item);
+ SharedTreeRelation *relation = nodeRelation(item);
if (!relation->isDummyFeature()) {
Feature *f = relation->feature();
@@ -622,7 +622,7 @@
void
RelationTreeView::stockNode(QTreeWidgetItem *item, QStringList &missingFeatures)
{
- SharedRelation *relation = nodeRelation(item);
+ SharedTreeRelation *relation = nodeRelation(item);
if (relation->feature() == 0 || relation->isDummyFeature()) {
Feature *f = mFeatureMap->feature(relation->target());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/fate/relationtreeview.h new/fate-20170623-c1270a95/src/fate/relationtreeview.h
--- old/fate-20170608-ebd3ef1b/src/fate/relationtreeview.h 2017-06-08 14:56:14.823454009 +0200
+++ new/fate-20170623-c1270a95/src/fate/relationtreeview.h 2017-06-23 13:02:00.421130381 +0200
@@ -38,7 +38,7 @@
class QLabel;
class FeatureMap;
class ProductMap;
-class SharedRelation;
+class SharedTreeRelation;
class FateComboBox;
class QComboBox;
@@ -101,11 +101,11 @@
void slotProductChosen(const QString &);
protected:
- void setNodeRelation(QTreeWidgetItem *item, SharedRelation *relation);
- SharedRelation *createSharedRelation(const Relation &relation, bool isChild);
- SharedRelation *nodeRelation(QTreeWidgetItem *item);
+ void setNodeRelation(QTreeWidgetItem *item, SharedTreeRelation *relation);
+ SharedTreeRelation *createSharedTreeRelation(const Relation &relation, bool isChild);
+ SharedTreeRelation *nodeRelation(QTreeWidgetItem *item);
void buildNode(QTreeWidgetItem *parent, const RelationTree::Node &node);
- QTreeWidgetItem *addNode(QTreeWidgetItem *parent, SharedRelation *relation);
+ QTreeWidgetItem *addNode(QTreeWidgetItem *parent, SharedTreeRelation *relation);
RelationTree::Node synchNode(QTreeWidgetItem *item, const char *,
int sortPosition);
void stockNode(QTreeWidgetItem *item, QStringList &);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/fate/renderer/xsltrenderer.cpp new/fate-20170623-c1270a95/src/fate/renderer/xsltrenderer.cpp
--- old/fate-20170608-ebd3ef1b/src/fate/renderer/xsltrenderer.cpp 2017-06-08 14:56:14.823454009 +0200
+++ new/fate-20170623-c1270a95/src/fate/renderer/xsltrenderer.cpp 2017-06-23 13:02:00.421130381 +0200
@@ -152,7 +152,7 @@
// replaces the template %id in the display string with the feature id,
// which is used for example in the attachment path so far.
const char* param[251];
- memset( param, 0, 251 );
+ memset( param, 0, 251 * sizeof(char));
RelationType::List relationTypes = RelationType::allRelationTypes();
RelationType::List::ConstIterator it;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/libfate/config/fate.kcfg new/fate-20170623-c1270a95/src/libfate/config/fate.kcfg
--- old/fate-20170608-ebd3ef1b/src/libfate/config/fate.kcfg 2017-06-08 14:56:14.827454029 +0200
+++ new/fate-20170623-c1270a95/src/libfate/config/fate.kcfg 2017-06-23 13:02:00.425130400 +0200
@@ -245,7 +245,7 @@
<group name="Bugzilla">
<entry name="BugzillaBugUrl" type="String">
<label>Url for querying a bug by id</label>
- <default>https://apibugzilla.novell.com/show_bug.cgi?id=%1&ctype=xml</default>
+ <default>https://apibugzilla.suse.com/show_bug.cgi?id=%1&ctype=xml</default>
</entry>
</group>
</kcfg>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/libfate/featuremap.cpp new/fate-20170623-c1270a95/src/libfate/featuremap.cpp
--- old/fate-20170608-ebd3ef1b/src/libfate/featuremap.cpp 2017-06-08 14:56:14.827454029 +0200
+++ new/fate-20170623-c1270a95/src/libfate/featuremap.cpp 2017-06-23 13:02:00.425130400 +0200
@@ -1,9 +1,10 @@
/*
This file is part of Fate.
- Copyright (c) 2005-2007 SUSE LINUX Products GmbH
+ Copyright (c) 2005-2007, 2014 SUSE LINUX Products GmbH
Author: Cornelius Schumacher
+ Joachim Plack
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -43,13 +44,13 @@
#include
+static const QString container = "feature";
+
FeatureMap::FeatureMap()
- : mFirstFeature( 0 ), mCurrentFeature( 0 ), mQueryRunning( false ),
+ : mCurrentFeature( 0 ), mQueryRunning( false ),
mView( 0 ), mLoadCount( 0 ), mCache( 0 ),
mChangeSet( 0 ), mSynch( true ), mRestockSilent( false )
{
- QString container = "feature";
-
if ( Prefs::self()->cachedQuery() ) {
initCache();
}
@@ -97,8 +98,16 @@
FeatureMap::~FeatureMap()
{
clear();
- clearFeatureList();
- clearPersistantFeatures();
+ mFeatures.clear();
+ // clear persistant features();
+ QList::Iterator it;
+ QList list = mIdMap.values();
+
+ for( it = list.begin(); it != list.end(); ++it ) {
+ mRevisionMap.remove( (*it)->id() );
+ delete *it;
+ }
+ mIdMap.clear();
delete mSaveEngine;
delete mQueryEngine;
@@ -128,8 +137,6 @@
void FeatureMap::initCache()
{
- QString container = "feature";
-
if( mCache ) {
delete mCache;
}
@@ -187,11 +194,10 @@
finishQuery();
}
-bool FeatureMap::hasModifiedFeatures()
+bool FeatureMap::hasCachedModifiedFeatures() const
{
if( mCache ) {
- return ( mCache->hasModifiedItems() ||
- mCache->hasNewItems() );
+ return ( mCache->hasModifiedItems() || mCache->hasNewItems() );
}
return false;
@@ -200,45 +206,39 @@
void FeatureMap::clear()
{
mKeptFeatures.clear();
- mFirstFeature = 0;
mCurrentFeature = 0;
mLoadCount = 0;
mCachedIds.clear();
mIds.clear();
mSynch = true;
- mModifiedFeatures.clear();
- emit currentFeatureRemoved();
- emit featuresModified( false );
+ emit currentFeatureChanged(0);
+ emit featuresModified();
}
-void FeatureMap::clearFeatureList()
+void FeatureMap::setCurrentFeature( Feature *f )
{
- mFeatures.clear();
+ if (mCurrentFeature == f)
+ return;
+ mCurrentFeature = f;
+ emit currentFeatureChanged( f );
}
-void FeatureMap::clearPersistantFeatures()
+Feature * FeatureMap::currentFeature() const
{
- QList::Iterator it;
- QList list = mIdMap.values();
-
- for( it = list.begin(); it != list.end(); ++it ) {
- mRevisionMap.remove( (*it)->id() );
- delete *it;
- }
- mIdMap.clear();
- mFirstFeature = 0;
+ return mCurrentFeature;
}
-void FeatureMap::setCurrentFeature( Feature *f )
+const Feature::List & FeatureMap::features() const
{
- mCurrentFeature = f;
+ return mFeatures;
}
void FeatureMap::addFeatures(QList features)
{
- for (int i = 0; i < features.size(); ++i)
- addFeature(features[i]);
+ foreach( Feature *feature, features ) {
+ addFeature(feature);
+ }
}
void FeatureMap::memberFeatureChanged()
@@ -272,16 +272,11 @@
mRevisionMap[f->id()] = QString::number( f->revision() );
}
- if ( !mFirstFeature ) mFirstFeature = f;
-
if ( mCache && !f->id().isEmpty() ) {
if ( !mCache->hasRevision( f->id(), QString::number( f->revision() ) ) ) {
mCache->save( f->id(), QString::number( f->revision() ), f );
}
}
- if( f->isModified() ) {
- mModifiedFeatures.append( f );
- }
emit featureAdded( f );
}
@@ -292,37 +287,36 @@
return;
if( mCurrentFeature == f ) {
- emit currentFeatureRemoved();
+ setCurrentFeature( 0 );
}
mRevisionMap.remove( f->id() );
mIdMap.remove( f->id() );
- if( f->isModified() ) {
- mModifiedFeatures.removeAll(f);
- }
if( mCache ) {
mCache->removeModifiedItem( f->id() );
}
mFeatures.removeAll(f);
delete f;
- if( mModifiedFeatures.isEmpty() ) {
+ if( hasNoModifiedFeatures() ) {
mSynch = true;
}
- if( mFeatures.size() == 0 )
- mFirstFeature = 0;
+ // Would be better to emit featureRemoved(f)
+ emit featuresModified();
}
-Feature *
-FeatureMap::feature(const QString &id)
+void FeatureMap::signalFeatureModification( Feature *f )
{
- QMap::ConstIterator it;
+ if (!f) f = mCurrentFeature;
+ f->setModified(true);
+ emit featureChanged( f );
+}
- it = mIdMap.find(id);
- if (it == mIdMap.end())
- return 0;
- return it.value();
+Feature *
+FeatureMap::feature(const QString &id) const
+{
+ return mIdMap.value( id, NULL );
}
Feature::List
@@ -330,46 +324,55 @@
{
Feature::List features;
- Feature::List::ConstIterator it;
- for ( it = mFeatures.begin(); it != mFeatures.end(); ++it ) {
- if ( (*it)->isModified() ) features.append( *it );
+ foreach( Feature *f, mFeatures ) {
+ if ( f->isModified() ) features.append( f );
}
return features;
}
+
+bool FeatureMap::hasNoModifiedFeatures() const
+{
+ foreach( Feature *f, mFeatures ) {
+ if ( f->isModified() )
+ return false;
+ }
+ return true;
+}
+
+
Feature::List
FeatureMap::newFeatures() const
{
Feature::List features;
- Feature::List::ConstIterator it;
- for ( it = mFeatures.begin(); it != mFeatures.end(); ++it ) {
- if ( (*it)->isNew() ) features.append( *it );
+ foreach( Feature *f, mFeatures ) {
+ if ( f->isNew() ) features.append( f );
}
return features;
}
-Feature *FeatureMap::firstFeature() const
-{
- return mFirstFeature;
-}
-
QString FeatureMap::featuresAsXml( bool onlyModified ) const
{
QString xml;
-
+ Feature::List features;
+
+ if (onlyModified) {
+ features = modifiedFeatures();
+ }
+ else {
+ features = mFeatures;
+ }
+
xml += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
xml += "http://inttools.suse.de/sxkeeper/schema/keeper\" "
- "size=\"" + QString::number( mFeatures.size() ) + "\">\n";
+ "size=\"" + QString::number( features.size() ) + "\">\n";
- Feature::List::ConstIterator it;
- for( it = mFeatures.begin(); it != mFeatures.end(); ++it ) {
- if ( !onlyModified || (*it)->isModified() ) {
- xml += featureAsXmlObject( *it );
- }
+ foreach( Feature *f, features ) {
+ xml += featureAsXmlObject( f );
}
xml += "\n";
@@ -391,7 +394,7 @@
bool FeatureMap::isModified() const
{
- return (!modifiedFeatures().isEmpty() || (mCache && mCache->hasNewItems()));
+ return (!hasNoModifiedFeatures() || (mCache && mCache->hasNewItems()));
}
bool FeatureMap::doQuery( const Query &query )
@@ -443,7 +446,8 @@
return mQueryEngine->doCachedQuery( query );
} else {
// do not clear for incremental queries
- clearFeatureList();
+ // if (!incrementalQueries) { ...
+ mFeatures.clear();
return mQueryEngine->doQuery( query );
}
}
@@ -477,7 +481,7 @@
}
if( inMemory ) {
- if( !silent ) emit currentFeatureChanged( f );
+ if( !silent ) emit currentFeatureChanged( mCurrentFeature );
return true;
}
@@ -545,13 +549,9 @@
if( mRestockIds.isEmpty() ) {
emit dataAboutToBeReset();
// Delete old features that are no longer required
- clearFeatureList();
+ mFeatures.clear();
// Readd the features that are still in memory
- Feature::List::ConstIterator it;
- for( it = mKeptFeatures.begin(); it != mKeptFeatures.end(); ++it ) {
- addFeature( (*it) );
- }
- mFeatures = mKeptFeatures;
+ addFeatures(mKeptFeatures);
}
if( !mCachedIds.isEmpty() )
@@ -660,8 +660,6 @@
mQueryTiming.start();
- mModifiedFeatures.removeAll( feature );
-
if( Prefs::self()->offlineModeEnabled() ) {
if( mCache ) {
Feature *reloadedFeature = mCache->load( feature->id(), true );
@@ -710,15 +708,17 @@
QString msg = i18n("Reloaded feature #%1%2").arg( f->id() ).arg( s );
emit statusMessage( msg );
- emit featureReloaded( f );
+
+ f->setModified( false );
+ emit featureChanged( f );
if( mCache ) {
mCache->removeModifiedItem( f->id() );
}
- if( mModifiedFeatures.isEmpty() ) {
+ if( hasNoModifiedFeatures() ) {
mSynch = true;
- emit featuresModified( false );
+ emit featuresModified();
}
emit queryDone( true );
@@ -749,9 +749,8 @@
void FeatureMap::slotSaveDone( const QString &id )
{
Feature *f = feature( id );
- if ( !f ) return;
-
- finishSave( f );
+ if ( f )
+ finishSave( f );
}
void FeatureMap::slotNewSaveDone( Feature *f, const QString &id )
@@ -787,10 +786,10 @@
} else {
QTextStream ts(&file);
- for( int i = 0; i < mFeatures.size(); ++i ) {
- if( mFeatures[i]->isModified() || mFeatures[i]->isNew() )
+ foreach( const Feature *feature, mFeatures ) {
+ if ( feature->isModified() || feature->isNew() )
continue;
- ts << mFeatures[i]->id() << endl;
+ ts << feature->id() << endl;
}
}
}
@@ -800,16 +799,8 @@
if( !mCurrentFeature || !mCurrentFeature->isModified() )
return true;
- Feature *feature = mCurrentFeature;
- // emit currentFeatureAboutToBeSaved();
-
- // feature->setModified( true ); // bull shit this is already set to modified
mSynch = false;
- if( !mModifiedFeatures.contains( feature ) ) {
- mModifiedFeatures.append( feature );
- }
-
if ( askForSaving && !Prefs::self()->offlineModeEnabled() ) {
int result =
KMessageBox::questionYesNoCancel( mView,
@@ -832,33 +823,29 @@
bool FeatureMap::checkSynch( bool synchWithKeeper )
{
checkModified( false );
- if( mSynch && newFeatures().isEmpty() ) {
+ if ( mSynch && newFeatures().isEmpty() )
return true;
- } else {
- if( Prefs::self()->offlineModeEnabled() && !synchWithKeeper) {
- return saveCache( Feature::List( mModifiedFeatures ) );
- } else {
- SaveAllDialog dlg( mView, this );
- if( !synchWithKeeper && mCache )
- dlg.setCacheEnabled( true );
- int result = dlg.exec();
- if( result == QDialog::Rejected )
- return false;
- else
- return true;
- }
- }
+
+ if ( Prefs::self()->offlineModeEnabled() && !synchWithKeeper)
+ return saveCache( modifiedFeatures() );
+
+ SaveAllDialog dlg( mView, this );
+ if( !synchWithKeeper && mCache )
+ dlg.setCacheEnabled( true );
+
+ if( dlg.exec() == QDialog::Rejected )
+ return false;
+
return true;
}
bool FeatureMap::saveCache( const Feature::List &list )
{
- if( !validateFeatures( list ) )
+ if ( !validateFeatures( list ) )
return false;
- if( !mCache ) {
+ if ( !mCache )
return false;
- }
Feature::List::ConstIterator it;
for( it = list.begin(); it != list.end(); ++it ) {
@@ -868,15 +855,15 @@
} else {
recordChange( f );
}
- mModifiedFeatures.removeAll( f );
SaveResult r;
r.feature = f;
r.status = SaveResult::Ok;
emit saveFeaturesResult( r );
}
- if( mModifiedFeatures.isEmpty() ) {
+
+ if ( hasNoModifiedFeatures() ) {
mSynch = true;
- emit featuresModified( false );
+ emit featuresModified();
}
emit saveDone();
return true;
@@ -891,12 +878,6 @@
return true;
}
-bool FeatureMap::saveCurrentFeature()
-{
- checkModified( false );
- return saveKeeper( mCurrentFeature );
-}
-
bool FeatureMap::saveKeeper( Feature *f)
{
if( !f || !validateFeature( f ) )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fate-20170608-ebd3ef1b/src/libfate/featuremap.h new/fate-20170623-c1270a95/src/libfate/featuremap.h
--- old/fate-20170608-ebd3ef1b/src/libfate/featuremap.h 2017-06-08 14:56:14.827454029 +0200
+++ new/fate-20170623-c1270a95/src/libfate/featuremap.h 2017-06-23 13:02:00.425130400 +0200
@@ -1,9 +1,10 @@
/*
This file is part of Fate.
- Copyright (c) 2005-2007 SUSE LINUX Products GmbH
+ Copyright (c) 2005-2007, 2014 SUSE LINUX Products GmbH
Author: Cornelius Schumacher
+ Joachim Plack
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -47,22 +48,16 @@
~FeatureMap();
void clear();
- void clearFeatureList();
-
- void clearPersistantFeatures();
- Feature *feature( const QString &id );
-
- const Feature::List &features() const {
- return mFeatures;
- }
+ Feature *feature( const QString &id ) const;
+ Feature *currentFeature() const;
+ const Feature::List &features() const;
Feature::List modifiedFeatures() const;
+ bool hasNoModifiedFeatures() const;
Feature::List newFeatures() const;
bool isModified() const;
- Feature *firstFeature() const;
-
QString featuresAsXml( bool onlyModified = false ) const;
QString featureAsXmlObject( Feature *feature ) const;
@@ -78,7 +73,7 @@
bool checkModified( bool askForSaving );
bool checkSynch( bool dataAboutToChange );
- bool hasModifiedFeatures();
+ bool hasCachedModifiedFeatures() const;
void invalidateCache();
@@ -91,13 +86,13 @@
void addFeature( Feature * );
void addFeatures(QList);
void removeFeature( Feature * );
+ void signalFeatureModification( Feature *f = 0 );
bool saveCache( const Feature::List & );
bool saveKeeper( Feature * );
bool saveKeeper( const Feature::List &,
SaveEngine::FeedbackMethod m = SaveEngine::SignalFeedback );
bool saveModifiedFeatures();
- bool saveCurrentFeature();
void setCurrentFeature( Feature * );
void cancelSave();
@@ -105,34 +100,40 @@
Feature *origFeature( Feature *f );
signals:
+ // emit a status message that can be appropriately displayed
void statusMessage( const QString & );
+ // an asynchronous keeper query has been finished
void queryDone( bool );
void dataAboutToBeReset();
// TODO: is dataChanged() the right name for this signal?
void dataChanged();
+ // a new feature has been added to the feature map
void featureAdded( Feature * );
+ // a feature in the map has been changed
void featureChanged( Feature * );
- void featureReloaded( Feature * );
+ // passthrough signal from QueryEngine
void connectionEstablished( bool );
+ // response to a save-action requester that saving has finished
+ // and he can check the results
void saveDone();
+ // passthrough signal from saveEngine plus adequate signal from
+ // cache handling
void saveFeaturesResult( const SaveResult & );
- void featuresModified( bool );
+ // all or some features have been modified or removed
+ void featuresModified();
void currentFeatureChanged( Feature * );
- void currentFeatureRemoved();
- // void currentFeatureAboutToBeSaved();
protected:
void finishSave( Feature * );
void finishReload( Feature * );
-
bool validateFeature( Feature *feature );
bool validateFeatures( Feature::List features );
bool validateInteractive( Feature *feature );
@@ -154,7 +155,6 @@
private:
QMap mIdMap;
- Feature *mFirstFeature;
Feature *mCurrentFeature;
Feature::List mFeatures;
Feature::List mKeptFeatures;
@@ -163,8 +163,6 @@
Query mCurrentQuery;
bool mQueryRunning;
- Feature::List mModifiedFeatures;
-
QueryEngine *mQueryEngine;
SaveEngine *mSaveEngine;
Timing mQueryTiming;